From kde-commits Sat Mar 22 14:01:53 2003 From: Richard Smith Date: Sat, 22 Mar 2003 14:01:53 +0000 To: kde-commits Subject: kdenonbeta/kopete/libkopete/ui X-MARC-Message: https://marc.info/?l=kde-commits&m=104834174612919 CVS commit by lilachaze: Partially fixed a subtle bug with the message bubble M +11 -8 kopetechatwindow.cpp 1.207 --- kdenonbeta/kopete/libkopete/ui/kopetechatwindow.cpp #1.206:1.207 @@ -431,7 +431,4 @@ KopeteView *KopeteChatWindow::addChatVie ChatView *newView = new ChatView ( manager, this, pluginIcon, mainArea ); - if( chatViewList.isEmpty() ) - attachChatView(newView); - return newView; } @@ -507,13 +504,19 @@ void KopeteChatWindow::deleteTabBar() void KopeteChatWindow::attachChatView( ChatView* newView ) { - if( !chatViewList.isEmpty() ) + chatViewList.append( newView ); + + switch( chatViewList.count() ) { + case 1: + setPrimaryChatView( newView ); + break; + case 2: createTabBar(); + break; + default: addTab( newView ); + break; } - else - setPrimaryChatView( newView ); - chatViewList.append( newView ); newView->setMainWindow( this ); @@ -652,5 +655,5 @@ void KopeteChatWindow::setActiveView( QW return; - if( chatViewList.count() > 0 && !view->docked() ) + if( !chatViewList.contains( view ) ) attachChatView( view );