fix #269 - Nonstandardized paths can cause same files appearing multiple times in the project manager

This commit is contained in:
Basile Burg 2018-03-15 20:04:34 +01:00
parent da890afec3
commit 559745039f
1 changed files with 4 additions and 4 deletions

View File

@ -1100,7 +1100,7 @@ begin
fSrcs.Add(patchPlateformPath(ExtractRelativepath(fBasePath, fname))) fSrcs.Add(patchPlateformPath(ExtractRelativepath(fBasePath, fname)))
end end
else if patchPlateformPath(expandFilenameEx(fBasePath, fname)).fileExists then else if patchPlateformPath(expandFilenameEx(fBasePath, fname)).fileExists then
fSrcs.Add(fname); fSrcs.Add(patchPlateformPath(fname));
end; end;
procedure tryAddFromFolder(const pth: string); procedure tryAddFromFolder(const pth: string);
var var
@ -1112,7 +1112,7 @@ begin
listFiles(lst, pth, true); listFiles(lst, pth, true);
for abs in lst do for abs in lst do
if isDlangCompilable(abs.extractFileExt) then if isDlangCompilable(abs.extractFileExt) then
fSrcs.Add(ExtractRelativepath(fBasePath, abs)); fSrcs.Add(patchPlateformPath(ExtractRelativepath(fBasePath, abs)));
end; end;
end; end;
var var
@ -1131,7 +1131,7 @@ begin
if pth.fileExists then if pth.fileExists then
fSrcs.Add(patchPlateformPath(ExtractRelativepath(fBasePath, pth))) fSrcs.Add(patchPlateformPath(ExtractRelativepath(fBasePath, pth)))
else if expandFilenameEx(fBasePath, pth).fileExists then else if expandFilenameEx(fBasePath, pth).fileExists then
fSrcs.Add(pth); fSrcs.Add(patchPlateformPath(pth));
end; end;
tryAddFromFolder(fBasePath + 'src'); tryAddFromFolder(fBasePath + 'src');
tryAddFromFolder(fBasePath + 'source'); tryAddFromFolder(fBasePath + 'source');
@ -1156,7 +1156,7 @@ begin
if pth.fileExists then if pth.fileExists then
fSrcs.Add(patchPlateformPath(ExtractRelativepath(fBasePath, pth))) fSrcs.Add(patchPlateformPath(ExtractRelativepath(fBasePath, pth)))
else if expandFilenameEx(fBasePath, pth).fileExists then else if expandFilenameEx(fBasePath, pth).fileExists then
fSrcs.Add(pth); fSrcs.Add(patchPlateformPath(pth));
end; end;
// custom folders in current config // custom folders in current config
if conf.findArray('sourcePaths', arr) then for i := 0 to arr.Count-1 do if conf.findArray('sourcePaths', arr) then for i := 0 to arr.Count-1 do