mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-19 14:30:43 -04:00
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:
parent
b85d41cdd7
commit
dc7dd949ca
2 changed files with 12 additions and 26 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue