[Lazarus] Renaming files within a project after creation

Mattias Gaertner nc-gaertnma at netcologne.de
Sat Aug 23 11:16:32 CEST 2008


On Sat, 23 Aug 2008 09:35:20 +0200
"Graeme Geldenhuys" <graemeg.lists at gmail.com> wrote:

> On Fri, Aug 22, 2008 at 7:15 PM, Tom Verhoeff <T.Verhoeff at tue.nl>
> wrote:
> > What about changing it afterwards?  Issue: consistency.
> > Some files may use others (either in a uses clause or via an
> > include). The renaming should be carried out consistently
> > throughout the project.  Note that the .lpi file also contains file
> > names.
> 
> I do the following...since Delphi 4 days.
> 
> 
> 1)  Open the Unit in editor.  Then "File | Save As..".  This takes
> care of the file name, "unit" line inside the file and the .lpi file.
> 
> 2)  Delete the the old name .dcu file.

0.9.25 deletes the .ppu file automatically.


> 3) Delete (or move/backup) the old file.

0.9.25 asks to delete the old pas, lfm, lrs file.

 
> 4) Do a "Build All" and fix the uses clauses as the compiler
> complains.

And that's the todos.
The refactoring function needs to be extended for that.
About 'Build All': Yes, this is needed. The problem is how the IDE
should handle that. Maybe the IDE should simply delete all ppu files
instead of only one?


> You're done!  :-)

You forgot .po files and fpdoc xml files.
That is a to do too.


> Steps 2 & 3 are important, otherwise the compiler will (sometimes)
> still find the old .dcu and allow compiling without errors.

Small correction:
FPC will almost always use the old unit and you often get linking
errors, which are sometimes hard to find. But with lazarus 0.9.25 this
is not a problem any more, iff you use build all.


Mattias



More information about the Lazarus mailing list