diff --git a/retroshare-gui/src/gui/common/FriendListModel.cpp b/retroshare-gui/src/gui/common/FriendListModel.cpp index 60a0265ee..7b1018fc3 100644 --- a/retroshare-gui/src/gui/common/FriendListModel.cpp +++ b/retroshare-gui/src/gui/common/FriendListModel.cpp @@ -56,6 +56,12 @@ RsFriendListModel::RsFriendListModel(QObject *parent) mFilterStrings.clear(); } +void RsFriendListModel::setDisplayStatusString(bool b) +{ + mDisplayStatusString = b; + postMods(); +} + void RsFriendListModel::setDisplayGroups(bool b) { mDisplayGroups = b; @@ -676,7 +682,7 @@ QVariant RsFriendListModel::displayRole(const EntryIndex& e, int col) const { std::string css = rsMsgs->getCustomStateString(node->node_info.id); - if(!css.empty()) + if(!css.empty() && mDisplayStatusString) return QVariant(QString::fromUtf8(node->node_info.location.c_str())+"\n"+QString::fromUtf8(css.c_str())); else return QVariant(QString::fromUtf8(node->node_info.location.c_str())); diff --git a/retroshare-gui/src/gui/common/FriendListModel.h b/retroshare-gui/src/gui/common/FriendListModel.h index 582a13f54..376d462f7 100644 --- a/retroshare-gui/src/gui/common/FriendListModel.h +++ b/retroshare-gui/src/gui/common/FriendListModel.h @@ -119,6 +119,9 @@ public: void setDisplayGroups(bool b); bool getDisplayGroups() const { return mDisplayGroups; } + void setDisplayStatusString(bool b); + bool getDisplayStatusString() const { return mDisplayStatusString; } + EntryType getType(const QModelIndex&) const; bool getGroupData (const QModelIndex&,RsGroupInfo &) const; @@ -198,6 +201,7 @@ private: FilterType mFilterType; bool mDisplayGroups ; + bool mDisplayStatusString ; // The 3 vectors below store thehierarchical information for groups, profiles and locations, // meaning which is the child/parent of which. The actual group/profile/node data are also stored in the diff --git a/retroshare-gui/src/gui/common/NewFriendList.cpp b/retroshare-gui/src/gui/common/NewFriendList.cpp index 598005043..97a90fa10 100644 --- a/retroshare-gui/src/gui/common/NewFriendList.cpp +++ b/retroshare-gui/src/gui/common/NewFriendList.cpp @@ -158,7 +158,6 @@ NewFriendList::NewFriendList(QWidget *parent) : QWidget(parent), ui(new Ui::NewFriendList()), // mCompareRole(new RSTreeWidgetItemCompareRole), - mShowState(false), groupsHasChanged(false) { ui->setupUi(this); @@ -294,7 +293,7 @@ void NewFriendList::headerContextMenuRequested(QPoint p) displayMenu.addAction(ui->actionShowGroups); ui->actionShowOfflineFriends->setChecked(mProxyModel->showOfflineNodes()); - ui->actionShowState->setChecked(mShowState); + ui->actionShowState->setChecked(mModel->getDisplayStatusString()); ui->actionShowGroups->setChecked(mModel->getDisplayGroups()); QHeaderView *header = ui->peerTreeWidget->header(); @@ -347,7 +346,7 @@ void NewFriendList::processSettings(bool load) // states setShowUnconnected(!Settings->value("hideUnconnected", mProxyModel->showOfflineNodes()).toBool()); - setShowState(Settings->value("showState", mShowState).toBool()); + setShowState(Settings->value("showState", mModel->getDisplayStatusString()).toBool()); setShowGroups(Settings->value("showGroups", mModel->getDisplayGroups()).toBool()); setColumnVisible(RsFriendListModel::COLUMN_THREAD_IP,Settings->value("showIP", isColumnVisible(RsFriendListModel::COLUMN_THREAD_IP)).toBool()); @@ -379,7 +378,7 @@ void NewFriendList::processSettings(bool load) // states Settings->setValue("hideUnconnected", !mProxyModel->showOfflineNodes()); - Settings->setValue("showState", mShowState); + Settings->setValue("showState", mModel->getDisplayStatusString()); Settings->setValue("showGroups", mModel->getDisplayGroups()); Settings->setValue("showIP",isColumnVisible(RsFriendListModel::COLUMN_THREAD_IP)); @@ -1467,7 +1466,7 @@ void NewFriendList::sortByColumn(int column, Qt::SortOrder sortOrder) void NewFriendList::setShowState(bool show) { - mShowState = show; + mModel->setDisplayStatusString(show); } void NewFriendList::setShowGroups(bool show)