diff --git a/retroshare-gui/src/gui/MainWindow.cpp b/retroshare-gui/src/gui/MainWindow.cpp index 933ea498b..fdc115f21 100644 --- a/retroshare-gui/src/gui/MainWindow.cpp +++ b/retroshare-gui/src/gui/MainWindow.cpp @@ -382,18 +382,19 @@ void MainWindow::updateStatus() if(RsAutoUpdatePage::eventsLocked()) return ; + unsigned int nFriendCount = 0; + unsigned int nOnlineCount = 0; + rsPeers->getPeerCount (&nFriendCount, &nOnlineCount); + if (ratesstatus) ratesstatus->getRatesStatus(); if (peerstatus) - peerstatus->getPeerStatus(); + peerstatus->getPeerStatus(nFriendCount, nOnlineCount); if (natstatus) natstatus->getNATStatus(); - unsigned int online = 0; - rsPeers->getPeerCount (NULL, &online); - unsigned int newInboxCount = 0; rsMsgs->getMessageCount (NULL, &newInboxCount, NULL, NULL, NULL, NULL); @@ -411,17 +412,17 @@ void MainWindow::updateStatus() trayIcon->setToolTip(tr("RetroShare") + "\n" + tr("You have %1 new message").arg(newInboxCount)); } } - else if (online == 0) + else if (nOnlineCount == 0) { trayIcon->setIcon(QIcon(IMAGE_NOONLINE)); trayIcon->setToolTip(tr("RetroShare")); } - else if (online < 2) + else if (nOnlineCount < 2) { trayIcon->setIcon(QIcon(IMAGE_ONEONLINE)); trayIcon->setToolTip(tr("RetroShare")); } - else if (online < 3) + else if (nOnlineCount < 3) { trayIcon->setIcon(QIcon(IMAGE_TWOONLINE)); trayIcon->setToolTip(tr("RetroShare")); diff --git a/retroshare-gui/src/gui/statusbar/peerstatus.cpp b/retroshare-gui/src/gui/statusbar/peerstatus.cpp index ff3d665b0..eea01f5fb 100644 --- a/retroshare-gui/src/gui/statusbar/peerstatus.cpp +++ b/retroshare-gui/src/gui/statusbar/peerstatus.cpp @@ -59,14 +59,10 @@ PeerStatus::~PeerStatus() { } -void PeerStatus::getPeerStatus() +void PeerStatus::getPeerStatus(unsigned int nFriendCount, unsigned int nOnlineCount) { /* set users/friends/network */ - unsigned int nFriendCount = 0; - unsigned int nOnlineCount = 0; - rsPeers->getPeerCount (&nFriendCount, &nOnlineCount); - std::ostringstream out; out << nFriendCount << " "; diff --git a/retroshare-gui/src/gui/statusbar/peerstatus.h b/retroshare-gui/src/gui/statusbar/peerstatus.h index f575ecab5..7d760d079 100644 --- a/retroshare-gui/src/gui/statusbar/peerstatus.h +++ b/retroshare-gui/src/gui/statusbar/peerstatus.h @@ -34,7 +34,7 @@ public: ~PeerStatus(); - void getPeerStatus( ); + void getPeerStatus(unsigned int nFriendCount, unsigned int nOnlineCount); private: