GxsGroupFrameDialog: Fixed restore of active group tree item when subscrube/unsubscribe a group.

This commit is contained in:
thunder2 2015-08-26 14:51:34 +02:00
parent 389f2f0528
commit da66ac5cff
2 changed files with 10 additions and 0 deletions

View File

@ -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<RsGroupMetaData> &gro
return;
}
mInFill = true;
std::list<RsGroupMetaData>::const_iterator it;
QList<GroupItemInfo> adminList;
@ -752,6 +759,8 @@ void GxsGroupFrameDialog::insertGroupsData(const std::list<RsGroupMetaData> &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();

View File

@ -175,6 +175,7 @@ protected:
private:
bool mInitialized;
bool mInFill;
QString mSettingsName;
RsGxsGroupId mGroupId;
RsGxsIfaceHelper *mInterface;