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

List:       kde-commits
Subject:    KDE/kdeutils/okteta/libs/kasten/gui/system
From:       Friedrich W. H. Kossebau <kossebau () kde ! org>
Date:       2009-08-15 10:54:54
Message-ID: 1250333694.510959.18226.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1011648 by kossebau:

changed: insert new views after current tab, not at end

 M  +8 -7      tabbedviews.cpp  


--- trunk/KDE/kdeutils/okteta/libs/kasten/gui/system/tabbedviews.cpp #1011647:1011648
@@ -107,24 +107,25 @@
 
 void TabbedViews::addViews( const QList<AbstractView*>& views )
 {
-    int index;
-//     AbstractView* lastView;
+    if( views.count() == 0 )
+        return;
+
+    int insertIndex = mTabWidget->currentIndex() + 1;
     foreach( AbstractView* view, views )
     {
         connect( view, SIGNAL(titleChanged( QString )), SLOT(onTitleChanged( QString )) );
 
         ViewBox* viewBox = new ViewBox( view, mTabWidget );
-        index = mTabWidget->addTab( viewBox, view->title() );
-//         lastView = view;
+        mTabWidget->insertTab( insertIndex, viewBox, view->title() );
+        ++insertIndex;
     }
 
-    mTabWidget->setCurrentIndex( index );
-//     lastView->widget()->setFocus(); // TODO: check if this is always done in onCurrentChanged
+    mTabWidget->setCurrentIndex( insertIndex - 1 );
 
     // fix for Qt bug:
     if( mTabWidget->count() == 1 )
         // simulate signal reaction
-        onCurrentChanged( index );
+        onCurrentChanged( 0 );
 
     emit added( views );
 
[prev in list] [next in list] [prev in thread] [next in thread] 

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