fix #136 projects inspector, remove selected source, error if other missing sources

This commit is contained in:
Basile Burg 2017-04-18 03:54:43 +02:00
parent 4c6ed49e7d
commit 260323080f
No known key found for this signature in database
GPG Key ID: 1868039F415CB8CF
6 changed files with 20 additions and 4 deletions

View File

@ -207,6 +207,8 @@ begin
folds.Add(fold); folds.Add(fold);
for i:= 0 to fProj.sourcesCount-1 do for i:= 0 to fProj.sourcesCount-1 do
begin begin
if not (fProj.sourceAbsolute(i).fileExists) then
continue;
fold := fProj.sourceAbsolute(i).extractFilePath; fold := fProj.sourceAbsolute(i).extractFilePath;
if folds.IndexOf(fold) = -1 then if folds.IndexOf(fold) = -1 then
folds.Add(fold); folds.Add(fold);

View File

@ -7,7 +7,7 @@ interface
uses uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs,
SynEdit, SynHighlighterDiff, process, SynEdit, SynHighlighterDiff, process,
ce_common, ComCtrls, StdCtrls, ExtCtrls, Buttons; ce_common, StdCtrls, ExtCtrls, Buttons;
type type
TCEDiffViewer = class(TForm) TCEDiffViewer = class(TForm)

View File

@ -6,7 +6,7 @@ interface
uses uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls, Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
Menus, ComCtrls, Buttons, LazFileUtils, fphttpclient, StdCtrls, math, Menus, ComCtrls, Buttons, LazFileUtils, fphttpclient, StdCtrls,
fpjson, jsonparser, fpjson, jsonparser,
ce_widget, ce_interfaces, ce_ceproject, ce_dmdwrap, ce_common, ce_dialogs, ce_widget, ce_interfaces, ce_ceproject, ce_dmdwrap, ce_common, ce_dialogs,
ce_sharedres, process, ce_dubproject, ce_observer, ce_libman, ce_sharedres, process, ce_dubproject, ce_observer, ce_libman,

View File

@ -7,7 +7,7 @@ interface
uses uses
Classes, SysUtils, FileUtil, TASources, TAGraph, TATransformations, TASeries, Classes, SysUtils, FileUtil, TASources, TAGraph, TATransformations, TASeries,
TATools, Forms, Controls, Graphics, Dialogs, ExtCtrls, Menus, ComCtrls, TATools, Forms, Controls, Graphics, Dialogs, ExtCtrls, Menus, ComCtrls,
StdCtrls, TALegend, TADrawUtils, math, StdCtrls, TALegend, math,
ce_widget, ce_common, ce_stringrange, ce_dsgncontrols, ce_ddemangle; ce_widget, ce_common, ce_stringrange, ce_dsgncontrols, ce_ddemangle;
type type

View File

@ -448,6 +448,20 @@ begin
if i <> -1 then if i <> -1 then
proj.Sources.Delete(i); proj.Sources.Delete(i);
end; end;
fname := '';
for i := 0 to proj.sourcesCount-1 do
if not proj.sourceAbsolute(i).fileExists then
fname += LineEnding + ' "' + proj.sourceAbsolute(i) + '" ';
if fname.isNotEmpty and (dlgOkCancel('Other source(s) not found: ' + LineEnding
+ fname + LineEnding + LineEnding + 'Remove all invalid files ?') = mrOK) then
begin
for j := proj.sourcesCount-1 downto 0 do
if not proj.sourceAbsolute(j).fileExists then
proj.Sources.Delete(j);
end;
proj.endUpdate; proj.endUpdate;
end; end;

View File

@ -205,7 +205,7 @@ begin
begin begin
sym := true; sym := true;
path := project.sourceAbsolute(i); path := project.sourceAbsolute(i);
if not hasDlangSyntax(path.extractFileExt) then if not hasDlangSyntax(path.extractFileExt) or not path.fileExists then
continue; continue;
clbck.fModStart := false; clbck.fModStart := false;
srcc.LoadFromFile(path); srcc.LoadFromFile(path);