summaryrefslogtreecommitdiff
path: root/src/mainview.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2010-05-24 16:55:38 +0200
committerAndrea Diamantini <adjam7@gmail.com>2010-05-24 16:55:38 +0200
commit25cc96d4f7c38181f8b1c6739fb90eaa403191c5 (patch)
treed39d7d9c1b10808400f7b22901e1b2b50ffaac1a /src/mainview.cpp
parentMerge commit 'refs/merge-requests/2273' of git://gitorious.org/rekonq/mainlin... (diff)
parentAdded actions to switch to Tab #n (diff)
downloadrekonq-25cc96d4f7c38181f8b1c6739fb90eaa403191c5.tar.xz
Merge commit 'refs/merge-requests/2274' of git://gitorious.org/rekonq/mainline into m2274
Diffstat (limited to 'src/mainview.cpp')
-rw-r--r--src/mainview.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mainview.cpp b/src/mainview.cpp
index 1c36adcf..01f0e1a4 100644
--- a/src/mainview.cpp
+++ b/src/mainview.cpp
@@ -657,6 +657,17 @@ void MainView::openClosedTab()
}
}
+void MainView::switchToTab()
+{
+ // uses the sender to determine the tab index
+ QAction *sender = static_cast<QAction*>(QObject::sender());
+ int index = sender->data().toInt();
+ index -= 1; // to compensate for off by 1 presented to the user
+ if( index < 0 || index >= count() )
+ return;
+ setCurrentIndex( index );
+}
+
QLabel *MainView::animatedLoading(int index, bool addMovie)
{
if (index == -1)