From 719071a9e8c108f76fddd7850a9f86269281cf6e Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Thu, 27 May 2021 09:21:03 +0200 Subject: [PATCH] try to fix erratic modals behavior --- resources/docs/Message-filters.md | 19 +++++++++++++++++++ src/librssguard/gui/guiutilities.cpp | 7 ++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/resources/docs/Message-filters.md b/resources/docs/Message-filters.md index 030bd13ab..e3e982bbe 100755 --- a/resources/docs/Message-filters.md +++ b/resources/docs/Message-filters.md @@ -115,6 +115,25 @@ function filterMessage() { } ``` +Use published element instead of updated element for ATOM entries (only). +```js +function filterMessage() { + // Read raw contents of message and + // convert to JSON. + json = utils.fromXmlToJson(msg.rawContents); + jsonObj = JSON.parse(json) + + // Read published date and parse it. + publishedDate = jsonObj.entry.published.__text; + parsedDate = utils.parseDateTime(publishedDate); + + // Set new date/time for message and + // proceed. + msg.created = parsedDate; + return MessageObject.Accept; +} +``` + Dump RAW data of each message to RSS Guard's [debug output](Documentation.md#generating-debug-log-file). ```js function filterMessage() { diff --git a/src/librssguard/gui/guiutilities.cpp b/src/librssguard/gui/guiutilities.cpp index b470962ac..57d4da93f 100644 --- a/src/librssguard/gui/guiutilities.cpp +++ b/src/librssguard/gui/guiutilities.cpp @@ -22,7 +22,12 @@ void GuiUtilities::setLabelAsNotice(QLabel& label, bool is_warning) { } void GuiUtilities::applyDialogProperties(QWidget& widget, const QIcon& icon, const QString& title) { - widget.setWindowFlags(/*Qt::MSWindowsFixedSizeDialogHint | */ Qt::Dialog | Qt::WindowSystemMenuHint | Qt::WindowTitleHint); +#if defined(Q_OS_WIN) + widget.setWindowFlags(Qt::Dialog | Qt::WindowTitleHint); +#else + widget.setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint); +#endif + widget.setWindowIcon(icon); if (!title.isEmpty()) {