summaryrefslogtreecommitdiff
path: root/src/mainview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainview.cpp')
-rw-r--r--src/mainview.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/mainview.cpp b/src/mainview.cpp
index 19e4aae7..c7d66fa1 100644
--- a/src/mainview.cpp
+++ b/src/mainview.cpp
@@ -667,15 +667,11 @@ void MainView::openClosedTab()
}
-void MainView::switchToTab()
+void MainView::switchToTab(const int index)
{
- // 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())
+ if (index <= 0 || index > count())
return;
- setCurrentIndex(index);
+ setCurrentIndex(index-1);
}