mirror of https://gitlab.com/basile.b/dexed.git
improved file drop to project inspector
fix, files unralated to D are not anymore accepted fix, useless project update support frop folder
This commit is contained in:
parent
5c32fcb6a5
commit
d616a690eb
|
@ -315,19 +315,39 @@ begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCEProjectInspectWidget.FormDropFiles(Sender: TObject; const FileNames: array of String);
|
procedure TCEProjectInspectWidget.FormDropFiles(Sender: TObject; const FileNames: array of String);
|
||||||
|
procedure addFile(const aFilename: string);
|
||||||
var
|
var
|
||||||
fname: string;
|
ext: string;
|
||||||
multidoc: ICEMultiDocHandler;
|
begin
|
||||||
|
ext := ExtractFileExt(aFilename);
|
||||||
|
if (dExtList.IndexOf(ext) = -1)
|
||||||
|
and (ext <> '.obj') and (ext <> '.o')
|
||||||
|
and (ext <> '.a') and (ext <> '.lib') then
|
||||||
|
exit;
|
||||||
|
fProject.addSource(aFilename);
|
||||||
|
if (dExtList.IndexOf(ext) <> -1) then
|
||||||
|
getMultiDocHandler.openDocument(aFilename);
|
||||||
|
end;
|
||||||
|
var
|
||||||
|
fname, direntry: string;
|
||||||
|
lst: TStringList;
|
||||||
begin
|
begin
|
||||||
if fProject = nil then exit;
|
if fProject = nil then exit;
|
||||||
multidoc := getMultiDocHandler;
|
lst := TStringList.Create;
|
||||||
for fname in Filenames do
|
|
||||||
if FileExists(fname) then
|
|
||||||
begin
|
|
||||||
multidoc.openDocument(fname);
|
|
||||||
fProject.beginUpdate;
|
fProject.beginUpdate;
|
||||||
fProject.addSource(fname);
|
try for fname in Filenames do
|
||||||
|
if FileExists(fname) then
|
||||||
|
addFile(fname)
|
||||||
|
else if DirectoryExists(fname) then
|
||||||
|
begin
|
||||||
|
lst.Clear;
|
||||||
|
listFiles(lst, fname, true);
|
||||||
|
for direntry in lst do
|
||||||
|
addFile(dirEntry);
|
||||||
|
end;
|
||||||
|
finally
|
||||||
fProject.endUpdate;
|
fProject.endUpdate;
|
||||||
|
lst.Free;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue