diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2010-10-29 11:58:52 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2010-10-29 11:58:52 +0200 |
commit | 3f1a38ece21e5e7da9508c57e5fe2b23bea11817 (patch) | |
tree | 5f1d5045a916049ca80e765e2f285a59c68f0105 /src/corelib | |
parent | 817b52396b1625a186dfe40ec9f282d2c392b6aa (diff) | |
download | fpGUI-3f1a38ece21e5e7da9508c57e5fe2b23bea11817.tar.xz |
Applied same logic in X11 to OLE DND regarding preferred mime choice
Mime types should be registered from most specific (first item in
mime list) to least specific (last item in mime list). The preferred
mime choice will be the first item in the list. Raise an error
if the mime list doesn't contain data.
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/gdi/fpg_gdi.pas | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/corelib/gdi/fpg_gdi.pas b/src/corelib/gdi/fpg_gdi.pas index bda2be25..15131adf 100644 --- a/src/corelib/gdi/fpg_gdi.pas +++ b/src/corelib/gdi/fpg_gdi.pas @@ -1378,15 +1378,15 @@ begin begin lAccept := False; - { enumerate the available formats } -// DataObj.EnumFormatEtc(DATADIR_GET, EnumIntf); -// EnumIntf.Next(); + { enumerate the available formats and return them as a StringList } lMimeList := EnumDataToStringList(DataObj); - lMimeChoice := 'text/plain'; -// lMimeList := TStringList.Create; -// lMimeList.Add(lMimeChoice); -// lMimeList.Add('text/html'); + if lMimeList.Count > 0 then + lMimeChoice := lMimeList[0] + else + {$NOTE We need to replace this message with a resouce string } + raise Exception.Create('fpGUI/GDI: no mime types available for DND operation'); + lDropAction := TranslateToFPGDropAction(Effect); if Assigned(wg.OnDragEnter) then wg.OnDragEnter(self, nil, lMimeList, lMimeChoice, lDropAction, lAccept); |