This commit is contained in:
Martin Rotter 2021-08-13 09:43:36 +02:00
parent 6f88071884
commit 2222b94d69
3 changed files with 16 additions and 16 deletions

View File

@ -379,8 +379,8 @@ The other mode is that user data folder is placed in subfolder `data4` in the sa
#### <a id="userd-plac"></a>`%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).
### <a id="webb"></a>Built-in Web Browser with AdBlock
RSS Guard is distributed in two variants:

View File

@ -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

View File

@ -154,14 +154,14 @@ void GreaderNetwork::prepareFeedFetching(GreaderServiceRoot* root,
remote_starred_ids_list.replace(i, convertShortStreamIdToLongStreamId(remote_starred_ids_list.at(i)));
}
QSet<QString> remote_starred_ids(remote_starred_ids_list.begin(), remote_starred_ids_list.end());
QSet<QString> remote_starred_ids = FROM_LIST_TO_SET(QSet<QString>, remote_starred_ids_list);
QSet<QString> local_starred_ids;
QList<QHash<ServiceRoot::BagOfMessages, QStringList>> all_states = stated_messages.values();
for (auto& lst : all_states) {
auto s = lst.value(ServiceRoot::BagOfMessages::Starred);
local_starred_ids.unite(QSet<QString>(s.begin(), s.end()));
local_starred_ids.unite(FROM_LIST_TO_SET(QSet<QString>, 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<QString> remote_all_ids(remote_all_ids_list.begin(), remote_all_ids_list.end());
QSet<QString> remote_unread_ids(remote_unread_ids_list.begin(), remote_unread_ids_list.end());
QSet<QString> remote_all_ids = FROM_LIST_TO_SET(QSet<QString>, remote_all_ids_list);
QSet<QString> remote_unread_ids = FROM_LIST_TO_SET(QSet<QString>, remote_unread_ids_list);
QSet<QString> remote_read_ids = remote_all_ids - remote_unread_ids;
QSet<QString> local_unread_ids;
QSet<QString> 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<QString>(u.begin(), u.end()));
local_read_ids.unite(QSet<QString>(r.begin(), r.end()));
local_unread_ids.unite(FROM_LIST_TO_SET(QSet<QString>, u));
local_read_ids.unite(FROM_LIST_TO_SET(QSet<QString>, r));
}
if (!m_downloadOnlyUnreadMessages) {
@ -219,7 +219,7 @@ void GreaderNetwork::prepareFeedFetching(GreaderServiceRoot* root,
}
Feed::Status error;
QList<QString> to_download_list(to_download.begin(), to_download.end());
QList<QString> to_download_list(to_download.values());
if (!to_download_list.isEmpty()) {
if (m_service == GreaderServiceRoot::Service::Reedah) {
@ -261,19 +261,17 @@ QList<Message> GreaderNetwork::getMessagesIntelligently(ServiceRoot* root,
remote_unread_ids_list.replace(i, convertShortStreamIdToLongStreamId(remote_unread_ids_list.at(i)));
}
QSet<QString> remote_all_ids(remote_all_ids_list.begin(), remote_all_ids_list.end());
QSet<QString> remote_all_ids = FROM_LIST_TO_SET(QSet<QString>, remote_all_ids_list);
// 1.
auto local_unread_ids_list = stated_messages.value(ServiceRoot::BagOfMessages::Unread);
QSet<QString> remote_unread_ids(remote_unread_ids_list.begin(), remote_unread_ids_list.end());
QSet<QString> local_unread_ids(local_unread_ids_list.begin(),
local_unread_ids_list.end());
QSet<QString> remote_unread_ids = FROM_LIST_TO_SET(QSet<QString>, remote_unread_ids_list);
QSet<QString> local_unread_ids = FROM_LIST_TO_SET(QSet<QString>, local_unread_ids_list);
// 2.
auto local_read_ids_list = stated_messages.value(ServiceRoot::BagOfMessages::Read);
QSet<QString> remote_read_ids = remote_all_ids - remote_unread_ids;
QSet<QString> local_read_ids(local_read_ids_list.begin(),
local_read_ids_list.end());
QSet<QString> local_read_ids = FROM_LIST_TO_SET(QSet<QString>, local_read_ids_list);
// 3.
QSet<QString> to_download;
@ -295,7 +293,7 @@ QList<Message> GreaderNetwork::getMessagesIntelligently(ServiceRoot* root,
to_download += moved_unread;
}
QList<QString> to_download_list(to_download.begin(), to_download.end());
QList<QString> to_download_list(to_download.values());
if (!to_download_list.isEmpty()) {
if (m_service == GreaderServiceRoot::Service::Reedah) {