summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/imageconvert/frm_main.pas24
-rw-r--r--tools/imageconvert/imgcnv.lpi7
2 files changed, 22 insertions, 9 deletions
diff --git a/tools/imageconvert/frm_main.pas b/tools/imageconvert/frm_main.pas
index 0dc77299..3ab50dbc 100644
--- a/tools/imageconvert/frm_main.pas
+++ b/tools/imageconvert/frm_main.pas
@@ -52,7 +52,12 @@ procedure TMainForm.MemoDragEnter(Sender, Source: TObject;
var
s: string;
begin
- s := 'text/uri-list'; // 'text/plain';
+ {TODO: Once Windows DND backend is 100% complete, this IFDEF can be removed.}
+ {$IFDEF MSWINDOWS}
+ s := 'FileName';
+ {$ELSE}
+ s := 'text/uri-list';
+ {$ENDIF}
Accept := AMimeList.IndexOf(s) > -1;
if Accept then
begin
@@ -71,15 +76,18 @@ begin
sl := TStringList.Create;
try
sl.Text := AData;
- memImages.BeginUpdate;
- for i := 0 to sl.Count-1 do
- begin
- fileName := sl[i];
- fileName := StringReplace(fileName, 'file://', '', []);
- memImages.Text := memImages.Text + ConvertImage(fileName);
+ try
+ memImages.BeginUpdate;
+ for i := 0 to sl.Count-1 do
+ begin
+ fileName := sl[i];
+ fileName := StringReplace(fileName, 'file://', '', []);
+ memImages.Text := memImages.Text + ConvertImage(fileName);
+ end;
+ finally
+ memImages.EndUpdate;
end;
finally
- memImages.EndUpdate;
sl.Free;
end;
end;
diff --git a/tools/imageconvert/imgcnv.lpi b/tools/imageconvert/imgcnv.lpi
index 9c3c8eb9..76f8b644 100644
--- a/tools/imageconvert/imgcnv.lpi
+++ b/tools/imageconvert/imgcnv.lpi
@@ -38,12 +38,17 @@
<PackageName Value="fpgui_toolkit"/>
</Item1>
</RequiredPackages>
- <Units Count="1">
+ <Units Count="2">
<Unit0>
<Filename Value="imgcnv.lpr"/>
<IsPartOfProject Value="True"/>
<UnitName Value="imgcnv"/>
</Unit0>
+ <Unit1>
+ <Filename Value="frm_main.pas"/>
+ <IsPartOfProject Value="True"/>
+ <UnitName Value="frm_main"/>
+ </Unit1>
</Units>
</ProjectOptions>
<CompilerOptions>