summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKurt Hindenburg <kurt.hindenburg@gmail.com>2011-08-04 13:25:17 (GMT)
committerKurt Hindenburg <kurt.hindenburg@gmail.com>2011-08-25 13:27:30 (GMT)
commit7ad880aad29694e7f69c8e868155c3d92f89bf49 (patch)
tree04359ed674f827597e8e46197e36c094d4c83c0e
parent5f3fd09c27e925c28f78b12ffe173c1e844ebf64 (diff)
Accept drag and drop event from non-KDE Filemanagers
Thunar uses 'text/uri-list' in its mimetype, but konsole only accept d&d events whose mimetype contains 'text/plain'. Patch by Jekyll Wu <adaptee@gmail.com> BUG: 219023 FIXED-IN: 4.8 REVIEW: 102176 (cherry picked from commit 51575d6f5294125505a9983e56878d008c07630e)
-rw-r--r--src/TerminalDisplay.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/TerminalDisplay.cpp b/src/TerminalDisplay.cpp
index 5f6478f..1f42f0b 100644
--- a/src/TerminalDisplay.cpp
+++ b/src/TerminalDisplay.cpp
@@ -2784,8 +2784,15 @@ QSize TerminalDisplay::sizeHint() const
void TerminalDisplay::dragEnterEvent(QDragEnterEvent* event)
{
- if (event->mimeData()->hasFormat("text/plain"))
+ // text/plain alone is enough for KDE-apps
+ // text/uri-list is for supporting some non-KDE apps, such as thunar
+ // and pcmanfm
+ // That also applies in dropEvent()
+ if (event->mimeData()->hasFormat("text/plain") ||
+ event->mimeData()->hasFormat("text/uri-list"))
+ {
event->acceptProposedAction();
+ }
}
void TerminalDisplay::dropEvent(QDropEvent* event)
@@ -2820,7 +2827,8 @@ void TerminalDisplay::dropEvent(QDropEvent* event)
dropText = event->mimeData()->text();
}
- if(event->mimeData()->hasFormat("text/plain"))
+ if (event->mimeData()->hasFormat("text/plain") ||
+ event->mimeData()->hasFormat("text/uri-list"))
{
emit sendStringToEmu(dropText.toLocal8Bit());
}