From 2222b94d6963cdf165361b377caa522b31dda127 Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Fri, 13 Aug 2021 09:43:36 +0200 Subject: [PATCH] fix os2 --- resources/docs/Documentation.md | 4 +-- src/librssguard/definitions/definitions.h | 2 ++ .../services/greader/greadernetwork.cpp | 26 +++++++++---------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/resources/docs/Documentation.md b/resources/docs/Documentation.md index 46ccab72a..074a8867b 100755 --- a/resources/docs/Documentation.md +++ b/resources/docs/Documentation.md @@ -379,8 +379,8 @@ The other mode is that user data folder is placed in subfolder `data4` in the sa #### `%data%` placeholder RSS Guard stores its data and settings in single folder. What exact folder it is is described [here](#portable-user-data). RSS Guard allows you to use the folder programmatically in some special contexts via `%data%` placeholder. You can use this placeholder in these RSS Guard contexts: * Contents of your [message filters](Message-filters.md) - you can therefore place some scripts under your user data folder and include it via `JavaScript` into your message filter. -* `source` and `post-process script` attributes of for [scraping](#websites-scraping) feed - you can use the placeholder to load scripts to generate/process feed from user data folder. -* Notifications also support the placeholder in path to audio files which are to be played when some event happens. For example you could place audio files in your data folder and then use them in notification with `%data%\audio\new-messages.wav`. See more about notifications [here](#notifications). +* `source` and `post-process script` attributes of for [scraping](#scrap) feed - you can use the placeholder to load scripts to generate/process feed from user data folder. +* Notifications also support the placeholder in path to audio files which are to be played when some event happens. For example you could place audio files in your data folder and then use them in notification with `%data%\audio\new-messages.wav`. See more about notifications [here](#notif). ### Built-in Web Browser with AdBlock RSS Guard is distributed in two variants: diff --git a/src/librssguard/definitions/definitions.h b/src/librssguard/definitions/definitions.h index ba5f99034..c3f462cdb 100755 --- a/src/librssguard/definitions/definitions.h +++ b/src/librssguard/definitions/definitions.h @@ -288,8 +288,10 @@ // #if QT_VERSION >= 0x050E00 // Qt >= 5.14.0 #define FROM_STD_LIST(x, y) (x(y.begin(), y.end())) +#define FROM_LIST_TO_SET(x, y) (x(y.begin(), y.end())) #else #define FROM_STD_LIST(x, y) (x::fromStdList(y)) +#define FROM_LIST_TO_SET(x, y) (x::fromList(y)) #endif #ifndef qDebugNN diff --git a/src/librssguard/services/greader/greadernetwork.cpp b/src/librssguard/services/greader/greadernetwork.cpp index 595e9ce8c..779a83bdb 100755 --- a/src/librssguard/services/greader/greadernetwork.cpp +++ b/src/librssguard/services/greader/greadernetwork.cpp @@ -154,14 +154,14 @@ void GreaderNetwork::prepareFeedFetching(GreaderServiceRoot* root, remote_starred_ids_list.replace(i, convertShortStreamIdToLongStreamId(remote_starred_ids_list.at(i))); } - QSet remote_starred_ids(remote_starred_ids_list.begin(), remote_starred_ids_list.end()); + QSet remote_starred_ids = FROM_LIST_TO_SET(QSet, remote_starred_ids_list); QSet local_starred_ids; QList> all_states = stated_messages.values(); for (auto& lst : all_states) { auto s = lst.value(ServiceRoot::BagOfMessages::Starred); - local_starred_ids.unite(QSet(s.begin(), s.end())); + local_starred_ids.unite(FROM_LIST_TO_SET(QSet, s)); } auto starred_to_download((remote_starred_ids - local_starred_ids).unite(local_starred_ids - remote_starred_ids)); @@ -183,8 +183,8 @@ void GreaderNetwork::prepareFeedFetching(GreaderServiceRoot* root, remote_unread_ids_list.replace(i, convertShortStreamIdToLongStreamId(remote_unread_ids_list.at(i))); } - QSet remote_all_ids(remote_all_ids_list.begin(), remote_all_ids_list.end()); - QSet remote_unread_ids(remote_unread_ids_list.begin(), remote_unread_ids_list.end()); + QSet remote_all_ids = FROM_LIST_TO_SET(QSet, remote_all_ids_list); + QSet remote_unread_ids = FROM_LIST_TO_SET(QSet, remote_unread_ids_list); QSet remote_read_ids = remote_all_ids - remote_unread_ids; QSet local_unread_ids; QSet local_read_ids; @@ -193,8 +193,8 @@ void GreaderNetwork::prepareFeedFetching(GreaderServiceRoot* root, auto u = lst.value(ServiceRoot::BagOfMessages::Unread); auto r = lst.value(ServiceRoot::BagOfMessages::Read); - local_unread_ids.unite(QSet(u.begin(), u.end())); - local_read_ids.unite(QSet(r.begin(), r.end())); + local_unread_ids.unite(FROM_LIST_TO_SET(QSet, u)); + local_read_ids.unite(FROM_LIST_TO_SET(QSet, r)); } if (!m_downloadOnlyUnreadMessages) { @@ -219,7 +219,7 @@ void GreaderNetwork::prepareFeedFetching(GreaderServiceRoot* root, } Feed::Status error; - QList to_download_list(to_download.begin(), to_download.end()); + QList to_download_list(to_download.values()); if (!to_download_list.isEmpty()) { if (m_service == GreaderServiceRoot::Service::Reedah) { @@ -261,19 +261,17 @@ QList GreaderNetwork::getMessagesIntelligently(ServiceRoot* root, remote_unread_ids_list.replace(i, convertShortStreamIdToLongStreamId(remote_unread_ids_list.at(i))); } - QSet remote_all_ids(remote_all_ids_list.begin(), remote_all_ids_list.end()); + QSet remote_all_ids = FROM_LIST_TO_SET(QSet, remote_all_ids_list); // 1. auto local_unread_ids_list = stated_messages.value(ServiceRoot::BagOfMessages::Unread); - QSet remote_unread_ids(remote_unread_ids_list.begin(), remote_unread_ids_list.end()); - QSet local_unread_ids(local_unread_ids_list.begin(), - local_unread_ids_list.end()); + QSet remote_unread_ids = FROM_LIST_TO_SET(QSet, remote_unread_ids_list); + QSet local_unread_ids = FROM_LIST_TO_SET(QSet, local_unread_ids_list); // 2. auto local_read_ids_list = stated_messages.value(ServiceRoot::BagOfMessages::Read); QSet remote_read_ids = remote_all_ids - remote_unread_ids; - QSet local_read_ids(local_read_ids_list.begin(), - local_read_ids_list.end()); + QSet local_read_ids = FROM_LIST_TO_SET(QSet, local_read_ids_list); // 3. QSet to_download; @@ -295,7 +293,7 @@ QList GreaderNetwork::getMessagesIntelligently(ServiceRoot* root, to_download += moved_unread; } - QList to_download_list(to_download.begin(), to_download.end()); + QList to_download_list(to_download.values()); if (!to_download_list.isEmpty()) { if (m_service == GreaderServiceRoot::Service::Reedah) {