Re: [Lazarus] what can be wrong in this code? (qrobjects.pas)

2015-10-14 Thread Ondrej Pokorny

On 14.10.2015 13:22, Mattias Gaertner wrote:

On Wed, 14 Oct 2015 13:41:30 +0300
FreeMan  wrote:


>[...]
>note:
>after this error, in editor toolbar I have "Open packages of current
>unit" icon, its start blink.?

I see this too under Linux/Gtk2.


Since freeman hasn't created a bug report and I am too lazy to write one 
myself, I sent the patch here.


Ondrej
Index: ide/main.pp
===
--- ide/main.pp (revision 50059)
+++ ide/main.pp (working copy)
@@ -3729,16 +3729,19 @@
   CanOpenPkgOfFile, CanAddCurFile: Boolean;
 begin
   GetCurrentUnit(ASrcEdit,AUnitInfo);
-  if Assigned(AUnitInfo) and (AUnitInfo.Filename <> FLastUnitInfoFileName) then
+  if Assigned(AUnitInfo) then
   begin
-PkgFile:=PackageGraph.FindFileInAllPackages(AUnitInfo.Filename,true,
-  not AUnitInfo.IsPartOfProject);
-CanOpenPkgOfFile:=Assigned(PkgFile);
-CanAddCurFile:=(not AUnitInfo.IsVirtual) and 
FileExistsUTF8(AUnitInfo.Filename)
-  and not AUnitInfo.IsPartOfProject;
-MainIDEBar.itmPkgOpenPackageOfCurUnit.Enabled:=CanOpenPkgOfFile;
-MainIDEBar.itmPkgAddCurFileToPkg.Enabled:=CanAddCurFile;
-FLastUnitInfoFileName := AUnitInfo.Filename;
+if (AUnitInfo.Filename <> FLastUnitInfoFileName) then
+begin
+  PkgFile:=PackageGraph.FindFileInAllPackages(AUnitInfo.Filename,true,
+not AUnitInfo.IsPartOfProject);
+  CanOpenPkgOfFile:=Assigned(PkgFile);
+  CanAddCurFile:=(not AUnitInfo.IsVirtual) and 
FileExistsUTF8(AUnitInfo.Filename)
+and not AUnitInfo.IsPartOfProject;
+  MainIDEBar.itmPkgOpenPackageOfCurUnit.Enabled:=CanOpenPkgOfFile;
+  MainIDEBar.itmPkgAddCurFileToPkg.Enabled:=CanAddCurFile;
+  FLastUnitInfoFileName := AUnitInfo.Filename;
+end;
   end else
   begin
 MainIDEBar.itmPkgOpenPackageOfCurUnit.Enabled:=False;
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] what can be wrong in this code? (qrobjects.pas)

2015-10-14 Thread Juha Manninen
On Wed, Oct 14, 2015 at 8:55 PM, Ondrej Pokorny  wrote:
> Since freeman hasn't created a bug report and I am too lazy to write one
> myself, I sent the patch here.

Applied in r50063, thanks.

Juha

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] what can be wrong in this code? (qrobjects.pas)

2015-10-14 Thread Mattias Gaertner
On Wed, 14 Oct 2015 13:41:30 +0300
FreeMan  wrote:

>[...]
> note:
> after this error, in editor toolbar I have "Open packages of current 
> unit" icon, its start blink.?

I see this too under Linux/Gtk2.

Juha?

Mattias

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] what can be wrong in this code? (qrobjects.pas)

2015-10-14 Thread Ondrej Pokorny

On 14.10.2015 13:22, Mattias Gaertner wrote:

On Wed, 14 Oct 2015 13:41:30 +0300
FreeMan  wrote:


[...]
note:
after this error, in editor toolbar I have "Open packages of current
unit" icon, its start blink.?

I see this too under Linux/Gtk2.

Juha?

Probably my problem.

Ondrej

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus