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