From a5f0ab0d3fc6f27a7745f430cd24f2b6c5d88423 Mon Sep 17 00:00:00 2001 From: mattias Date: Tue, 29 Apr 2003 22:15:20 +0000 Subject: [PATCH] implemented IsUpdateLocked git-svn-id: trunk@4111 - --- components/gtk/gtkglarea/gtkopengl.pas | 2 +- ide/componentpalette.pas | 2 +- ide/projectinspector.pas | 4 +-- packager/componentreg.pas | 4 +-- packager/packagesystem.pas | 35 ++++++++++++++------------ packager/pkggraphexplorer.pas | 6 ++--- 6 files changed, 28 insertions(+), 25 deletions(-) diff --git a/components/gtk/gtkglarea/gtkopengl.pas b/components/gtk/gtkglarea/gtkopengl.pas index 118d76d798..232ab10cca 100644 --- a/components/gtk/gtkglarea/gtkopengl.pas +++ b/components/gtk/gtkglarea/gtkopengl.pas @@ -1,6 +1,6 @@ { This file was automatically created by Lazarus. Do not edit! This source is only used to compile and install - the package GTKOpenGL 0.0. + the package GTKOpenGL 1.0. } unit GTKOpenGL; diff --git a/ide/componentpalette.pas b/ide/componentpalette.pas index ada6b6fb96..9d158fa24a 100644 --- a/ide/componentpalette.pas +++ b/ide/componentpalette.pas @@ -310,7 +310,7 @@ var OldActivePage: String; begin if fUpdatingNotebook then exit; - if IsUpdating then begin + if IsUpdateLocked then begin fNoteBookNeedsUpdate:=true; exit; end; diff --git a/ide/projectinspector.pas b/ide/projectinspector.pas index e807728a64..15f71b8077 100644 --- a/ide/projectinspector.pas +++ b/ide/projectinspector.pas @@ -109,7 +109,7 @@ type destructor Destroy; override; procedure BeginUpdate; procedure EndUpdate; - function IsUpdating: boolean; + function IsUpdateLocked: boolean; procedure UpdateAll; procedure UpdateTitle; procedure UpdateButtons; @@ -711,7 +711,7 @@ begin end; end; -function TProjectInspectorForm.IsUpdating: boolean; +function TProjectInspectorForm.IsUpdateLocked: boolean; begin Result:=FUpdateLock>0; end; diff --git a/packager/componentreg.pas b/packager/componentreg.pas index ef58e4e357..3071ff52a0 100644 --- a/packager/componentreg.pas +++ b/packager/componentreg.pas @@ -159,7 +159,7 @@ type procedure ClearButtons; virtual; procedure BeginUpdate(Change: boolean); procedure EndUpdate; - function IsUpdating: boolean; + function IsUpdateLocked: boolean; procedure ConsistencyCheck; function Count: integer; function GetPage(const APageName: string; @@ -461,7 +461,7 @@ begin if FUpdateLock=0 then DoEndUpdate(fChanged); end; -function TBaseComponentPalette.IsUpdating: boolean; +function TBaseComponentPalette.IsUpdateLocked: boolean; begin Result:=FUpdateLock>0; end; diff --git a/packager/packagesystem.pas b/packager/packagesystem.pas index 57e38289cf..fa687327b0 100644 --- a/packager/packagesystem.pas +++ b/packager/packagesystem.pas @@ -312,25 +312,28 @@ var begin Result:=false; BeginUpdate(false); - AFilename:=PkgLink.Filename; - if not FileExists(AFilename) then exit; try - XMLConfig:=TXMLConfig.Create(AFilename); - NewPackage:=TLazPackage.Create; - NewPackage.Filename:=AFilename; - NewPackage.LoadFromXMLConfig(XMLConfig,'Package/'); - XMLConfig.Free; - except - on E: Exception do begin - writeln('unable to read file "'+AFilename+'" ',E.Message); - exit; + AFilename:=PkgLink.Filename; + if not FileExists(AFilename) then exit; + try + XMLConfig:=TXMLConfig.Create(AFilename); + NewPackage:=TLazPackage.Create; + NewPackage.Filename:=AFilename; + NewPackage.LoadFromXMLConfig(XMLConfig,'Package/'); + XMLConfig.Free; + except + on E: Exception do begin + writeln('unable to read file "'+AFilename+'" ',E.Message); + exit; + end; end; + if not NewPackage.MakeSense then exit; + if PkgLink.Compare(NewPackage)<>0 then exit; + // ok + AddPackage(NewPackage); + finally + EndUpdate; end; - if not NewPackage.MakeSense then exit; - if PkgLink.Compare(NewPackage)<>0 then exit; - // ok - AddPackage(NewPackage); - EndUpdate; Result:=true; end; diff --git a/packager/pkggraphexplorer.pas b/packager/pkggraphexplorer.pas index 7db969843a..2cff6900af 100644 --- a/packager/pkggraphexplorer.pas +++ b/packager/pkggraphexplorer.pas @@ -81,7 +81,7 @@ type destructor Destroy; override; procedure BeginUpdate; procedure EndUpdate; - function IsUpdating: boolean; + function IsUpdateLocked: boolean; procedure UpdateAll; procedure UpdateTree; procedure UpdateList; @@ -507,14 +507,14 @@ begin if FChangedDuringLock then UpdateAll; end; -function TPkgGraphExplorer.IsUpdating: boolean; +function TPkgGraphExplorer.IsUpdateLocked: boolean; begin Result:=FUpdateLock>0; end; procedure TPkgGraphExplorer.UpdateAll; begin - if IsUpdating then begin + if IsUpdateLocked then begin FChangedDuringLock:=true; exit; end;