From da66ac5cff2f4e04fe7d76eb1187983a76cd80b6 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Wed, 26 Aug 2015 14:51:34 +0200 Subject: [PATCH] GxsGroupFrameDialog: Fixed restore of active group tree item when subscrube/unsubscribe a group. --- retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp | 9 +++++++++ retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h | 1 + 2 files changed, 10 insertions(+) diff --git a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp index 71d60610f..cd873b6d0 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp +++ b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp @@ -73,6 +73,7 @@ GxsGroupFrameDialog::GxsGroupFrameDialog(RsGxsIfaceHelper *ifaceImpl, QWidget *p ui->setupUi(this); mInitialized = false; + mInFill = false; mCountChildMsgs = false; mYourGroups = NULL; mSubscribedGroups = NULL; @@ -555,6 +556,10 @@ GxsCommentDialog *GxsGroupFrameDialog::commentWidget(const RsGxsMessageId &msgId void GxsGroupFrameDialog::changedGroup(const QString &groupId) { + if (mInFill) { + return; + } + mGroupId = RsGxsGroupId(groupId.toStdString()); if (mGroupId.isNull()) { return; @@ -689,6 +694,8 @@ void GxsGroupFrameDialog::insertGroupsData(const std::list &gro return; } + mInFill = true; + std::list::const_iterator it; QList adminList; @@ -752,6 +759,8 @@ void GxsGroupFrameDialog::insertGroupsData(const std::list &gro ui->groupTreeWidget->fillGroupItems(mPopularGroups, popList); ui->groupTreeWidget->fillGroupItems(mOtherGroups, otherList); + mInFill = false; + /* Re-fill group */ if (!ui->groupTreeWidget->activateId(QString::fromStdString(mGroupId.toStdString()), true)) { mGroupId.clear(); diff --git a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h index 37d6ddd7b..db6e2bd38 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h +++ b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h @@ -175,6 +175,7 @@ protected: private: bool mInitialized; + bool mInFill; QString mSettingsName; RsGxsGroupId mGroupId; RsGxsIfaceHelper *mInterface;