From 41069a0fa5b1200c055b0ca38c36415c4a0b0b08 Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 23 Sep 2023 17:31:24 +0200 Subject: [PATCH 1/2] added missing removal of event handler in jsonapi and webui settings --- retroshare-gui/src/gui/settings/JsonApiPage.cc | 4 ++++ retroshare-gui/src/gui/settings/JsonApiPage.h | 2 +- retroshare-gui/src/gui/settings/WebuiPage.cpp | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/retroshare-gui/src/gui/settings/JsonApiPage.cc b/retroshare-gui/src/gui/settings/JsonApiPage.cc index 07e75032f..67e5f22b8 100644 --- a/retroshare-gui/src/gui/settings/JsonApiPage.cc +++ b/retroshare-gui/src/gui/settings/JsonApiPage.cc @@ -72,6 +72,10 @@ JsonApiPage::JsonApiPage(QWidget */*parent*/, Qt::WindowFlags /*flags*/) mEventHandlerId, RsEventType::JSON_API ); } +JsonApiPage::~JsonApiPage() +{ + rsEvents->unregisterEventsHandler(mEventHandlerId); +} QString JsonApiPage::helpText() const { return tr("

  Webinterface

\ diff --git a/retroshare-gui/src/gui/settings/JsonApiPage.h b/retroshare-gui/src/gui/settings/JsonApiPage.h index f06340d1a..ef28a4294 100644 --- a/retroshare-gui/src/gui/settings/JsonApiPage.h +++ b/retroshare-gui/src/gui/settings/JsonApiPage.h @@ -33,7 +33,7 @@ class JsonApiPage : public ConfigPage public: JsonApiPage(QWidget * parent = nullptr, Qt::WindowFlags flags = 0); - ~JsonApiPage() override = default; + ~JsonApiPage() override ; virtual QPixmap iconPixmap() const override { diff --git a/retroshare-gui/src/gui/settings/WebuiPage.cpp b/retroshare-gui/src/gui/settings/WebuiPage.cpp index 893fd87e2..d7ff0b894 100644 --- a/retroshare-gui/src/gui/settings/WebuiPage.cpp +++ b/retroshare-gui/src/gui/settings/WebuiPage.cpp @@ -66,7 +66,7 @@ WebuiPage::WebuiPage(QWidget */*parent*/, Qt::WindowFlags /*flags*/) WebuiPage::~WebuiPage() { - + rsEvents->unregisterEventsHandler(mEventsHandlerId); } void WebuiPage::selectWebInterfaceDirectory() From a99f686fd1df1b8e7801fcdd5e6fe8979a9df0cf Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 23 Sep 2023 17:53:12 +0200 Subject: [PATCH 2/2] restricted SPAM/STAR/TAGS to inbox, and made msg summary list refer to current box only --- retroshare-gui/src/gui/msgs/MessageModel.cpp | 4 ++++ retroshare-gui/src/gui/msgs/MessageModel.h | 1 + retroshare-gui/src/gui/msgs/MessagesDialog.cpp | 8 ++++---- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/retroshare-gui/src/gui/msgs/MessageModel.cpp b/retroshare-gui/src/gui/msgs/MessageModel.cpp index 09508cad6..6116e42b4 100644 --- a/retroshare-gui/src/gui/msgs/MessageModel.cpp +++ b/retroshare-gui/src/gui/msgs/MessageModel.cpp @@ -690,6 +690,10 @@ void RsMessageModel::setCurrentBox(Rs::Msgs::BoxName bn) } } +Rs::Msgs::BoxName RsMessageModel::currentBox() const +{ + return mCurrentBox; +} void RsMessageModel::setQuickViewFilter(QuickViewFilter fn) { if(fn != mQuickViewFilter) diff --git a/retroshare-gui/src/gui/msgs/MessageModel.h b/retroshare-gui/src/gui/msgs/MessageModel.h index fb8c6daa5..d23b21f86 100644 --- a/retroshare-gui/src/gui/msgs/MessageModel.h +++ b/retroshare-gui/src/gui/msgs/MessageModel.h @@ -100,6 +100,7 @@ public: // This method will asynchroneously update the data void setCurrentBox(Rs::Msgs::BoxName bn) ; + Rs::Msgs::BoxName currentBox() const ; void setQuickViewFilter(QuickViewFilter fn) ; void setFilter(FilterType filter_type, const QStringList& strings) ; diff --git a/retroshare-gui/src/gui/msgs/MessagesDialog.cpp b/retroshare-gui/src/gui/msgs/MessagesDialog.cpp index de91df5ff..be9eedf6b 100644 --- a/retroshare-gui/src/gui/msgs/MessagesDialog.cpp +++ b/retroshare-gui/src/gui/msgs/MessagesDialog.cpp @@ -925,9 +925,9 @@ void MessagesDialog::changeBox(int box_row) ui.messageTreeWidget->setPlaceholderText(placeholderText); ui.messageTreeWidget->setColumnHidden(RsMessageModel::COLUMN_THREAD_READ,box_row!=ROW_INBOX); - ui.messageTreeWidget->setColumnHidden(RsMessageModel::COLUMN_THREAD_STAR,box_row==ROW_OUTBOX); - ui.messageTreeWidget->setColumnHidden(RsMessageModel::COLUMN_THREAD_SPAM,box_row==ROW_OUTBOX); - ui.messageTreeWidget->setColumnHidden(RsMessageModel::COLUMN_THREAD_TAGS,box_row==ROW_OUTBOX); + ui.messageTreeWidget->setColumnHidden(RsMessageModel::COLUMN_THREAD_STAR,box_row!=ROW_INBOX); + ui.messageTreeWidget->setColumnHidden(RsMessageModel::COLUMN_THREAD_SPAM,box_row!=ROW_INBOX); + ui.messageTreeWidget->setColumnHidden(RsMessageModel::COLUMN_THREAD_TAGS,box_row!=ROW_INBOX); ui.messageTreeWidget->setColumnHidden(RsMessageModel::COLUMN_THREAD_MSGID,true); ui.messageTreeWidget->setColumnHidden(RsMessageModel::COLUMN_THREAD_CONTENT,true); } @@ -1296,7 +1296,7 @@ void MessagesDialog::updateMessageSummaryList() /* calculating the new messages */ std::list msgList; - rsMail->getMessageSummaries(Rs::Msgs::BoxName::BOX_ALL,msgList); + rsMail->getMessageSummaries(mMessageModel->currentBox(),msgList); QMap tagCount;