ce projects, move missing file checks in their own method

This commit is contained in:
Basile Burg 2016-08-22 08:07:56 +02:00
parent 9f60c0ae9c
commit 15f15725e0
1 changed files with 19 additions and 21 deletions

View File

@ -117,6 +117,7 @@ type
function compiled: Boolean; function compiled: Boolean;
procedure compile; procedure compile;
function targetUpToDate: boolean; function targetUpToDate: boolean;
procedure checkMissingFiles;
// //
property configuration[ix: integer]: TCompilerConfiguration read getConfig; property configuration[ix: integer]: TCompilerConfiguration read getConfig;
property currentConfiguration: TCompilerConfiguration read getCurrConf; property currentConfiguration: TCompilerConfiguration read getCurrConf;
@ -484,10 +485,9 @@ begin
Inherited; Inherited;
end; end;
procedure TCENativeProject.afterLoad; procedure TCENativeProject.checkMissingFiles;
var var
hasPatched: Boolean; hasPatched: Boolean;
{$IFNDEF CEBUILD}
// either all the source files have moved or only the project file // either all the source files have moved or only the project file
procedure checkMissingAllSources; procedure checkMissingAllSources;
var var
@ -565,8 +565,22 @@ var
end; end;
end; end;
end; end;
{$ENDIF} begin
// beginUpdate;
checkMissingAllSources;
checkMissingSingleSource;
endUpdate;
if hasPatched then
begin
fModified:= true;
dlgOkInfo('some source file paths has been patched, some others invalid ' +
'paths or file may still exist (-of, -od, extraSources, etc)' +
'but cannot be automatically handled. Note that the modifications have not been saved.');
end
else fModified:= false;
end;
procedure TCENativeProject.afterLoad;
begin begin
//if not fHasLoaded then //if not fHasLoaded then
//begin //begin
@ -574,25 +588,9 @@ begin
// fFilename:= ''; // fFilename:= '';
//end; //end;
patchPlateformPaths(fSrcs); patchPlateformPaths(fSrcs);
fModified := false;
hasPatched := false;
{$IFNDEF CEBUILD}
//
// TODO-cfeature: a modal form with the file list, green checkers and red crosses to indicate the state
// and some actions to apply to a particular selection: patch root, remove from project, replace, etc...
checkMissingAllSources;
checkMissingSingleSource;
if hasPatched then
begin
dlgOkInfo('some source file paths has been patched, some others invalid ' +
'paths or file may still exist (-of, -od, extraSources, etc)' +
'but cannot be automatically handled. Note that the modifications have not been saved.');
end;
{$ENDIF}
//
updateOutFilename; updateOutFilename;
endUpdate; endUpdate;
if not hasPatched then fModified := false; fModified := false;
end; end;
procedure TCENativeProject.readerPropNoFound(Reader: TReader; Instance: TPersistent; procedure TCENativeProject.readerPropNoFound(Reader: TReader; Instance: TPersistent;