From 2654b81959bcef9caa8d39850290bf80ec6a48f8 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Tue, 17 May 2011 23:43:12 +0200 Subject: connects tabMoved signal of TabBar to tabsChanged signal of MainView, so any changes in tab order due to dragging tabs are saved in the sessions file using SessionManager. So now the changes in the order of tabs is correctly remembered during restore. Patch by Tirtha Chatterjee Reviewed by me ;) --- src/tabbar.cpp | 8 ++++++++ src/tabbar.h | 1 + 2 files changed, 9 insertions(+) diff --git a/src/tabbar.cpp b/src/tabbar.cpp index 1ab357f2..d2e0ff17 100644 --- a/src/tabbar.cpp +++ b/src/tabbar.cpp @@ -87,6 +87,7 @@ TabBar::TabBar(QWidget *parent) connect(this, SIGNAL(contextMenu(int, const QPoint &)), this, SLOT(contextMenu(int, const QPoint &))); connect(this, SIGNAL(emptyAreaContextMenu(const QPoint &)), this, SLOT(emptyAreaContextMenu(const QPoint &))); + connect(this, SIGNAL(tabMoved(int,int)), this, SLOT(tabMoved(int,int))); connect(m_animationMapper, SIGNAL(mapped(int)), this, SLOT(removeAnimation(int))); setGraphicsEffect(m_tabHighlightEffect); @@ -303,6 +304,13 @@ void TabBar::mousePressEvent(QMouseEvent *event) } +void TabBar::tabMoved(int, int) +{ + MainView *mv = qobject_cast(parent()); + QTimer::singleShot(200, mv, SIGNAL(tabsChanged())); +} + + void TabBar::contextMenu(int tab, const QPoint &pos) { setupHistoryActions(); diff --git a/src/tabbar.h b/src/tabbar.h index c7bf88e6..5d4c6d63 100644 --- a/src/tabbar.h +++ b/src/tabbar.h @@ -94,6 +94,7 @@ private slots: void contextMenu(int, const QPoint &); void emptyAreaContextMenu(const QPoint &); + void tabMoved(int, int); void showTabPreview(); -- cgit v1.2.1