mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-25 01:10:19 -05:00
changed from std::string to RsPgpId to represent openned items in FriendList
This commit is contained in:
parent
f3d7948238
commit
6937d870b0
@ -57,7 +57,7 @@
|
|||||||
|
|
||||||
MessengerWindow* MessengerWindow::_instance = NULL;
|
MessengerWindow* MessengerWindow::_instance = NULL;
|
||||||
|
|
||||||
std::set<std::string> MessengerWindow::expandedPeers ;
|
std::set<RsPgpId> MessengerWindow::expandedPeers ;
|
||||||
std::set<RsNodeGroupId> MessengerWindow::expandedGroups ;
|
std::set<RsNodeGroupId> MessengerWindow::expandedGroups ;
|
||||||
|
|
||||||
/*static*/ void MessengerWindow::showYourself ()
|
/*static*/ void MessengerWindow::showYourself ()
|
||||||
@ -99,7 +99,7 @@ MessengerWindow::MessengerWindow(QWidget* parent, Qt::WindowFlags flags)
|
|||||||
connect(NotifyQt::getInstance(), SIGNAL(ownStatusMessageChanged()), this, SLOT(loadmystatusmessage()));
|
connect(NotifyQt::getInstance(), SIGNAL(ownStatusMessageChanged()), this, SLOT(loadmystatusmessage()));
|
||||||
connect(NotifyQt::getInstance(), SIGNAL(peerStatusChanged(QString,int)), this, SLOT(updateOwnStatus(QString,int)));
|
connect(NotifyQt::getInstance(), SIGNAL(peerStatusChanged(QString,int)), this, SLOT(updateOwnStatus(QString,int)));
|
||||||
|
|
||||||
for (std::set<std::string>::iterator peerIt = expandedPeers.begin(); peerIt != expandedPeers.end(); ++peerIt) {
|
for (std::set<RsPgpId>::iterator peerIt = expandedPeers.begin(); peerIt != expandedPeers.end(); ++peerIt) {
|
||||||
ui.friendList->addPeerToExpand(*peerIt);
|
ui.friendList->addPeerToExpand(*peerIt);
|
||||||
}
|
}
|
||||||
expandedPeers.clear();
|
expandedPeers.clear();
|
||||||
|
@ -67,7 +67,7 @@ private:
|
|||||||
/** Qt Designer generated object */
|
/** Qt Designer generated object */
|
||||||
Ui::MessengerWindow ui;
|
Ui::MessengerWindow ui;
|
||||||
|
|
||||||
static std::set<std::string> expandedPeers ;
|
static std::set<RsPgpId> expandedPeers ;
|
||||||
static std::set<RsNodeGroupId> expandedGroups ;
|
static std::set<RsNodeGroupId> expandedGroups ;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1196,7 +1196,7 @@ void FriendList::insertPeers()
|
|||||||
gpgItem->setFont(i, gpgFont);
|
gpgItem->setFont(i, gpgFont);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (openPeers.find(gpgId.toStdString()) != openPeers.end()) {
|
if (openPeers.find(gpgId) != openPeers.end()) {
|
||||||
gpgItem->setExpanded(true);
|
gpgItem->setExpanded(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1253,14 +1253,14 @@ bool FriendList::getExpandedGroups(std::set<RsNodeGroupId> &groups) const
|
|||||||
/**
|
/**
|
||||||
* Returns a list with all gpg ids that are expanded
|
* Returns a list with all gpg ids that are expanded
|
||||||
*/
|
*/
|
||||||
bool FriendList::getExpandedPeers(std::set<std::string> &peers) const
|
bool FriendList::getExpandedPeers(std::set<RsPgpId> &peers) const
|
||||||
{
|
{
|
||||||
peers.clear();
|
peers.clear();
|
||||||
QTreeWidgetItemIterator it(ui->peerTreeWidget);
|
QTreeWidgetItemIterator it(ui->peerTreeWidget);
|
||||||
while (*it) {
|
while (*it) {
|
||||||
QTreeWidgetItem *item = *it;
|
QTreeWidgetItem *item = *it;
|
||||||
if (item->type() == TYPE_GPG && item->isExpanded()) {
|
if (item->type() == TYPE_GPG && item->isExpanded()) {
|
||||||
peers.insert(peers.end(), getRsId(item));
|
peers.insert(peers.end(), RsPgpId(getRsId(item)));
|
||||||
}
|
}
|
||||||
++it;
|
++it;
|
||||||
}
|
}
|
||||||
@ -2282,7 +2282,7 @@ void FriendList::addGroupToExpand(const RsNodeGroupId &groupId)
|
|||||||
* Add a gpgId to the openPeers list. These peers
|
* Add a gpgId to the openPeers list. These peers
|
||||||
* will be expanded, when they're added to the QTreeWidget
|
* will be expanded, when they're added to the QTreeWidget
|
||||||
*/
|
*/
|
||||||
void FriendList::addPeerToExpand(const std::string &gpgId)
|
void FriendList::addPeerToExpand(const RsPgpId& gpgId)
|
||||||
{
|
{
|
||||||
openPeers.insert(gpgId);
|
openPeers.insert(gpgId);
|
||||||
}
|
}
|
||||||
|
@ -65,8 +65,8 @@ public:
|
|||||||
void processSettings(bool load);
|
void processSettings(bool load);
|
||||||
void addGroupToExpand(const RsNodeGroupId &groupId);
|
void addGroupToExpand(const RsNodeGroupId &groupId);
|
||||||
bool getExpandedGroups(std::set<RsNodeGroupId> &groups) const;
|
bool getExpandedGroups(std::set<RsNodeGroupId> &groups) const;
|
||||||
void addPeerToExpand(const std::string &gpgId);
|
void addPeerToExpand(const RsPgpId &gpgId);
|
||||||
bool getExpandedPeers(std::set<std::string> &peers) const;
|
bool getExpandedPeers(std::set<RsPgpId> &peers) const;
|
||||||
|
|
||||||
std::string getSelectedGroupId() const;
|
std::string getSelectedGroupId() const;
|
||||||
|
|
||||||
@ -120,8 +120,7 @@ private:
|
|||||||
|
|
||||||
bool groupsHasChanged;
|
bool groupsHasChanged;
|
||||||
std::set<RsNodeGroupId> openGroups;
|
std::set<RsNodeGroupId> openGroups;
|
||||||
#warning this would needs an ID, not a std::string.
|
std::set<RsPgpId> openPeers;
|
||||||
std::set<std::string> openPeers;
|
|
||||||
|
|
||||||
/* Color definitions (for standard see qss.default) */
|
/* Color definitions (for standard see qss.default) */
|
||||||
QColor mTextColorGroup;
|
QColor mTextColorGroup;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user