mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-13 05:21:32 -05:00
Fixed fill of the items in PeersDialog
- First fill is made again by showEvent and not from the timer. I overloaded showEvent in one of my last commit and forgot to call the base class. - Add the items directly after the "new" to the tree, because for "setHidden" the item must be added. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3465 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
cbdb717e51
commit
d85ec3acf2
@ -327,6 +327,8 @@ void PeersDialog::showEvent(QShowEvent *event)
|
|||||||
QScrollBar *scrollbar = ui.msgText->verticalScrollBar();
|
QScrollBar *scrollbar = ui.msgText->verticalScrollBar();
|
||||||
scrollbar->setValue(scrollbar->maximum());
|
scrollbar->setValue(scrollbar->maximum());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RsAutoUpdatePage::showEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PeersDialog::pasteLink()
|
void PeersDialog::pasteLink()
|
||||||
@ -566,11 +568,13 @@ void PeersDialog::insertPeers()
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool bNew = false;
|
|
||||||
if (gpg_item == NULL) {
|
if (gpg_item == NULL) {
|
||||||
gpg_item = new MyPeerTreeWidgetItem(peertreeWidget, 0); //set type to 0 for custom popup menu
|
gpg_item = new MyPeerTreeWidgetItem(peertreeWidget, 0); //set type to 0 for custom popup menu
|
||||||
|
|
||||||
|
/* Add gpg item to the list. Add here, because for setHidden the item must be added */
|
||||||
|
peertreeWidget->addTopLevelItem(gpg_item);
|
||||||
|
|
||||||
gpg_item->setChildIndicatorPolicy(QTreeWidgetItem::DontShowIndicatorWhenChildless);
|
gpg_item->setChildIndicatorPolicy(QTreeWidgetItem::DontShowIndicatorWhenChildless);
|
||||||
bNew = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gpg_item -> setText(COLUMN_NAME, QString::fromStdString(detail.name));
|
gpg_item -> setText(COLUMN_NAME, QString::fromStdString(detail.name));
|
||||||
@ -630,6 +634,14 @@ void PeersDialog::insertPeers()
|
|||||||
|
|
||||||
if (newChild) {
|
if (newChild) {
|
||||||
sslItem = new MyPeerTreeWidgetItem(peertreeWidget, 1); //set type to 1 for custom popup menu
|
sslItem = new MyPeerTreeWidgetItem(peertreeWidget, 1); //set type to 1 for custom popup menu
|
||||||
|
|
||||||
|
#ifdef PEERS_DEBUG
|
||||||
|
std::cerr << "PeersDialog::insertPeers() inserting sslItem." << std::endl;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Add ssl child to the list. Add here, because for setHidden the item must be added */
|
||||||
|
gpg_item->addChild(sslItem);
|
||||||
|
// gpg_item->setExpanded(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* not displayed, used to find back the item */
|
/* not displayed, used to find back the item */
|
||||||
@ -694,15 +706,6 @@ void PeersDialog::insertPeers()
|
|||||||
sslItem -> setTextColor(i, sslColor);
|
sslItem -> setTextColor(i, sslColor);
|
||||||
sslItem -> setFont(i, sslFont);
|
sslItem -> setFont(i, sslFont);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PEERS_DEBUG
|
|
||||||
std::cerr << "PeersDialog::insertPeers() inserting sslItem." << std::endl;
|
|
||||||
#endif
|
|
||||||
/* add ssl child to the list. If item is already in the list, it won't be duplicated thanks to Qt */
|
|
||||||
if (newChild) {
|
|
||||||
gpg_item->addChild(sslItem);
|
|
||||||
gpg_item->setExpanded(true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
@ -847,11 +850,6 @@ void PeersDialog::insertPeers()
|
|||||||
}
|
}
|
||||||
|
|
||||||
gpg_item -> setIcon(COLUMN_NAME, gpgIcon);
|
gpg_item -> setIcon(COLUMN_NAME, gpgIcon);
|
||||||
|
|
||||||
if (bNew) {
|
|
||||||
/* add gpg item to the list */
|
|
||||||
peertreeWidget->addTopLevelItem(gpg_item);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QTreeWidgetItem *c = getCurrentPeer();
|
QTreeWidgetItem *c = getCurrentPeer();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user