summaryrefslogtreecommitdiff
path: root/src/corelib
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graeme@mastermaths.co.za>2010-10-28 10:51:56 +0200
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2010-10-28 10:51:56 +0200
commitc4c41403c4ec6a2c19f197305a98efa717c79e9d (patch)
tree4b892eb1992a0b5f41b31f8015ec07468b2f8af9 /src/corelib
parent5dd93dc1cbc3551e631fcb8510a43f5429cecb31 (diff)
downloadfpGUI-c4c41403c4ec6a2c19f197305a98efa717c79e9d.tar.xz
extra error checking in mimelist DND operation
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/x11/fpg_x11.pas8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/corelib/x11/fpg_x11.pas b/src/corelib/x11/fpg_x11.pas
index 9be3276f..f56a4851 100644
--- a/src/corelib/x11/fpg_x11.pas
+++ b/src/corelib/x11/fpg_x11.pas
@@ -1114,9 +1114,15 @@ begin
lMimeList := TStringList.Create;
for i := 0 to FDNDTypeList.Count-1 do
lMimeList.Add(TDNDSrcType(FDNDTypeList[i]).Name);
+
{ Use the first mime-type as the default option presented. The mime-list
should always be from most specific to least specific. }
- lMimeChoice := lMimeList[0];
+ if lMimeList.Count > 0 then
+ lMimeChoice := lMimeList[0]
+ else
+ {$NOTE We need to replace this message with a resouce string }
+ raise Exception.Create('fpGUI/X11: no mime types available for DND operation');
+
{ TODO: We need to populate the Source parameter. }
wg.OnDragEnter(self, nil, lMimeList, lMimeChoice, lDropAction, lAccept);
lMimeList.Free;