mirror of https://gitlab.com/basile.b/dexed.git
fix #396 - Drag drop of unknow ext file cause a rename to `.dprj`
This commit is contained in:
parent
a3efb52aa6
commit
bd93137646
|
@ -271,14 +271,14 @@ begin
|
||||||
f := fname;
|
f := fname;
|
||||||
if not FilenameIsAbsolute(f) then
|
if not FilenameIsAbsolute(f) then
|
||||||
f := ExpandFileName(f);
|
f := ExpandFileName(f);
|
||||||
if fname.extractFileExt <> '.dprj' then
|
fbasePath := f.extractFilePath;
|
||||||
|
inherited customLoadFromFile(f);
|
||||||
|
if hasLoaded and (fname.extractFileExt <> '.dprj') then
|
||||||
begin
|
begin
|
||||||
dlgOkInfo('project file extension automatically updated to "dprj"');
|
dlgOkInfo('project file extension automatically updated to "dprj"');
|
||||||
f := ChangeFileExt(fname, '.dprj');
|
f := ChangeFileExt(fname, '.dprj');
|
||||||
RenameFile(fname, f);
|
RenameFile(fname, f);
|
||||||
end;
|
end;
|
||||||
fbasePath := f.extractFilePath;
|
|
||||||
inherited customLoadFromFile(f);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TNativeProject.customSaveToFile(const fname: string);
|
procedure TNativeProject.customSaveToFile(const fname: string);
|
||||||
|
|
|
@ -393,14 +393,14 @@ begin
|
||||||
f := fname;
|
f := fname;
|
||||||
if not FilenameIsAbsolute(f) then
|
if not FilenameIsAbsolute(f) then
|
||||||
f := ExpandFileName(f);
|
f := ExpandFileName(f);
|
||||||
if fname.extractFileExt <> '.dgrp' then
|
fBasePath := f.extractFilePath;
|
||||||
|
loadFromFile(f);
|
||||||
|
if hasLoaded and (fname.extractFileExt <> '.dgrp') then
|
||||||
begin
|
begin
|
||||||
dlgOkInfo('project file extension automatically updated to "dgrp"');
|
dlgOkInfo('project file extension automatically updated to "dgrp"');
|
||||||
f := ChangeFileExt(fname, '.dgrp');
|
f := ChangeFileExt(fname, '.dgrp');
|
||||||
RenameFile(fname, f);
|
RenameFile(fname, f);
|
||||||
end;
|
end;
|
||||||
fBasePath := f.extractFilePath;
|
|
||||||
loadFromFile(f);
|
|
||||||
for i:= 0 to fItems.Count-1 do
|
for i:= 0 to fItems.Count-1 do
|
||||||
getItem(i).fGroup := self;
|
getItem(i).fGroup := self;
|
||||||
doChanged;
|
doChanged;
|
||||||
|
|
Loading…
Reference in New Issue