fix patch message always shown

This commit is contained in:
Basile Burg 2014-08-22 09:12:52 +02:00
parent 6550dec0c4
commit 5dd9f2aff4
2 changed files with 11 additions and 6 deletions

View File

@ -742,7 +742,7 @@ end;
procedure TDebugOpts.updateForceDbgBool; procedure TDebugOpts.updateForceDbgBool;
begin begin
fForceDbgBool := (fDbgLevel > 0) or (fDbgIdents.Count > 0); fForceDbgBool := (fDbgLevel > 0) or (fDbgIdents.Count > 0);
if fForceDbgBool then setDbg(true); if fForceDbgBool then setDbg(true);
end; end;

View File

@ -344,10 +344,12 @@ procedure TCEProject.afterLoad;
var var
i, j: Integer; i, j: Integer;
src, ini, newdir: string; src, ini, newdir: string;
hasPatched: boolean;
begin begin
patchPlateformPaths(fSrcs); patchPlateformPaths(fSrcs);
doChanged; doChanged;
fModified := false; fModified := false;
hasPatched := false;
// patch location: this only works when the project file is moved. // patch location: this only works when the project file is moved.
// if the source structure changes this doesn't help much. // if the source structure changes this doesn't help much.
@ -380,13 +382,16 @@ begin
fSrcs.Strings[j] := ExtractRelativepath(fBasePath, newdir + DirectorySeparator + src) fSrcs.Strings[j] := ExtractRelativepath(fBasePath, newdir + DirectorySeparator + src)
else break; // next pass: patch from another folder. else break; // next pass: patch from another folder.
end; end;
hasPatched := true;
end; end;
// //
saveToFile(fFilename); if hasPatched then begin
// warning for other relative paths saveToFile(fFilename);
if fileExists(getAbsoluteSourceName(0)) then // warning for other relative paths
ce_common.dlgOkInfo('the main sources paths has been patched, some others invalid ' + if fileExists(getAbsoluteSourceName(0)) then
'paths may still exists (-of, -od, etc.) but cannot be automatically handled'); 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; end;
procedure TCEProject.readerPropNoFound(Reader: TReader; Instance: TPersistent; procedure TCEProject.readerPropNoFound(Reader: TReader; Instance: TPersistent;