[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdevplatform/sublime
From:       Alexander Dymo <adymo () kdevelop ! org>
Date:       2009-11-28 23:18:46
Message-ID: 1259450326.549424.31095.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1055891 by dymo:

Fix tab activation bug after closing another tabs without switching to them
(for example clicking on another tab's close button).
We should remove the widget from container's stack before removing it from the tabbar,
tabbar activates new widget by its index, and if the old one is still in stack, then
indices are off by one.
For me this also fixes the crash in ctrl-tab document switcher (which probably got
activation signal of the view which was already deleted).
BUG:204383


 M  +2 -1      container.cpp  


--- trunk/KDE/kdevplatform/sublime/container.cpp #1055890:1055891
@@ -316,8 +316,9 @@
 void Sublime::Container::removeWidget(QWidget *w)
 {
     if (w) {
-        d->tabBar->removeTab(d->stack->indexOf(w));
+        int widgetIdx = d->stack->indexOf(w);
         d->stack->removeWidget(w);
+        d->tabBar->removeTab(widgetIdx);
         if (d->tabBar->currentIndex() != -1)
             d->fileNameCorner->setText(d->tabBar->tabText(d->tabBar->currentIndex()));
         View* view = d->viewForWidget.take(w);
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic