diff --git a/retroshare-gui/src/gui/common/GroupTreeWidget.cpp b/retroshare-gui/src/gui/common/GroupTreeWidget.cpp index 06c8e58fc..a285b1794 100644 --- a/retroshare-gui/src/gui/common/GroupTreeWidget.cpp +++ b/retroshare-gui/src/gui/common/GroupTreeWidget.cpp @@ -297,12 +297,22 @@ QString GroupTreeWidget::itemId(QTreeWidgetItem *item) return ""; } - return item->data(COLUMN_DATA, ROLE_ID).toString(); -} - -void GroupTreeWidget::fillGroupItems(QTreeWidgetItem *categoryItem, const QList &itemList) -{ - if (categoryItem == NULL) { + return item->data(COLUMN_DATA, ROLE_ID).toString(); +} + +QString GroupTreeWidget::itemIdAt(QPoint &point) +{ + QTreeWidgetItem *item = ui->treeWidget->itemAt(point); + if (item == NULL) { + return ""; + } + + return item->data(COLUMN_DATA, ROLE_ID).toString(); +} + +void GroupTreeWidget::fillGroupItems(QTreeWidgetItem *categoryItem, const QList &itemList) +{ + if (categoryItem == NULL) { return; } diff --git a/retroshare-gui/src/gui/common/GroupTreeWidget.h b/retroshare-gui/src/gui/common/GroupTreeWidget.h index 11dccbba2..abdbd8802 100644 --- a/retroshare-gui/src/gui/common/GroupTreeWidget.h +++ b/retroshare-gui/src/gui/common/GroupTreeWidget.h @@ -80,12 +80,13 @@ public: void processSettings(RshareSettings *settings, bool load); // Add a new category item - QTreeWidgetItem *addCategoryItem(const QString &name, const QIcon &icon, bool expand); - // Get id of item - QString itemId(QTreeWidgetItem *item); - // Fill items of a group - void fillGroupItems(QTreeWidgetItem *categoryItem, const QList &itemList); - // Set the unread count of an item + QTreeWidgetItem *addCategoryItem(const QString &name, const QIcon &icon, bool expand); + // Get id of item + QString itemId(QTreeWidgetItem *item); + QString itemIdAt(QPoint &point); + // Fill items of a group + void fillGroupItems(QTreeWidgetItem *categoryItem, const QList &itemList); + // Set the unread count of an item void setUnreadCount(QTreeWidgetItem *item, int unreadCount); QTreeWidgetItem *getItemFromId(const QString &id); diff --git a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp index 465461154..310d5f610 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp +++ b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp @@ -206,7 +206,7 @@ void GxsGroupFrameDialog::todo() void GxsGroupFrameDialog::groupTreeCustomPopupMenu(QPoint point) { - QString id = "" ;//ui->groupTreeWidget->itemIdAt(point); + QString id = ui->groupTreeWidget->itemIdAt(point); if (id.isEmpty()) return; mGroupId = RsGxsGroupId(id.toStdString());