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

List:       kde-commits
Subject:    KDE/kdenetwork/kopete/kopete/config/chatwindow
From:       Dennis Nienhüser <earthwings () gentoo ! org>
Date:       2008-05-30 12:13:24
Message-ID: 1212149604.576396.18531.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 814479 by nienhueser:

Select the correct chat style in load() and ensure it is visible. Remove an unused \
                (write-only) member.
BUG: 162882


 M  +11 -9     chatwindowconfig.cpp  
 M  +0 -1      chatwindowconfig.h  


--- trunk/KDE/kdenetwork/kopete/kopete/config/chatwindow/chatwindowconfig.cpp \
#814478:814479 @@ -142,7 +142,7 @@
 
 ChatWindowConfig::ChatWindowConfig(QWidget *parent, const QVariantList &args )
 	: KCModule( KopeteChatWindowConfigFactory::componentData(), parent, args ),
-		m_currentStyle (0L), m_loading(false), m_styleChanged(false),
+		m_currentStyle (0L), m_loading(false),
 		m_previewProtocol(0L), m_previewAccount(0L), m_myselfMetaContact(0L),
 		m_jackMetaContact(0L), m_myself(0L), m_jack(0L)
 {
@@ -273,7 +273,6 @@
 
 	appearanceSettings->writeConfig();
 	settings->writeConfig();
-	m_styleChanged = false;
 
 	load();
 }
@@ -309,16 +308,19 @@
 	{
 		// Insert style name into the listbox
 		m_styleUi.styleList->insertItem( 0, styleName );
+	}
 
-		if( styleName == KopeteChatWindowSettings::self()->styleName() )
-		{
-			kDebug(14000) << "Restoring saved style: " << styleName;
+	m_styleUi.styleList->setSortingEnabled( true );
 
-			m_styleUi.styleList->setCurrentItem( m_styleUi.styleList->item( 0 ) );
-		}
+	QString currentStyle = KopeteChatWindowSettings::self()->styleName();
+	QList<QListWidgetItem *> items = m_styleUi.styleList->findItems( currentStyle, \
Qt::MatchFixedString | Qt::MatchCaseSensitive ); +	if( items.count() > 0 )
+	{
+		kDebug(14000) << "Restoring saved style: " << currentStyle;
+
+		m_styleUi.styleList->setCurrentItem( items[0] );
+		m_styleUi.styleList->scrollToItem( items[0] );
 	}
-
-	m_styleUi.styleList->setSortingEnabled( true );
 }
 
 
--- trunk/KDE/kdenetwork/kopete/kopete/config/chatwindow/chatwindowconfig.h \
#814478:814479 @@ -80,7 +80,6 @@
 	ChatWindowStyle::StyleVariants m_currentVariantMap;
 	ChatWindowStyle *m_currentStyle;
 	bool m_loading;
-	bool m_styleChanged;
 	bool m_allowDownloadTheme;
 	// For style preview
 	FakeProtocol *m_previewProtocol;


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

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