Recent

Author Topic: "LCLVersion" in *.lfm files  (Read 4832 times)

piola

  • Full Member
  • ***
  • Posts: 157
  • Lazarus 2.2, 64bit on Windows 8.1 x64
"LCLVersion" in *.lfm files
« on: June 12, 2025, 01:52:31 pm »
Hello,

why does Lazarus keep adding and removing the LCLVersion=4.0.0.0 in the *.lfm files. This drives me crazy because I often get changes in git just because of this line.

My hope was that it's fixed/changed in Lazarus 4.0, but this line is still being added or removed from time to time.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12846
  • FPC developer.
Re: "LCLVersion" in *.lfm files
« Reply #1 on: June 12, 2025, 02:11:56 pm »
Probably to detect when upgrades are necessary.  Lazarus has way more public available versions than something like Delphi, so that makes the upgrade matrix more complicated

piola

  • Full Member
  • ***
  • Posts: 157
  • Lazarus 2.2, 64bit on Windows 8.1 x64
Re: "LCLVersion" in *.lfm files
« Reply #2 on: June 12, 2025, 02:47:25 pm »
Yes, of course that what the line itself is for. But I'm working with a fixed Lazarus version, e.g. 4.0. After some changes in the form, Lazarus removes the LCLVersion=4.0.0.0 line completely (it's not present anymore in the .lfm file), and after some more changes, it gets added again. The content 4.0.0.0 doesn't change, but the entire line is being added or removed.

wp

  • Hero Member
  • *****
  • Posts: 13512
Re: "LCLVersion" in *.lfm files
« Reply #3 on: June 12, 2025, 03:21:10 pm »
You should file a bug report about it, if possible, with conditions after which the line disappears and after which it comes back.

zeljko

  • Hero Member
  • *****
  • Posts: 1926
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: "LCLVersion" in *.lfm files
« Reply #4 on: June 12, 2025, 04:54:27 pm »
Same problem with trunk. Sometimes it completely removes LCLVersion ,sometimes it adds LCLVersion to the .lfm

etrusco

  • New Member
  • *
  • Posts: 22
Re: "LCLVersion" in *.lfm files
« Reply #5 on: June 17, 2025, 09:21:48 pm »
From the code, the only condition to skip storing the LCLVersion is "Parent <> nil". May this is related to the docked IDE? Or is there any special handling in TWriter?

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12345
  • Debugger - SynEdit - and more
    • wiki
Re: "LCLVersion" in *.lfm files
« Reply #6 on: June 17, 2025, 09:45:17 pm »
Well, that probably checks that it a top level component (frame or form / but frame, only if not embedded on a form).

Because once a frame is embedded into a form, then the form already writes the lcl version.

But, afaik in the docked form editor the form has a parent.

If that is what is causing it, then that is a bug. (and there must be some better check / I.e. if the parent is csDesigning)...
IIRC, but I can't recall there is some function for that already... (might not check that flag, but another, but would serve the purpose)

zeljko

  • Hero Member
  • *****
  • Posts: 1926
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: "LCLVersion" in *.lfm files
« Reply #7 on: June 17, 2025, 11:05:36 pm »
Yes, I'm using anchordocking + docked form editor, so it is definitelly bug of docked form editor.

Muso

  • Sr. Member
  • ****
  • Posts: 362
Re: "LCLVersion" in *.lfm files
« Reply #8 on: August 18, 2025, 10:46:15 pm »
I reported this as bug now:
https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/41801

I use the docked form editor but also noticed the bug the last weeks and this time I did not yet use the docked form editor. I did not report this earlier because I had no way to reproduce

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4715
  • I like bugs.
Re: "LCLVersion" in *.lfm files
« Reply #9 on: August 24, 2025, 10:14:04 am »
From the code, the only condition to skip storing the LCLVersion is "Parent <> nil". May this is related to the docked IDE? Or is there any special handling in TWriter?
Where is the "Parent <> nil" condition? The fix should probably go there.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12345
  • Debugger - SynEdit - and more
    • wiki
Re: "LCLVersion" in *.lfm files
« Reply #10 on: August 24, 2025, 10:28:23 am »
If you get to this before me (likely) then look at 9b4c81b56ba012d4a3a146fe14a1fd03d41979f0

From the comment, this contains the correct way to check... (But I have not verified that)

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4715
  • I like bugs.
Re: "LCLVersion" in *.lfm files
« Reply #11 on: August 24, 2025, 03:11:29 pm »
OK. However I didn't even find yet where the properties are saved to .lfm file. I may study this later.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

DomingoGP

  • Full Member
  • ***
  • Posts: 115
Re: "LCLVersion" in *.lfm files
« Reply #12 on: August 25, 2025, 09:59:51 am »
I think the problem is in:
lcl/include/customform.inc  line 3188

Code: Pascal  [Select][+][-]
  1. function TForm.LCLVersionIsStored: boolean;
  2. begin
  3.   Result:=Parent=nil;
  4. end;
  5.  

and
lcl/include/customframe.inc line 225

Code: Pascal  [Select][+][-]
  1. function TFrame.LCLVersionIsStored: boolean;
  2. begin
  3.   Result := Parent = nil;
  4. end;

 

TinyPortal © 2005-2018