From kde-commits Wed Sep 01 04:19:39 2010 From: Lamarque Vieira Souza Date: Wed, 01 Sep 2010 04:19:39 +0000 To: kde-commits Subject: KDE/kdenetwork/kopete/kopete Message-Id: <20100901041939.7D05BAC857 () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=128331519421076 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 ( "" ); QList accountList = Kopete::AccountManager::self()->accounts(); + qSort(accountList.begin(), accountList.end(), compareOnlineStatus); foreach ( Kopete::Account *a, accountList ) { Kopete::Contact *self = a->myself();