[Lazarus] Buttons in frames

Mark Morgan Lloyd markMLl.lazarus at telemetry.co.uk
Sun Feb 3 11:42:33 CET 2013


Mattias Gaertner wrote:

>>> 1. Why should the compiler report a wrong path?
>> That's not quite what I said. You pointed out that the IDE was 
>> converting the relative path to an absolute one which is what the 
>> compiler sees, the compiler reports an absolute path in any error 
>> message, and by the time it sees that the IDE's forgotten that it's 
>> already got the file open.
> 
> Sorry. You lost me.

Well, I obviously accept that I'm Doing It Wrong, and that having 
symlinked directories in the search path is ill-advised (which to my 
mind is unfortunate). I honestly don't want to bang on about this to the 
extent that I appear boorish, but I'll try once more in the interest of 
highlighting something which I think is a problem.

The project file is /usr/local/src/heavywethers/trunk/heavywethers.lpi 
and the program file is in the same directory. One of the files it's 
referencing is dbconfig2.pas (internal name DbConfigCode2), which is in 
the absolute directory /usr/local/src/inifiles/trunk accessed via a 
symlinked directory and the project's "Other unit files" setting as 
./inifiles/trunk.

If I force an error into this file and force all files to be saved, when 
I run the compilation I see

[TCompiler.Compile] CmdLine="/usr/local/bin/ppc386-2.6.0  -MObjFPC 
-Scagi -O1 -g -gl -vewnhi -Se3 -Fi/usr/local/share/lazarus-trunk/ide 
-Fl/opt/gnome/lib -Fu/usr/local/src/heavywethers/inifiles/trunk
..
Compiling HeavyWethers.lpr
Compiling /usr/local/src/heavywethers/inifiles/trunk/dbconfigcode2.pas

but I now have two tabbed panes in my source editor: "DbConfigCode2" and 
"DbConfigCode2(2)" with the latter focussed. If I fix the error on the 
focussed pane, force save-all, and hit compile I get an immediate 
dialogue "Some files have changed on disk:" 
"/usr/local/src/inifiles/trunk/dbconfigcode2.pas". I can fix that by 
selecting "Reload from disk" *provided* that I've done manual saves 
after every change, If I don't force the saves then the most recent 
edits might be lost.

The second tabbed pane should not, to my mind, be opened: the file 
already exists on the screen, and the only reason that the IDE thinks 
it's not is that it's not kept track of the fact that it's canonicalised 
the path when it passed it to the compiler. Also the dialogue should not 
pop up: all changes have already been flushed to disk but the IDE hasn't 
adequately realised that.

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]




More information about the Lazarus mailing list