]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphintabbar.cpp
Merge branch 'master' into kf6
[dolphin.git] / src / dolphintabbar.cpp
index aa74e17ae6dea5949d4ce0d5edf678301e3cbd2d..ac9f1f734a097d75552d403f7e50bd87db3b31aa 100644 (file)
@@ -103,14 +103,15 @@ void DolphinTabBar::mouseReleaseEvent(QMouseEvent *event)
 
 void DolphinTabBar::mouseDoubleClickEvent(QMouseEvent *event)
 {
-    const int index = tabAt(event->pos());
+    int index = tabAt(event->pos());
 
     if (index < 0) {
-        // Double click on the empty tabbar area opens a new activated tab
-        // with the url from the current tab.
-        Q_EMIT openNewActivatedTab(currentIndex());
-        return;
+        // empty tabbar area case
+        index = currentIndex();
     }
+    // Double click on the tabbar opens a new activated tab
+    // with the url from the doubleclicked tab or currentTab otherwise.
+    Q_EMIT openNewActivatedTab(index);
 
     QTabBar::mouseDoubleClickEvent(event);
 }