Fixed wrong subscribeFlags in context menu of GxsForumsDialog.

The color of the QTreeWidgetItem was stored with the same key.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6122 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2013-02-11 00:19:35 +00:00
parent 7413bdc50c
commit ee62819389
2 changed files with 10 additions and 11 deletions

View File

@ -165,6 +165,7 @@ void GxsForumsDialog::forumListCustomPopupMenu(QPoint /*point*/)
QMenu contextMnu(this); QMenu contextMnu(this);
#ifdef DEBUG_FORUMS
std::cerr << "GxsForumsDialog::forumListCustomPopupMenu()"; std::cerr << "GxsForumsDialog::forumListCustomPopupMenu()";
std::cerr << std::endl; std::cerr << std::endl;
std::cerr << " mForumId: " << mForumId; std::cerr << " mForumId: " << mForumId;
@ -176,15 +177,13 @@ void GxsForumsDialog::forumListCustomPopupMenu(QPoint /*point*/)
std::cerr << " IS_GROUP_ADMIN(): " << IS_GROUP_ADMIN(subscribeFlags); std::cerr << " IS_GROUP_ADMIN(): " << IS_GROUP_ADMIN(subscribeFlags);
std::cerr << std::endl; std::cerr << std::endl;
std::cerr << std::endl; std::cerr << std::endl;
#endif
QAction *action = contextMnu.addAction(QIcon(IMAGE_SUBSCRIBE), tr("Subscribe to Forum"), this, SLOT(subscribeToForum())); QAction *action = contextMnu.addAction(QIcon(IMAGE_SUBSCRIBE), tr("Subscribe to Forum"), this, SLOT(subscribeToForum()));
// TODO DISABLED CONDITION IS WRONG, as subscribeFlags is = -1.... action->setDisabled (mForumId.empty() || IS_GROUP_SUBSCRIBED(subscribeFlags));
//action->setDisabled (mForumId.empty() || IS_GROUP_SUBSCRIBED(subscribeFlags));
action = contextMnu.addAction(QIcon(IMAGE_UNSUBSCRIBE), tr("Unsubscribe to Forum"), this, SLOT(unsubscribeToForum())); action = contextMnu.addAction(QIcon(IMAGE_UNSUBSCRIBE), tr("Unsubscribe to Forum"), this, SLOT(unsubscribeToForum()));
// TODO DISABLED CONDITION IS WRONG, as subscribeFlags is = -1.... action->setEnabled (!mForumId.empty() && IS_GROUP_SUBSCRIBED(subscribeFlags));
//action->setEnabled (!mForumId.empty() && IS_GROUP_SUBSCRIBED(subscribeFlags));
if (!Settings->getForumOpenAllInNewTab()) { if (!Settings->getForumOpenAllInNewTab()) {
action = contextMnu.addAction(QIcon(""), tr("Open in new tab"), this, SLOT(openInNewTab())); action = contextMnu.addAction(QIcon(""), tr("Open in new tab"), this, SLOT(openInNewTab()));

View File

@ -44,7 +44,7 @@
#define ROLE_LASTPOST Qt::UserRole + 4 #define ROLE_LASTPOST Qt::UserRole + 4
#define ROLE_SEARCH_SCORE Qt::UserRole + 5 #define ROLE_SEARCH_SCORE Qt::UserRole + 5
#define ROLE_SUBSCRIBE_FLAGS Qt::UserRole + 6 #define ROLE_SUBSCRIBE_FLAGS Qt::UserRole + 6
#define ROLE_COLOR Qt::UserRole + 6 #define ROLE_COLOR Qt::UserRole + 7
#define FILTER_NAME_INDEX 0 #define FILTER_NAME_INDEX 0
#define FILTER_DESC_INDEX 1 #define FILTER_DESC_INDEX 1