[Lazarus] Clearing a project

Mattias Gaertner nc-gaertnma at netcologne.de
Mon Feb 4 15:19:07 CET 2013


On Mon, 04 Feb 2013 13:58:01 +0000
Mark Morgan Lloyd <markMLl.lazarus at telemetry.co.uk> wrote:

> Mattias Gaertner wrote:
> > Mark Morgan Lloyd <markMLl.lazarus at telemetry.co.uk> hat am 4. Februar 2013 um
> > 13:01 geschrieben:
> >> Mattias Gaertner wrote:
> >>> Mark Morgan Lloyd <markMLl.lazarus at telemetry.co.uk> hat am 4. Februar 2013
> >>> um
> >>> 12:08 geschrieben:
> >>>> Is there an easy way of clearing all stored state out of the .lps/lpi
> >>>> files, i.e. leaving no history of opened units/forms etc. except
> >>>> possibly a reference to the .lpr or the main-form unit?
> >>> You can save session data separate in the lps file.
> >>> Close project, delete lps, open project.
> >> Did that yesterday, but it still leaves at least one file in the .lpi
> >> (which was the one that we didn't want saved, under the circumstances).
> > 
> > What was left, what should not be there?
> 
> If I do a close-all, save-all, exit and then delete the .lps, when I 
> bring up Lazarus it's displaying a tab DbConfigCode2 pointing at the 
> "incorrect" /usr/local/src/inifiles/trunk/dbconfigcode2.pas.
> 
> The issue in this case appears to be that in the .lpi file there's
> 
>      <Units Count="13">
> ..
>        <Unit12>
>          <Filename Value="..\..\inifiles\trunk\dbconfigcode2.pas"/>
>          <IsPartOfProject Value="True"/>
>          <ComponentName Value="DbConfigFrame"/>
>          <HasResources Value="True"/>
>          <ResourceBaseClass Value="Frame"/>
>          <UnitName Value="DbConfigCode2"/>
>        </Unit12>
>      </Units>
> 
> which, if I understand things correctly, shouldn't be there since I've 
> enables .lps support.

The above data are *not* session data. Session data is what file is
open, cursor position, break points, jump history, ....
The above lpi tells, that "..\..\inifiles\trunk\dbconfigcode2.pas"
belongs to the project.
The Project Inspector will show the same.
You can remove this file from the project via the Project Inspector or
Project / Remove from Project.

 
> >>>> I'm mindful of my current issue with files being referenced over
> >>>> different paths (when such a thing is possible, e.g. because of the
> >>>> presence of symlinks) but also it would seem like a good thing to do
> >>>> before publishing a project as source.
> >>> Do you mean
> >>> Project / Publish Project
> >> I was thinking about the general case, including svn to a public
> >> repository such as Berlios.
> > 
> > The lps is normally not stored in the svn repository.
> 
> I know, but as I've said above there's a list of units stored in the 
> .lpi as well. How does one clear this?

This list gives the IDE the clues what files are important and what not.
So, you should not clear it, you should clean it up and add all
missing project units. For example via the Project Inspector.

Mattias
 




More information about the Lazarus mailing list