mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
some optimizations in PeersDialog::insertPeers
do not call too much into the libretroshare git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3031 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
d7b8e9cb7c
commit
74978b77b7
@ -373,9 +373,10 @@ void PeersDialog::insertPeers()
|
|||||||
|
|
||||||
//add own gpg id, if we have more than on location (ssl client)
|
//add own gpg id, if we have more than on location (ssl client)
|
||||||
std::list<std::string> ownSslContacts;
|
std::list<std::string> ownSslContacts;
|
||||||
rsPeers->getSSLChildListOfGPGId(rsPeers->getGPGOwnId(), ownSslContacts);
|
std::string ownId = rsPeers->getGPGOwnId();
|
||||||
|
rsPeers->getSSLChildListOfGPGId(ownId, ownSslContacts);
|
||||||
if (ownSslContacts.size() > 0) {
|
if (ownSslContacts.size() > 0) {
|
||||||
gpgFriends.push_back(rsPeers->getGPGOwnId());
|
gpgFriends.push_back(ownId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get a link to the table */
|
/* get a link to the table */
|
||||||
@ -416,7 +417,7 @@ void PeersDialog::insertPeers()
|
|||||||
|
|
||||||
RsPeerDetails detail;
|
RsPeerDetails detail;
|
||||||
if ((!rsPeers->getPeerDetails(*it, detail) || !detail.accept_connection)
|
if ((!rsPeers->getPeerDetails(*it, detail) || !detail.accept_connection)
|
||||||
&& detail.gpg_id != rsPeers->getGPGOwnId()) {
|
&& detail.gpg_id != ownId) {
|
||||||
//don't accept anymore connection, remove from the view
|
//don't accept anymore connection, remove from the view
|
||||||
if (gpg_item) {
|
if (gpg_item) {
|
||||||
delete (peertreeWidget->takeTopLevelItem(peertreeWidget->indexOfTopLevelItem(gpg_item)));
|
delete (peertreeWidget->takeTopLevelItem(peertreeWidget->indexOfTopLevelItem(gpg_item)));
|
||||||
@ -488,13 +489,15 @@ void PeersDialog::insertPeers()
|
|||||||
/* not displayed, used to find back the item */
|
/* not displayed, used to find back the item */
|
||||||
sslItem -> setText(3, QString::fromStdString(sslDetail.id));
|
sslItem -> setText(3, QString::fromStdString(sslDetail.id));
|
||||||
|
|
||||||
if (rsMsgs->getCustomStateString(sslDetail.id) != "") {
|
QString sText;
|
||||||
sslItem -> setText( 0, tr("location : ") + QString::fromStdString(sslDetail.location) + tr(" - ") + QString::fromStdString(rsMsgs->getCustomStateString(sslDetail.id)));
|
std::string customStateString = rsMsgs->getCustomStateString(sslDetail.id);
|
||||||
sslItem -> setToolTip( 0, tr("location : ") + QString::fromStdString(sslDetail.location) + tr(" - ") + QString::fromStdString(rsMsgs->getCustomStateString(sslDetail.id)));
|
if (customStateString.empty() == false) {
|
||||||
|
sText = tr("location : ") + QString::fromStdString(sslDetail.location) + tr(" - ") + QString::fromStdString(customStateString);
|
||||||
} else {
|
} else {
|
||||||
sslItem -> setText( 0, tr("location : ") + QString::fromStdString(sslDetail.location));
|
sText = tr("location : ") + QString::fromStdString(sslDetail.location);
|
||||||
sslItem -> setToolTip( 0, tr("location : ") + QString::fromStdString(sslDetail.location));
|
|
||||||
}
|
}
|
||||||
|
sslItem -> setText( 0, sText);
|
||||||
|
sslItem -> setToolTip( 0, sText);
|
||||||
|
|
||||||
/* not displayed, used to find back the item */
|
/* not displayed, used to find back the item */
|
||||||
sslItem -> setText(1, QString::fromStdString(sslDetail.autoconnect));
|
sslItem -> setText(1, QString::fromStdString(sslDetail.autoconnect));
|
||||||
|
Loading…
Reference in New Issue
Block a user