summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2013-04-25 10:00:28 +0200
committerAndrea Diamantini <adjam7@gmail.com>2013-04-25 10:16:46 +0200
commitf619f0769ae049214e971ad7931680966e4b8068 (patch)
tree01a7f95589af03651b619d199fe877098f6c16c3
parentLet appmenu-qt support work also with pinned tabs to load (diff)
downloadrekonq-f619f0769ae049214e971ad7931680966e4b8068.tar.xz
Fix a logic error in unpinTab
In previous code the method was unable to properly determine the first available index not pinned under some circumstances BUG: 317798
-rw-r--r--src/tabwindow/tabbar.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/tabwindow/tabbar.cpp b/src/tabwindow/tabbar.cpp
index 7363d965..1ca3d4c2 100644
--- a/src/tabwindow/tabbar.cpp
+++ b/src/tabwindow/tabbar.cpp
@@ -579,10 +579,7 @@ void TabBar::unpinTab()
return;
int index = a->data().toInt();
-
- // set the tab data false to forget this pinned tab
- setTabData(index, false);
-
+
// Find the available index to move
int availableIndex = 0;
for (int i = 1; i < count(); i++)
@@ -592,8 +589,9 @@ void TabBar::unpinTab()
availableIndex = i - 1;
break;
}
+ availableIndex++;
}
-
+
TabWidget *w = qobject_cast<TabWidget *>(parent());
w->moveTab(index, availableIndex);
index = availableIndex;
@@ -601,6 +599,9 @@ void TabBar::unpinTab()
tabButton(index, QTabBar::RightSide)->show();
setTabText(index, w->webWindow(index)->title());
+ // set the tab data false to forget this pinned tab
+ setTabData(index, false);
+
// workaround: "fix" the icon (or at least, try to...)
QLabel *label = qobject_cast<QLabel* >(tabButton(index, QTabBar::LeftSide));
if (!label)