The current libkopete/kopetechatsession.cpp contains a function
(Kopete::ChatSession::slotUpdateDisplayName()) that declares a
Kopete::Contact * and checks it uninitialized because of the way the
function was rewritten to use QList's operator[] instead of the old
QPtrList's first and next methods. (This is a good thing because
QLIst::operator[] is supposed to be Very Fast(TM).) The attached patch
corrects the issue.

-Scott Wolchok
Index: libkopete/kopetechatsession.cpp
===================================================================
--- libkopete/kopetechatsession.cpp	(revision 531769)
+++ libkopete/kopetechatsession.cpp	(working copy)
@@ -143,21 +143,18 @@
 
 void Kopete::ChatSession::slotUpdateDisplayName()
 {
-	int i;
-	
 	if( d->customDisplayName )
 		return;
 
-	Kopete::Contact *c;
 
 	//If there is no member yet, don't try to update the display name
-	if ( !c )
+	if ( d->mContactList.isEmpty() )
 		return;
 
 	d->displayName=QString::null;
-	for( i = 0; i != d->mContactList.size(); i++ )
+	for(int i = 0; i != d->mContactList.size(); i++ )
 	{
-		c = d->mContactList[i];
+		Kopete::Contact * c = d->mContactList[i];
 		if(! d->displayName.isNull() )
 			d->displayName.append( QString::fromLatin1( ", " ) ) ;
 
_______________________________________________
kopete-devel mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/kopete-devel

Reply via email to