MessengerWindow:

- Display nick and location once at startup and not on every tick.
- Optimized loop of std::list from "for" with iterator to std::find.

PeersDialog:
- Optimized some loop of std::list from "for" with iterator to std::find.


git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3395 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2010-08-25 18:31:56 +00:00
parent b85d41cdd7
commit dc7dd949ca
2 changed files with 12 additions and 26 deletions

View file

@ -59,6 +59,7 @@
#include <sstream>
#include <time.h>
#include <sys/stat.h>
#include <algorithm>
#include <QSound>
@ -496,15 +497,7 @@ void PeersDialog::insertPeers()
int index = 0;
while (index < itemCount) {
std::string gpg_widget_id = (peertreeWidget->topLevelItem(index))->data(COLUMN_DATA, ROLE_ID).toString().toStdString();
std::list<std::string>::iterator gpgfriendIt;
bool found = false;
for (gpgfriendIt = gpgFriends.begin(); gpgfriendIt != gpgFriends.end(); gpgfriendIt++) {
if (gpg_widget_id == *gpgfriendIt) {
found = true;
break;
}
}
if (!found) {
if (std::find(gpgFriends.begin(), gpgFriends.end(), gpg_widget_id) == gpgFriends.end()) {
delete (peertreeWidget->takeTopLevelItem(index));
// count again
itemCount = peertreeWidget->topLevelItemCount();