diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2010-10-28 10:51:56 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2010-10-28 10:51:56 +0200 |
commit | c4c41403c4ec6a2c19f197305a98efa717c79e9d (patch) | |
tree | 4b892eb1992a0b5f41b31f8015ec07468b2f8af9 /src/corelib/x11 | |
parent | 5dd93dc1cbc3551e631fcb8510a43f5429cecb31 (diff) | |
download | fpGUI-c4c41403c4ec6a2c19f197305a98efa717c79e9d.tar.xz |
extra error checking in mimelist DND operation
Diffstat (limited to 'src/corelib/x11')
-rw-r--r-- | src/corelib/x11/fpg_x11.pas | 8 |
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; |