[Lazarus] Criteria to add/remove UnitName from project (lpi) file

luiz americo pereira camara luizmed at oi.com.br
Sun Mar 22 21:44:35 CET 2015


2015-03-22 16:59 GMT-03:00 luiz americo pereira camara <luizmed at oi.com.br>:

>
>
> 2015-03-22 16:32 GMT-03:00 Mattias Gaertner <nc-gaertnma at netcologne.de>:
>
>> On Sun, 22 Mar 2015 10:15:23 -0300
>> > http://imagebin.ca/v/1vhYYNAJuxPx : Here two files have UnitName added
>> in
>> > lpi
>> >
>> > http://imagebin.ca/v/1vhYLsrfpWDd : One commit later, the same files
>> have
>> > UnitName removed
>> >
>> > Is this a bug ?
>>
>> Probably. Do you know how to reproduce it?
>>
>
>
Found something that may be related:

Take the following entry:

<Unit1>
        <Filename Value="views\mainview.pas"/>
        <IsPartOfProject Value="True"/>
        <ComponentName Value="MainViewForm"/>
        <HasResources Value="True"/>
        <ResourceBaseClass Value="Form"/>
</Unit1>

In TUnitInfo.LoadFromXMLConfig:

A Filename is set to  FileName ('views\mainview.pas')
AFilename:=XMLConfig.GetValue(Path+'Filename/Value','');

Later AFileName is set again this time to ResourceFileName, that is empty
AFilename:=XMLConfig.GetValue(Path+'ResourceFilename/Value','');

Later AFilename is checked before setting fUnitName:
if FilenameIsPascalSource(AFilename) then

fUnitName:=XMLConfig.GetValue(Path+'UnitName/Value',ExtractFileNameOnly(AFilename));

Since AFileName is empty, fUnitName will not be set



In the other side, in the following file

      <Unit2>
        <Filename Value="models\patientclasses.pas"/>
        <IsPartOfProject Value="True"/>
        <UnitName Value="PatientClasses"/>
      </Unit2>

fUnitName is set to empty at LoadFromXMLConfig, but at the time of saving
fUnitName gets its correct value 'PatientClasses'. Could not detect where
gets the correct value. Breakpoints  at ImproveUnitNameCache, SetUnitName,
ReadUnitSource and LoadFromXMLConfig

Luiz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20150322/058f6367/attachment-0003.html>


More information about the Lazarus mailing list