fix #396 - Drag drop of unknow ext file cause a rename to `.dprj`

This commit is contained in:
Basile Burg 2019-01-11 09:41:32 +01:00
parent a3efb52aa6
commit bd93137646
2 changed files with 6 additions and 6 deletions

View File

@ -271,14 +271,14 @@ begin
f := fname;
if not FilenameIsAbsolute(f) then
f := ExpandFileName(f);
if fname.extractFileExt <> '.dprj' then
fbasePath := f.extractFilePath;
inherited customLoadFromFile(f);
if hasLoaded and (fname.extractFileExt <> '.dprj') then
begin
dlgOkInfo('project file extension automatically updated to "dprj"');
f := ChangeFileExt(fname, '.dprj');
RenameFile(fname, f);
end;
fbasePath := f.extractFilePath;
inherited customLoadFromFile(f);
end;
procedure TNativeProject.customSaveToFile(const fname: string);

View File

@ -393,14 +393,14 @@ begin
f := fname;
if not FilenameIsAbsolute(f) then
f := ExpandFileName(f);
if fname.extractFileExt <> '.dgrp' then
fBasePath := f.extractFilePath;
loadFromFile(f);
if hasLoaded and (fname.extractFileExt <> '.dgrp') then
begin
dlgOkInfo('project file extension automatically updated to "dgrp"');
f := ChangeFileExt(fname, '.dgrp');
RenameFile(fname, f);
end;
fBasePath := f.extractFilePath;
loadFromFile(f);
for i:= 0 to fItems.Count-1 do
getItem(i).fGroup := self;
doChanged;