┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2008-08-12 19:22:38 +0000
committerPeter Penz <[email protected]>2008-08-12 19:22:38 +0000
commit00afeea5f5cf59969a316b8bf7c219d12c3300f3 (patch)
tree9d4bc2a7a3f3bd23ddf9e21ce40d40aabc61695f
parentb354c7503dc4078f417371ffd32606cd4c635792 (diff)
Activate the tab when an item is dragged above an inactive tab. Thanks to Dmitry Khlystov for the patch!
BUG: 164312 svn path=/trunk/KDE/kdebase/apps/; revision=846009
-rw-r--r--src/dolphinmainwindow.cpp7
-rw-r--r--src/dolphinmainwindow.h6
2 files changed, 13 insertions, 0 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp
index fdf394722..8604b0876 100644
--- a/src/dolphinmainwindow.cpp
+++ b/src/dolphinmainwindow.cpp
@@ -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);
diff --git a/src/dolphinmainwindow.h b/src/dolphinmainwindow.h
index 1676afb7e..f97193cd4 100644
--- a/src/dolphinmainwindow.h
+++ b/src/dolphinmainwindow.h
@@ -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);