mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-27 02:11:27 -05:00
Optimized call to p3Peers::getPeerCount in MainWindow::updateStatus
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3263 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
dc67b88eb1
commit
9495648d16
@ -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"));
|
||||
|
@ -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 << " ";
|
||||
|
||||
|
@ -34,7 +34,7 @@ public:
|
||||
|
||||
~PeerStatus();
|
||||
|
||||
void getPeerStatus( );
|
||||
void getPeerStatus(unsigned int nFriendCount, unsigned int nOnlineCount);
|
||||
|
||||
|
||||
private:
|
||||
|
Loading…
x
Reference in New Issue
Block a user