diff libgui/qterminal/libqterminal/unix/TerminalView.cpp @ 18651:992b6354c8c6 gui-release

GUI: implement file drag and drop to command and edit window (Bug #41443) * libgui/src/m-editor/file-editor.h, ibgui/src/m-editor/file-editor.cpp (file_editor::file_editor): call setAcceptDrops. (file_editor::dragEnterEvent): New function. (file_editor::dropEvent): New function. * libgui/qterminal/libqterminal/unix/TerminalView.cpp (TerminalView::dropEvent): get URL names on drop event.
author John Donoghue
date Wed, 16 Apr 2014 16:19:45 -0400
parents 2d5d0d86432e
children 8b566ad1f88a
line wrap: on
line diff
--- a/libgui/qterminal/libqterminal/unix/TerminalView.cpp	Mon Apr 07 13:31:33 2014 -0400
+++ b/libgui/qterminal/libqterminal/unix/TerminalView.cpp	Wed Apr 16 16:19:45 2014 -0400
@@ -2620,6 +2620,17 @@
   //  KUrl::List urls = KUrl::List::fromMimeData(event->mimeData());
 
   QString dropText;
+
+  if (event->mimeData ()->hasUrls ())
+  {
+    foreach (QUrl url, event->mimeData ()->urls ())
+    {
+      if(dropText.length () > 0) 
+        dropText += "\n";
+      dropText  += url.toLocalFile ();
+    }
+  }
+
   /*  if (!urls.isEmpty())
   {
     for ( int i = 0 ; i < urls.count() ; i++ )