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

List:       kde-commits
Subject:    KDE/kdenetwork/kopete/kopete
From:       Lamarque Vieira Souza <lamarque () gmail ! com>
Date:       2010-09-01 4:19:39
Message-ID: 20100901041939.7D05BAC857 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1170480 by lvsouza:

System tray tooltip: sort accounts by online status to make it easier to read
their status when user has several accounts.


 M  +6 -0      kopetewindow.cpp  


--- trunk/KDE/kdenetwork/kopete/kopete/kopetewindow.cpp #1170479:1170480
@@ -1037,6 +1037,11 @@
 		i->setPixmap ( pm );
 }
 
+bool compareOnlineStatus(const Kopete::Account *a, const Kopete::Account *b)
+{
+	return (a->myself()->onlineStatus().status() > b->myself()->onlineStatus().status());
+}
+
 void KopeteWindow::makeTrayToolTip()
 {
 	//FIXME: maybe use identities here?
@@ -1045,6 +1050,7 @@
 	{
 		QString tt = QLatin1String ( "<qt>" );
 		QList<Kopete::Account *> accountList = Kopete::AccountManager::self()->accounts();
+		qSort(accountList.begin(), accountList.end(), compareOnlineStatus);
 		foreach ( Kopete::Account *a, accountList )
 		{
 			Kopete::Contact *self = a->myself();
[prev in list] [next in list] [prev in thread] [next in thread] 

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