diff --git a/src/ce_dubproject.pas b/src/ce_dubproject.pas index 6e7627c7..97ba3324 100644 --- a/src/ce_dubproject.pas +++ b/src/ce_dubproject.pas @@ -116,6 +116,7 @@ type function binaryKind: TProjectBinaryKind; function getCommandLine: string; function outputFilename: string; + procedure reload; // function isSource(const fname: string): boolean; function sourcesCount: integer; @@ -349,6 +350,12 @@ begin exit(fBasePath); end; +procedure TCEDubProject.reload; +begin + if fFilename.fileExists then + loadFromFile(fFilename); +end; + procedure TCEDubProject.loadFromFile(const fname: string); var loader: TMemoryStream; diff --git a/src/ce_interfaces.pas b/src/ce_interfaces.pas index 8c079920..79f588a4 100644 --- a/src/ce_interfaces.pas +++ b/src/ce_interfaces.pas @@ -43,6 +43,8 @@ type procedure loadFromFile(const fname: string); // saves project to filename procedure saveToFile(const fname: string); + // reloads from filename + procedure reload; // indicates of the project is modified (should be saved or not) function modified: boolean; // returns the base path used to solve relative locations diff --git a/src/ce_main.pas b/src/ce_main.pas index 9ca178d1..1a77afe1 100644 --- a/src/ce_main.pas +++ b/src/ce_main.pas @@ -1430,6 +1430,7 @@ begin topsplt := nil; end; fSymlWidg.showWidget; + // TODO-cdocking: Put the new unified project editors and inspectors to the right once done // right DockMaster.GetAnchorSite(fProjWidg).Width := 190; DockMaster.GetAnchorSite(fPrjCfWidg).Width := 190; @@ -3209,9 +3210,8 @@ begin if checkProjectLock then exit; // fname := fProject.filename; - fProject.getProject.Free; document.saveToFile(fname); - openProj(fname); + fProject.reload; end; function TCEMainForm.closeProj: boolean; diff --git a/src/ce_nativeproject.pas b/src/ce_nativeproject.pas index 1aea1902..d92b4492 100644 --- a/src/ce_nativeproject.pas +++ b/src/ce_nativeproject.pas @@ -103,6 +103,7 @@ type function binaryKind: TProjectBinaryKind; function getCommandLine: string; function modified: boolean; + procedure reload; // function configurationCount: integer; procedure setActiveConfigurationIndex(index: integer); @@ -251,6 +252,12 @@ begin endUpdate; end; +procedure TCENativeProject.reload; +begin + if fFilename.fileExists then + loadFromFile(fFilename); +end; + procedure TCENativeProject.customLoadFromFile(const fname: string); begin fbasePath := fname.extractFilePath;