]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Activate the tab when an item is dragged above an inactive tab. Thanks to Dmitry...
authorPeter Penz <peter.penz19@gmail.com>
Tue, 12 Aug 2008 19:22:38 +0000 (19:22 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Tue, 12 Aug 2008 19:22:38 +0000 (19:22 +0000)
BUG: 164312

svn path=/trunk/KDE/kdebase/apps/; revision=846009

src/dolphinmainwindow.cpp
src/dolphinmainwindow.h

index fdf3947229db9047a20b0f329696f9b93804802b..8604b08764ed88655c5ffbfb6d1181f00efdc150 100644 (file)
@@ -774,6 +774,11 @@ void DolphinMainWindow::handlePlacesClick(const KUrl& url, Qt::MouseButtons butt
     }
 }
 
+void DolphinMainWindow::slotTestCanDecode(const QDragMoveEvent* event, bool& canDecode)
+{
+    canDecode = KUrl::List::canDecode(event->mimeData());
+}
+
 void DolphinMainWindow::init()
 {
     DolphinSettings& settings = DolphinSettings::instance();
@@ -818,6 +823,8 @@ void DolphinMainWindow::init()
             this, SLOT(openTabContextMenu(int, const QPoint&)));
     connect(m_tabBar, SIGNAL(newTabRequest()),
             this, SLOT(openNewTab()));
+    connect(m_tabBar, SIGNAL(testCanDecode(const QDragMoveEvent*, bool&)),
+            this, SLOT(slotTestCanDecode(const QDragMoveEvent*, bool&)));
     m_tabBar->blockSignals(true);  // signals get unblocked after at least 2 tabs are open
 
     QWidget* centralWidget = new QWidget(this);
index 1676afb7e1e49e3560f8d7c80444993e50a6223e..f97193cd41f45cfc7265543a47406de1033334cb 100644 (file)
@@ -341,6 +341,12 @@ private slots:
      * view is replaced by \a url.
      */
     void handlePlacesClick(const KUrl& url, Qt::MouseButtons buttons);
+    
+    /**
+     * Is connected to the KTabBar signal testCanDecode() and adjusts 
+     * the output parameter \a accept.
+     */
+    void slotTestCanDecode(const QDragMoveEvent* event, bool& accept);
 
 private:
     DolphinMainWindow(int id);