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

List:       kde-commits
Subject:    KDE/kdebase/apps/konqueror/src
From:       David Faure <faure () kde ! org>
Date:       2009-09-30 22:44:52
Message-ID: 1254350692.630776.19637.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1029863 by dfaure:

Fix unexpected call to slotCurrentChanged when inserting the first tab, which leads
to partmanager saying "trying to activate an unknown part".


 M  +9 -3      konqtabs.cpp  


--- trunk/KDE/kdebase/apps/konqueror/src/konqtabs.cpp #1029862:1029863
@@ -74,9 +74,6 @@
   m_pActiveChild = 0L;
   m_pViewManager = viewManager;
 
-  connect( this, SIGNAL( currentChanged ( int ) ),
-           this, SLOT( slotCurrentChanged( int ) ) );
-
   m_MouseMiddleClickClosesTab = KonqSettings::mouseMiddleClickClosesTab();
 
   m_permanentCloseButtons = KonqSettings::permanentCloseButton();
@@ -235,6 +232,15 @@
     // note that this can call slotCurrentChanged (e.g. when inserting/replacing the first tab)
     insertTab(index, frame->asQWidget(), "");
 
+    // Connect to currentChanged only after inserting the first tab,
+    // otherwise insertTab() can call slotCurrentChanged, which we don't expect
+    // (the part isn't in the partmanager yet; better let konqviewmanager take care
+    // of setting the active part)
+    disconnect(this, SIGNAL(currentChanged(int)),
+            this, SLOT(slotCurrentChanged(int)));
+    connect(this, SIGNAL(currentChanged(int)),
+            this, SLOT(slotCurrentChanged(int))); // TODO Qt >= 4.6: Qt::UniqueConnection
+
     if (m_rightWidget) {
       m_rightWidget->setEnabled( m_childFrameList.count() > 1 );
     }
[prev in list] [next in list] [prev in thread] [next in thread] 

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