┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/dolphinmainwindow.cpp8
-rw-r--r--src/dolphinmainwindow.h7
2 files changed, 15 insertions, 0 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp
index e60d7662e..ba3ae2787 100644
--- a/src/dolphinmainwindow.cpp
+++ b/src/dolphinmainwindow.cpp
@@ -960,6 +960,12 @@ void DolphinMainWindow::searchItems(const KUrl& url)
m_activeViewContainer->setUrl(url);
}
+void DolphinMainWindow::slotTabMoved(int from, int to)
+{
+ m_viewTab.move(from, to);
+ m_tabIndex = m_tabBar->currentIndex();
+}
+
void DolphinMainWindow::init()
{
DolphinSettings& settings = DolphinSettings::instance();
@@ -1016,6 +1022,8 @@ void DolphinMainWindow::init()
this, SLOT(slotWheelMoved(int)));
connect(m_tabBar, SIGNAL(mouseMiddleClick(int)),
this, SLOT(closeTab(int)));
+ connect(m_tabBar, SIGNAL(tabMoved(int, int)),
+ this, SLOT(slotTabMoved(int, int)));
m_tabBar->blockSignals(true); // signals get unblocked after at least 2 tabs are open
diff --git a/src/dolphinmainwindow.h b/src/dolphinmainwindow.h
index 687eecddf..5e1d27476 100644
--- a/src/dolphinmainwindow.h
+++ b/src/dolphinmainwindow.h
@@ -375,6 +375,13 @@ private slots:
*/
void searchItems(const KUrl& url);
+ /**
+ * Is connected to the QTabBar signal tabMoved(int from, int to).
+ * Reorders the list of tabs after a tab was moved in the tab bar
+ * and sets m_tabIndex to the new index of the current tab.
+ */
+ void slotTabMoved(int from, int to);
+
private:
DolphinMainWindow(int id);
void init();