[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/4.1/kdesdk/kate/app
From:       Ivo Anjo <knuckles () gmail ! com>
Date:       2008-08-05 16:48:40
Message-ID: 1217954920.746739.30417.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 842623 by ianjo:

Backport fix for bug 162985 from trunk to branh:
Set the current activespace to the source of the drop event when opening files that were 
dragged and dropped.



 M  +12 -0     katemainwindow.cpp  


--- branches/KDE/4.1/kdesdk/kate/app/katemainwindow.cpp #842622:842623
@@ -35,6 +35,7 @@
 #include "katesession.h"
 #include "katemainwindowadaptor.h"
 #include "kateviewdocumentproxymodel.h"
+#include "kateviewspace.h"
 //#include "modeltest.h"
 
 #include <kate/mainwindow.h>
@@ -637,6 +638,17 @@
   if (event->mimeData() == 0) return;
   KUrl::List textlist = KUrl::List::fromMimeData(event->mimeData());
 
+  // Try to get the KTextEditor::View that sent this, and activate it, so that the file opens in the
+  // view where it was dropped
+  KTextEditor::View *kVsender = qobject_cast<KTextEditor::View *>(QObject::sender());
+  if (kVsender != 0) {
+    QWidget *parent = kVsender->parentWidget();
+    if (parent != 0) {
+      KateViewSpace* vs = qobject_cast<KateViewSpace *>(parent->parentWidget());
+      if (vs != 0) m_viewManager->setActiveSpace(vs);
+    }
+  }
+  
   for (KUrl::List::Iterator i = textlist.begin(); i != textlist.end(); ++i)
   {
     m_viewManager->openUrl (*i);
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic