From 5dd9f2aff40aff8f985adb8dc64cb9ac7b9186ef Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Fri, 22 Aug 2014 09:12:52 +0200 Subject: [PATCH] fix patch message always shown --- src/ce_dmdwrap.pas | 2 +- src/ce_project.pas | 15 ++++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/ce_dmdwrap.pas b/src/ce_dmdwrap.pas index 6f9d8d71..4d9c9baf 100644 --- a/src/ce_dmdwrap.pas +++ b/src/ce_dmdwrap.pas @@ -742,7 +742,7 @@ end; procedure TDebugOpts.updateForceDbgBool; begin - fForceDbgBool := (fDbgLevel > 0) or (fDbgIdents.Count > 0); + fForceDbgBool := (fDbgLevel > 0) or (fDbgIdents.Count > 0); if fForceDbgBool then setDbg(true); end; diff --git a/src/ce_project.pas b/src/ce_project.pas index b1c7e64f..439428a1 100644 --- a/src/ce_project.pas +++ b/src/ce_project.pas @@ -344,10 +344,12 @@ procedure TCEProject.afterLoad; var i, j: Integer; src, ini, newdir: string; + hasPatched: boolean; begin patchPlateformPaths(fSrcs); doChanged; fModified := false; + hasPatched := false; // patch location: this only works when the project file is moved. // if the source structure changes this doesn't help much. @@ -380,13 +382,16 @@ begin fSrcs.Strings[j] := ExtractRelativepath(fBasePath, newdir + DirectorySeparator + src) else break; // next pass: patch from another folder. end; + hasPatched := true; end; // - saveToFile(fFilename); - // warning for other relative paths - if fileExists(getAbsoluteSourceName(0)) then - ce_common.dlgOkInfo('the main sources paths has been patched, some others invalid ' + - 'paths may still exists (-of, -od, etc.) but cannot be automatically handled'); + if hasPatched then begin + saveToFile(fFilename); + // warning for other relative paths + if fileExists(getAbsoluteSourceName(0)) then + ce_common.dlgOkInfo('the main sources paths has been patched, some others invalid ' + + 'paths may still exists (-of, -od, etc.) but cannot be automatically handled'); + end; end; procedure TCEProject.readerPropNoFound(Reader: TReader; Instance: TPersistent;