mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-23 13:54:27 -04:00
cleanup up the code in FriendList, and fixed bug causing own locations not to show
This commit is contained in:
parent
b26be4db08
commit
6a62227dba
4 changed files with 10 additions and 24 deletions
|
@ -460,9 +460,9 @@ public:
|
||||||
virtual RsPgpId getGPGId(const RsPeerId& sslId) = 0;
|
virtual RsPgpId getGPGId(const RsPeerId& sslId) = 0;
|
||||||
virtual bool isKeySupported(const RsPgpId& gpg_ids) = 0;
|
virtual bool isKeySupported(const RsPgpId& gpg_ids) = 0;
|
||||||
virtual bool getGPGAcceptedList(std::list<RsPgpId> &gpg_ids) = 0;
|
virtual bool getGPGAcceptedList(std::list<RsPgpId> &gpg_ids) = 0;
|
||||||
virtual bool getGPGSignedList(std::list<RsPgpId> &gpg_ids) = 0;//friends that we accpet to connect with but we don't want to sign their gpg key
|
virtual bool getGPGSignedList(std::list<RsPgpId> &gpg_ids) = 0;// keys signed by our own PGP key.
|
||||||
virtual bool getGPGValidList(std::list<RsPgpId> &gpg_ids) = 0;
|
virtual bool getGPGValidList(std::list<RsPgpId> &gpg_ids) = 0;// all PGP keys without filtering
|
||||||
virtual bool getGPGAllList(std::list<RsPgpId> &gpg_ids) = 0;
|
virtual bool getGPGAllList(std::list<RsPgpId> &gpg_ids) = 0;// all PGP keys as well
|
||||||
virtual bool getAssociatedSSLIds(const RsPgpId& gpg_id, std::list<RsPeerId>& ids) = 0;
|
virtual bool getAssociatedSSLIds(const RsPgpId& gpg_id, std::list<RsPeerId>& ids) = 0;
|
||||||
virtual bool gpgSignData(const void *data, const uint32_t len, unsigned char *sign, unsigned int *signlen, std::string reason = "") = 0;
|
virtual bool gpgSignData(const void *data, const uint32_t len, unsigned char *sign, unsigned int *signlen, std::string reason = "") = 0;
|
||||||
|
|
||||||
|
|
|
@ -993,7 +993,9 @@ void RsFriendListModel::updateInternalData()
|
||||||
HierarchicalNodeInformation hnode ;
|
HierarchicalNodeInformation hnode ;
|
||||||
rsPeers->getPeerDetails(*it,hnode.node_info);
|
rsPeers->getPeerDetails(*it,hnode.node_info);
|
||||||
|
|
||||||
auto it2 = checkProfileIndex(hnode.node_info.gpg_id,pgp_indices,mProfiles,false);
|
// If the Peer ID belong to our own profile, we add our own profile to the list. Otherwise we do not display it in the friend list.
|
||||||
|
|
||||||
|
auto it2 = checkProfileIndex(hnode.node_info.gpg_id,pgp_indices,mProfiles,hnode.node_info.gpg_id == rsPeers->getGPGOwnId());
|
||||||
|
|
||||||
if(it2 == pgp_indices.end())
|
if(it2 == pgp_indices.end())
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -154,11 +154,7 @@ private:
|
||||||
bool m_showOfflineNodes;
|
bool m_showOfflineNodes;
|
||||||
};
|
};
|
||||||
|
|
||||||
NewFriendList::NewFriendList(QWidget *parent) :
|
NewFriendList::NewFriendList(QWidget *parent) : QWidget(parent), ui(new Ui::NewFriendList())
|
||||||
QWidget(parent),
|
|
||||||
ui(new Ui::NewFriendList()),
|
|
||||||
// mCompareRole(new RSTreeWidgetItemCompareRole),
|
|
||||||
groupsHasChanged(false)
|
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
|
@ -220,16 +216,13 @@ NewFriendList::NewFriendList(QWidget *parent) :
|
||||||
QHeaderView *h = ui->peerTreeWidget->header();
|
QHeaderView *h = ui->peerTreeWidget->header();
|
||||||
h->setContextMenuPolicy(Qt::CustomContextMenu);
|
h->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||||
|
|
||||||
// QTimer *timer = new QTimer;
|
|
||||||
// QObject::connect(timer,SIGNAL(timeout()),mModel,SLOT(debug_dump()));
|
|
||||||
// timer->start(2000);
|
|
||||||
|
|
||||||
connect(Shortcut, SIGNAL(activated()), this, SLOT(removefriend()));
|
connect(Shortcut, SIGNAL(activated()), this, SLOT(removefriend()));
|
||||||
connect(ui->peerTreeWidget->header(),SIGNAL(sortIndicatorChanged(int,Qt::SortOrder)), this, SLOT(sortColumn(int,Qt::SortOrder)));
|
connect(ui->peerTreeWidget->header(),SIGNAL(sortIndicatorChanged(int,Qt::SortOrder)), this, SLOT(sortColumn(int,Qt::SortOrder)));
|
||||||
connect(mActionSortByState, SIGNAL(toggled(bool)), this, SLOT(toggleSortByState(bool)));
|
connect(mActionSortByState, SIGNAL(toggled(bool)), this, SLOT(toggleSortByState(bool)));
|
||||||
connect(NotifyQt::getInstance(), SIGNAL(friendsChanged()), mModel, SLOT(updateInternalData()));
|
|
||||||
connect(ui->peerTreeWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(peerTreeWidgetCustomPopupMenu()));
|
connect(ui->peerTreeWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(peerTreeWidgetCustomPopupMenu()));
|
||||||
connect(NotifyQt::getInstance(), SIGNAL(groupsChanged(int)), this, SLOT(groupsChanged()));
|
|
||||||
|
connect(NotifyQt::getInstance(), SIGNAL(friendsChanged()), mModel, SLOT(updateInternalData()));
|
||||||
|
connect(NotifyQt::getInstance(), SIGNAL(groupsChanged(int)), mModel, SLOT(updateInternalData()));
|
||||||
|
|
||||||
connect(ui->actionShowOfflineFriends, SIGNAL(triggered(bool)), this, SLOT(setShowUnconnected(bool)));
|
connect(ui->actionShowOfflineFriends, SIGNAL(triggered(bool)), this, SLOT(setShowUnconnected(bool)));
|
||||||
connect(ui->actionShowState, SIGNAL(triggered(bool)), this, SLOT(setShowState(bool)));
|
connect(ui->actionShowState, SIGNAL(triggered(bool)), this, SLOT(setShowState(bool)));
|
||||||
|
@ -628,11 +621,6 @@ void NewFriendList::createNewGroup()
|
||||||
createGrpDialog.exec();
|
createGrpDialog.exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
void NewFriendList::groupsChanged()
|
|
||||||
{
|
|
||||||
groupsHasChanged = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
static QIcon createAvatar(const QPixmap &avatar, const QPixmap &overlay)
|
static QIcon createAvatar(const QPixmap &avatar, const QPixmap &overlay)
|
||||||
{
|
{
|
||||||
int avatarWidth = avatar.width();
|
int avatarWidth = avatar.width();
|
||||||
|
|
|
@ -110,7 +110,6 @@ private:
|
||||||
// Settings for peer list display
|
// Settings for peer list display
|
||||||
bool mShowState;
|
bool mShowState;
|
||||||
|
|
||||||
bool groupsHasChanged;
|
|
||||||
std::set<RsNodeGroupId> openGroups;
|
std::set<RsNodeGroupId> openGroups;
|
||||||
std::set<RsPgpId> openPeers;
|
std::set<RsPgpId> openPeers;
|
||||||
|
|
||||||
|
@ -123,11 +122,8 @@ private:
|
||||||
|
|
||||||
FriendListSortFilterProxyModel *mProxyModel ;
|
FriendListSortFilterProxyModel *mProxyModel ;
|
||||||
private slots:
|
private slots:
|
||||||
void groupsChanged();
|
|
||||||
void peerTreeWidgetCustomPopupMenu();
|
void peerTreeWidgetCustomPopupMenu();
|
||||||
|
|
||||||
void pastePerson();
|
void pastePerson();
|
||||||
|
|
||||||
void connectNode();
|
void connectNode();
|
||||||
void configureNode();
|
void configureNode();
|
||||||
void configureProfile();
|
void configureProfile();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue