mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
CtrlCore: 'files' support in X11 D&D
git-svn-id: svn://ultimatepp.org/upp/trunk@5523 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
5a81d2035e
commit
ded4b2c0d2
1 changed files with 5 additions and 1 deletions
|
|
@ -219,6 +219,8 @@ bool Ctrl::ClipHas(int type, const char *fmt)
|
|||
{
|
||||
GuiLock __;
|
||||
LLOG("ClipHas " << type << ": " << fmt);
|
||||
if(strcmp(fmt, "files") == 0)
|
||||
fmt = "text/uri-list";
|
||||
if(type == 0)
|
||||
return Ctrl::xclipboard().IsAvailable(XAtom(fmt), "CLIPBOARD");
|
||||
if(type == 2) {
|
||||
|
|
@ -235,6 +237,8 @@ String Ctrl::ClipGet(int type, const char *fmt)
|
|||
{
|
||||
GuiLock __;
|
||||
LLOG("ClipGet " << type << ": " << fmt);
|
||||
if(strcmp(fmt, "files") == 0)
|
||||
fmt = "text/uri-list";
|
||||
if(type && GetDragAndDropSource())
|
||||
return DnDGetData(fmt);
|
||||
return Ctrl::xclipboard().Read(
|
||||
|
|
@ -356,7 +360,7 @@ int JustLf(int c)
|
|||
Vector<String> GetClipFiles(const String& data)
|
||||
{
|
||||
Vector<String> r;
|
||||
Vector<String> f = Split(Filter(txt, JustLf), '\n');
|
||||
Vector<String> f = Split(Filter(data, JustLf), '\n');
|
||||
for(int i = 0; i < f.GetCount(); i++)
|
||||
if(f[i].StartsWith("file://"))
|
||||
r.Add(f[i].Mid(7));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue