mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-09 11:29:31 +01:00
codetools: TCodeBufXMLConfig.WriteXMLFile: only save if needed
git-svn-id: trunk@35936 -
This commit is contained in:
parent
6088a1a052
commit
64d28c0873
@ -461,6 +461,7 @@ begin
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
ms.Position:=0;
|
ms.Position:=0;
|
||||||
Buf.LoadFromStream(ms);
|
Buf.LoadFromStream(ms);
|
||||||
|
if not Buf.FileOnDiskNeedsUpdate then exit;
|
||||||
if Buf.Save then exit; // success
|
if Buf.Save then exit; // success
|
||||||
finally
|
finally
|
||||||
ms.Free;
|
ms.Free;
|
||||||
|
|||||||
@ -46,8 +46,13 @@ interface
|
|||||||
{$endif}
|
{$endif}
|
||||||
|
|
||||||
uses
|
uses
|
||||||
SysUtils, Classes, FileUtil, LCLProc, DefineTemplates,
|
SysUtils, Classes, InterfaceBase, FileUtil, LCLProc,
|
||||||
InterfaceBase;
|
{$IFNDEF OldXMLCfg}
|
||||||
|
Laz2_XMLCfg,
|
||||||
|
{$ELSE}
|
||||||
|
Laz_XMLCfg,
|
||||||
|
{$ENDIF}
|
||||||
|
DefineTemplates;
|
||||||
|
|
||||||
const
|
const
|
||||||
LazarusVersionStr = {$I version.inc};
|
LazarusVersionStr = {$I version.inc};
|
||||||
@ -64,6 +69,8 @@ const
|
|||||||
'cocoa (alpha)',
|
'cocoa (alpha)',
|
||||||
'customdraw (alpha)'
|
'customdraw (alpha)'
|
||||||
);
|
);
|
||||||
|
type
|
||||||
|
TIDEXMLCfg = TXMLConfig;
|
||||||
|
|
||||||
{ Config Path Functions }
|
{ Config Path Functions }
|
||||||
|
|
||||||
|
|||||||
@ -51,7 +51,7 @@ uses
|
|||||||
Classes, SysUtils, TypInfo, FPCAdds, LCLProc, LCLIntf, LCLType, Forms,
|
Classes, SysUtils, TypInfo, FPCAdds, LCLProc, LCLIntf, LCLType, Forms,
|
||||||
FileUtil, Controls, Dialogs, InterfaceBase, maps,
|
FileUtil, Controls, Dialogs, InterfaceBase, maps,
|
||||||
// codetools
|
// codetools
|
||||||
Laz_XMLCfg, CodeToolsConfig, ExprEval, FileProcs, DefineTemplates,
|
CodeToolsConfig, ExprEval, FileProcs, DefineTemplates,
|
||||||
BasicCodeTools, CodeToolsCfgScript, CodeToolManager, CodeCache,
|
BasicCodeTools, CodeToolsCfgScript, CodeToolManager, CodeCache,
|
||||||
// IDEIntf
|
// IDEIntf
|
||||||
PropEdits, CompOptsIntf, ProjectIntf, MacroIntf, LazIDEIntf,
|
PropEdits, CompOptsIntf, ProjectIntf, MacroIntf, LazIDEIntf,
|
||||||
@ -71,10 +71,10 @@ type
|
|||||||
const OldUnitName, NewUnitName: string;
|
const OldUnitName, NewUnitName: string;
|
||||||
CheckIfAllowed: boolean;
|
CheckIfAllowed: boolean;
|
||||||
var Allowed: boolean) of object;
|
var Allowed: boolean) of object;
|
||||||
TOnLoadProjectInfo = procedure(TheProject: TProject; XMLConfig: TXMLConfig;
|
TOnLoadProjectInfo = procedure(TheProject: TProject; XMLConfig: TIDEXMLCfg;
|
||||||
Merge: boolean) of object;
|
Merge: boolean) of object;
|
||||||
TOnSaveProjectInfo = procedure(TheProject: TProject;
|
TOnSaveProjectInfo = procedure(TheProject: TProject;
|
||||||
XMLConfig: TXMLConfig; WriteFlags: TProjectWriteFlags) of object;
|
XMLConfig: TIDEXMLCfg; WriteFlags: TProjectWriteFlags) of object;
|
||||||
TOnProjectGetTestDirectory = procedure(TheProject: TProject;
|
TOnProjectGetTestDirectory = procedure(TheProject: TProject;
|
||||||
out TestDir: string) of object;
|
out TestDir: string) of object;
|
||||||
TOnChangeProjectInfoFile = procedure(TheProject: TProject) of object;
|
TOnChangeProjectInfoFile = procedure(TheProject: TProject) of object;
|
||||||
@ -2902,6 +2902,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
// save lpi to disk
|
// save lpi to disk
|
||||||
|
debugln(['TProject.WriteProject ',DbgSName(xmlconfig),' CfgFilename=',CfgFilename]);
|
||||||
xmlconfig.Flush;
|
xmlconfig.Flush;
|
||||||
Modified:=false;
|
Modified:=false;
|
||||||
if SaveSessionInfoInLPI then
|
if SaveSessionInfoInLPI then
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user