diff --git a/localization/rssguard_en.ts b/localization/rssguard_en.ts index 5c6b2499c..d6a1cf88c 100644 --- a/localization/rssguard_en.ts +++ b/localization/rssguard_en.ts @@ -18,31 +18,37 @@ AccountDetails + Form + Display additional nodes + Important Important + Unread + Labels + Probes @@ -102,31 +108,37 @@ Error: %1 + Enable AdBlock + &Help + Filter lists + Add your direct links to filter lists here (one URL per line) + Custom filters + Add your custom filters here (one filter per line) @@ -147,12 +159,12 @@ Error: %1 AdBlockManager - + Failed to setup filters and start server: %1. - + failed to download filter list '%1' @@ -168,80 +180,80 @@ Error: %1 Application - + Application is already running. Application is already running - + Output directory is not writable. Output directory is not writable - + Settings file not copied to output directory successfully. Settings file not copied to output directory successfully. - + Database restoration was not initiated. Make sure that output directory is writable. Database restoration was not initiated. Make sure that output directory is writable. - + Settings restoration was not initiated. Make sure that output directory is writable. Settings restoration was not initiated. Make sure that output directory is writable. - + Cannot add feed Cannot add feed - + Feed cannot be added because there is no active account which can add feeds. - - + + Node.js - + Packages were NOT updated because of error: %2. Affected packages: %1 - + These packages were installed/updated: %1 - + Unread articles fetched - + Go to changelog - + AdBlock needs to be configured - + Welcome - + Welcome to %1. Please, check NEW stuff included in this @@ -249,12 +261,12 @@ version by clicking this popup notification. - + AdBlock is not configured properly. Go to "Settings" -> "Node.js" and check if your Node.js is properly configured. - + Already running @@ -263,61 +275,73 @@ version by clicking this popup notification. ArticleAmountControl + Form + Ignoring old articles + Add articles with any date into the database + Avoid adding articles before this date/time into the database + Absolute date/time + Relative time + Limiting amount of articles in feeds + Customize article limits + In database, keep + Do not remove important articles + Do not remove unread articles + Just move articles to recycle bin, do not purge them @@ -349,31 +373,37 @@ version by clicking this popup notification. ArticleListNotification + ... + Go to previous page + Go to next page + Open article in article list + Open article in web browser + Mark all articles as read @@ -434,21 +464,25 @@ version by clicking this popup notification. AuthenticationDetails + Form + Some feeds require authentication, including GMail feeds. BASIC, NTLM-2 and DIGEST-MD5 authentication schemes are supported. + Credentials + Authentication type @@ -456,12 +490,14 @@ version by clicking this popup notification. + Username Username + Password Password @@ -724,26 +760,31 @@ Click here to open parent directory. + Filename + &Try again + &Stop + &Open file + Open &directory @@ -781,6 +822,7 @@ Click here to open parent directory. + Clean up @@ -1168,17 +1210,17 @@ Item ID: %5 FeedsImportExportModel - + OPML document contains errors - + this is likely not OPML document - + Category Category @@ -1209,12 +1251,12 @@ Item ID: %5 FeedsProxyModel - + Cannot perform drag & drop operation Cannot perform drag & drop operation - + You can't transfer dragged item into different account, this is not supported. You can't transfer dragged item into different account, this is not supported. @@ -1464,36 +1506,43 @@ QtWebEngine cache folder -> "%7" + &Copy info to clipboard + Information + Licenses + Licenses page is available only in English language. + Changelog + Changelog page is available only in English language. + Resources @@ -1525,6 +1574,7 @@ QtWebEngine cache folder -> "%7" FormAddAccount + Add new account Add new account @@ -1709,46 +1759,55 @@ QtWebEngine cache folder -> "%7" + Backup database/settings + Output directory + &Select directory + Backup properties + Items to backup + Database + Settings + Backup name + Operation results @@ -1866,31 +1925,37 @@ QtWebEngine cache folder -> "%7" + Parent folder + Select parent item for your category. + Title Title + Description + Icon + Select icon for your category. @@ -1935,56 +2000,67 @@ QtWebEngine cache folder -> "%7" + Cleanup database + Cleanup settings + Optimize database file + Remove all read articles + Remove all articles from recycle bin + Remove all articles older than + Remove all starred articles + Database information + Total data size + Database type + Progress @@ -2141,22 +2217,22 @@ QtWebEngine cache folder -> "%7" FormFeedDetails - + Add new feed Add new feed - + Cannot save changes: %1 - + Edit "%1" - + Edit %n feeds @@ -2164,62 +2240,70 @@ QtWebEngine cache folder -> "%7" - + Fetch articles using global interval - + Fetch articles every - + Disable auto-fetching of articles - + Cannot save feed properties + Articles + Auto-downloading of articles + Select the auto-download strategy for messages of this feed. Default auto-download strategy means that new messges of this feed will be downloaded in time intervals set in application settings. + Open articles via their URL automatically + Miscellaneous + Disable this feed + Right-to-left layout + Ignore notifications for this feed @@ -2289,618 +2373,741 @@ QtWebEngine cache folder -> "%7" + &File + &Help + &View + Show/hide + &Tools + F&eeds + &Add item + &Move + Art&icles + &Recycle bin(s) + &Accounts + &Web browser && tabs + &Quit + Quit the application. + &Settings + Display settings of the application. + &About application + Displays extra info about this application. + &Fullscreen + Switch fullscreen mode. + &Fetch all + Fetch all feeds + Fetch &selected + Fetch selected feeds + Mark articles &read + Mark selected articles read + Mark articles &unread + Mark selected articles unread + Switch &importance + Switch importance of selected articles + Mark all messages (without message filters) from selected items as read. + Mark all messages (without message filters) from selected items as unread. + &Delete articles + &Edit selected items + &Delete selected items + Mark selected items &read + Mark selected items &unread + &Clean selected items + Deletes all messages from selected items. + Open in &external browser + Open selected articles in external browser + Open in &internal browser + Open selected articles in internal browser + No actions available + No actions are available right now. + &Mark all read + Marks all messages in all items read. This does not take message filters into account. + Switch main window visibility + Hides main window if it is visible and shows it if it is hidden. + &Feed list + Hides or shows the list of feeds/categories. + &Clean all + Deletes all messages from all items. + &Next item + &Previous item + &Next article + &Previous article + Check for &updates + Check if new update for the application is available for download. + &Main menu + Hides or displays the main menu. + Report a &bug... + &Toolbars + Switch visibility of main toolbars. + &List headers + &Donate... + Display &documentation + &Restart + &Restore settings + &Backup settings + Switch layout + &Downloads + Send via e-mail + Send selected articles via e-mail + &Cleanup database + Show unread items only + &Expand/collapse selected item + &Add account + &Restore articles + &Restore all recycle bins + &Empty all recycle bins + Next &unread article + Status bar + &Edit selected account + &Delete selected account + Add new category Add new category + Stop ongoing fetching + New browser tab + Close all tabs + Close all tabs except current + Go to &next tab + Go to &previous tab + &Enable article preview + &Copy URL of selected item + Article &filters + &Show tree expanders + Fetch feeds with &custom auto-download policy + Alternate row colors in lists + Automatically &expand item when selected + Message viewer toolbars + Expand/collapse selected item &recursively + Close &current tab + &Copy URLs of selected articles + Open in internal browser (no new tab) + &Sort alphabetically + Move &up + Move to &top + Move &down + Move to &bottom + Display application &log + Focus feeds search box + Focus articles search box + Scroll &up browser + Scroll &down browser + Rearrange &subcategories alphabetically + Rearrange &feeds alphabetically + Cleanup web cac&he + You must add new account first + You must add new account first. + Edit &child feeds + Edit child feeds (&recursive) + Play in &media player + Add new feed Add new feed @@ -3063,122 +3270,147 @@ QtWebEngine cache folder -> "%7" + Article filters + &Check all + &Uncheck all + Remove selected + &New filter + Article filter details + + Title Title + Title of article filter + Pre-made filters + JavaScript code + Your JavaScript-based article filtering logic + &Test + Process checked feeds + &Beautify + Detailed &help + Existing articles + Sample article + URL URL + Author Author + Created on + Contents Contents + Read Read + Important Important + Script output @@ -3223,31 +3455,37 @@ QtWebEngine cache folder -> "%7" + Restore database/settings + Operation results + Source directory + &Select directory + Restore database + Restore settings @@ -3295,6 +3533,7 @@ You have to restart manually. + Settings @@ -3302,15 +3541,20 @@ You have to restart manually. FormStandardFeedDetails - + General General - + Network + + + Experimental + + FormStandardImportExport @@ -3708,31 +3952,37 @@ You can install it now. + Check for updates + Current release + Available release + Status + Changelog + Available files @@ -4387,6 +4637,7 @@ Login tokens expiration: %2 ItemDetails + Form @@ -4793,51 +5044,61 @@ Login tokens expiration: %2 MediaPlayer + Form + Play/pause + Stop Stop + Speed + Progress + Duration + Mute/unmute + Volume + Download + Switch fullscreen mode @@ -5579,41 +5840,49 @@ Login tokens expiration: %2 + Form + Host + Hostname or IP of your proxy server + Port + Username Username + Your username for proxy server authentication + Password Password + Your password for proxy server authentication @@ -5624,6 +5893,7 @@ Login tokens expiration: %2 + Type Proxy server type. @@ -5848,7 +6118,7 @@ Login tokens expiration: %2 QObject - + + %n other feeds. @@ -6045,17 +6315,17 @@ List of supported readers: - + escape sequence not completed - + closing " is missing - + closing ' is missing @@ -6585,16 +6855,19 @@ Login tokens expiration: %2 SearchTextWidget + Search text + Find previous occurence + Find next occurence @@ -6659,14 +6932,14 @@ Number of categories: %2 SettingsBrowserMail - + Select web browser executable Select web browser executable - - - + + + Executables (*) File filter for external browser selection dialog. ---------- @@ -6674,24 +6947,24 @@ File filter for external e-mail selection dialog. Executables (*) - - - + + + Executables (*.*) Executables (*.*) - + Select e-mail executable Select e-mail executable - + Opera 12 or older Opera 12 or older - + Enter (optional) parameters: @@ -6702,92 +6975,120 @@ File filter for external e-mail selection dialog. + Network + Do not accept any incoming cookies + Enable HTTP/2 + Enable API server - - Custom "QTWEBENGINE_CHROMIUM_FLAGS" flags + + + Custom User-Agent + + Custom "QTWEBENGINE_CHROMIUM_FLAGS" flags + + + + + Disable cache - + + External web browser - + + Always open hyperlinks in external web browser - - + + + + <html><head/><body><p>If unchecked, then default system-wide web browser is used.</p></body></html> - + + Use custom external web browser - + + Web browser executable - + + Executable file of web browser - - + + + + &Browse - - - - - Parameters - - + + + + Parameters + + + + + + + Parameters passed to executable - - + + + + Use sample arguments for - + + Select browser @@ -6797,27 +7098,32 @@ File filter for external e-mail selection dialog. - + + External e-mail client - + + Use custom external e-mail client - + + E-mail client executable - + + Executable file of e-mail client - + + Select client @@ -6829,22 +7135,26 @@ File filter for external e-mail selection dialog. - + + External tools - + + &Add tool - + + &Edit selected tool - + + &Delete selected tool @@ -6854,12 +7164,12 @@ File filter for external e-mail selection dialog. - + Select external tool - + Enter parameters @@ -6968,41 +7278,49 @@ Authors of this application are NOT responsible for lost data. + Database driver + Use in-memory database as the working database + Hostname + Port + Working database + Username Username + Password Password + Test setup @@ -7021,31 +7339,37 @@ Authors of this application are NOT responsible for lost data. + Open download manager when new download is started + Target directory for downloaded files + Save all downloaded files to + Target directory where all downloaded files are saved + &Browse + Ask for each individual downloaded file @@ -7117,57 +7441,69 @@ Authors of this application are NOT responsible for lost data. + Feed fetching + Fetch all articles on startup with initial delay of + Auto-fetch articles for all feeds every + Only auto-fetch articles if application is unfocused + Feed connection timeout + Connection timeout is time interval which is reserved for downloading new messages for the feed. If this time interval elapses, then download process is aborted. + ms + Support very fast auto-fetching intervals (under 10 seconds) + Feeds list + + Row height + Feed list font @@ -7175,6 +7511,9 @@ Authors of this application are NOT responsible for lost data. + + + Font preview @@ -7182,141 +7521,171 @@ Authors of this application are NOT responsible for lost data. + + + &Change font + Article count format + Hide article counts if there are no unread articles + Allow only basic keyboard shortcuts for feed/article list + Display tooltips for feeds and articles + Update feed list during feed fetching + Articles + Remove all read articles from all feeds on application exit + Ignore changes in article body when new articles are being fetched + Internal article viewer + Limit height of all pictures + Use legacy article formatting + Unread article icon type + Use custom date/time format for dates-only + Upon article selection, mark as read + Bring application window to front once article is opened in external web browser + Article browser font + Fixup date/time of articles which are in the future + Display attachments directly in article + Keep article viewer always visible + Articles list + Keep article selection in the middle of the article list viewport + Enable multiline items + Top/bottom row padding + Use custom date/time format + Custom date/time format for today's articles + Article list font + Show relative time for articles not older than @@ -7335,11 +7704,13 @@ Authors of this application are NOT responsible for lost data. + Launch %1 on operating system startup + Check for %1 updates on application startup @@ -7447,137 +7818,165 @@ Description: %3 + Icons && skins + Icon theme + Style + Skin + Use skin colors (skin colors for dialogs/controls only take effect with Fusion style) + Custom skin colors + Customize predefined colors + Tray area + Tray icon + Use monochrome icon + + Display count of unread messages + Hide main window when it is minimized + Start application hidden + Task bar + Tabs + Close tabs with + Middle mouse button single-click + Left mouse button double-click + Open new tabs with left mouse button double-click on tab bar + Hide tab bar if just one tab is visible + Toolbars + Toolbar for feeds list + Toolbar for articles list + Statusbar + Button style + Toolbar editor + Icon size @@ -7646,16 +8045,19 @@ Description: %3 SettingsMediaPlayer + Backend + Use custom MPV configuration folder + Browse @@ -7740,11 +8142,13 @@ Also, relaunch "Settings" dialog after you install Node.js. + Form + Node.js executable @@ -7752,21 +8156,27 @@ Also, relaunch "Settings" dialog after you install Node.js. + + + &Browse + NPM executable + Package folder + &Download Node.js @@ -7775,46 +8185,55 @@ Also, relaunch "Settings" dialog after you install Node.js. SettingsNotifications + Enable notifications + Balloon notifications type + Native notifications (tray icon must be enabled) + Custom notifications + Position + Width + Margins + Screen + Opacity @@ -7879,31 +8298,37 @@ Also, relaunch "Settings" dialog after you install Node.js. + Balloon notification + Sound + Full path to your WAV sound file + &Browse + &Play + Volume @@ -8050,47 +8475,65 @@ Also, relaunch "Settings" dialog after you install Node.js. StandardFeed - + + Encoding: %1 +Type: %2 +Post-processing script: %3 +Do not use raw XML saving: %4 + + + + + yes + + + + + no + + + + Script - + Local file - + Built-in web browser with JavaScript support - + Unknown - + Cannot save data for feed: %1 - + this source type cannot be used on 'lite' %1 build - + Cannot move feed, detailed information was logged via debug log. - + Cannot save feed data - + Auto-update status: %1 Active message filters: %2 Status: %3 @@ -8100,19 +8543,12 @@ Item ID: %5 - - Encoding: %1 -Type: %2 -Post-processing script: %3 - - - - + feed format not recognized - + Cannot move feed @@ -8418,6 +8854,26 @@ Also, you can post-process generated feed data with yet another script if you wi + + StandardFeedExpDetails + + + Form + + + + + Use older mechanism for extracting raw XML data + + + + + Turning this setting ON might bring considerable performance boost when fetching this feed, but only in some very specific conditions. + +This setting is useful when raw XML parsing of the feed is very slow, this happens for feed which do have very long contents. + + + StandardServiceRoot @@ -8431,17 +8887,17 @@ Also, you can post-process generated feed data with yet another script if you wi Error when loading initial feeds - + Fetch metadata Fetch metadata - + Export feeds Export feeds - + Import feeds Import feeds @@ -8471,22 +8927,22 @@ Also, you can post-process generated feed data with yet another script if you wi - + Cannot add category Cannot add category - + Cannot add category because another critical operation is ongoing. Cannot add category because another critical operation is ongoing. - + Import was completely successful. - + Some feeds/categories were not imported due to error, check debug log for more details. @@ -8677,51 +9133,61 @@ Unread news: %2 + Activated actions + Available actions + Move action up + Move action down + Insert separator + Insert spacer + Add selected action + Delete selected action + Delete all actions + Reset toolbar @@ -9099,6 +9565,19 @@ Last login on: %4 + + WebEnginePage + + + Website alert + + + + + URL %1 reports this important message: %2 + + + WebFactory diff --git a/src/librssguard-standard/src/standardfeedsimportexportmodel.cpp b/src/librssguard-standard/src/standardfeedsimportexportmodel.cpp index 867a05b2f..ded2d130b 100644 --- a/src/librssguard-standard/src/standardfeedsimportexportmodel.cpp +++ b/src/librssguard-standard/src/standardfeedsimportexportmodel.cpp @@ -195,87 +195,53 @@ bool FeedsImportExportModel::produceFeed(const FeedLookup& feed_lookup) { ? feed_lookup.custom_data[QSL("postProcessScript")].toString() : feed_lookup.post_process_script; - new_feed = StandardFeed::guessFeed(source_type, - feed_lookup.url, - pp_script, - NetworkFactory::NetworkAuthentication::NoAuthentication, - !feed_lookup.do_not_fetch_icons, - {}, - {}, - feed_lookup.custom_proxy); + try { + new_feed = StandardFeed::guessFeed(source_type, + feed_lookup.url, + pp_script, + NetworkFactory::NetworkAuthentication::NoAuthentication, + !feed_lookup.do_not_fetch_icons, + {}, + {}, + feed_lookup.custom_proxy); - new_feed->setSourceType(source_type); - new_feed->setSource(feed_lookup.url); - new_feed->setPostProcessScript(pp_script); + new_feed->setSourceType(source_type); + new_feed->setSource(feed_lookup.url); + new_feed->setPostProcessScript(pp_script); - if (feed_lookup.do_not_fetch_titles) { - QString old_title = feed_lookup.custom_data[QSL("title")].toString(); + if (feed_lookup.do_not_fetch_titles) { + QString old_title = feed_lookup.custom_data[QSL("title")].toString(); - if (!old_title.simplified().isEmpty()) { - new_feed->setTitle(old_title); + if (!old_title.simplified().isEmpty()) { + new_feed->setTitle(old_title); + } + } + + if (feed_lookup.do_not_fetch_icons) { + QIcon old_icon = feed_lookup.custom_data[QSL("icon")].value(); + + if (old_icon.isNull()) { + new_feed->setIcon(qApp->icons()->fromTheme(QSL("application-rss+xml"))); + } + else { + new_feed->setIcon(old_icon); + } } } - - if (feed_lookup.do_not_fetch_icons) { - QIcon old_icon = feed_lookup.custom_data[QSL("icon")].value(); - - if (old_icon.isNull()) { - new_feed->setIcon(qApp->icons()->fromTheme(QSL("application-rss+xml"))); + catch (...) { + if (feed_lookup.add_errored_feeds) { + // Feed guessing failed, add like regular feed anyway. + new_feed = new StandardFeed(); + fillFeedFromFeedLookupData(new_feed, feed_lookup); } else { - new_feed->setIcon(old_icon); + throw; } } } else { new_feed = new StandardFeed(); - - if (feed_lookup.custom_data.isEmpty()) { - // We assume these are "best-guess" defaults. - new_feed->setSourceType(StandardFeed::SourceType::Url); - new_feed->setType(StandardFeed::Type::Rss2X); - - new_feed->setSource(feed_lookup.url); - new_feed->setTitle(feed_lookup.url); - new_feed->setIcon(qApp->icons()->fromTheme(QSL("application-rss+xml"))); - new_feed->setEncoding(QSL(DEFAULT_FEED_ENCODING)); - new_feed->setPostProcessScript(feed_lookup.post_process_script); - } - else { - QString feed_title = feed_lookup.custom_data[QSL("title")].toString(); - QString feed_encoding = feed_lookup.custom_data.value(QSL("encoding"), QSL(DEFAULT_FEED_ENCODING)).toString(); - QString feed_type = feed_lookup.custom_data.value(QSL("type"), QSL(DEFAULT_FEED_TYPE)).toString().toUpper(); - QString feed_description = feed_lookup.custom_data[QSL("description")].toString(); - QIcon feed_icon = feed_lookup.custom_data[QSL("icon")].value(); - StandardFeed::SourceType source_type = - feed_lookup.custom_data[QSL("sourceType")].value(); - QString post_process = feed_lookup.custom_data[QSL("postProcessScript")].toString(); - - new_feed->setTitle(feed_title); - new_feed->setDescription(feed_description); - new_feed->setEncoding(feed_encoding); - new_feed->setSource(feed_lookup.url); - new_feed->setSourceType(source_type); - new_feed->setPostProcessScript(feed_lookup.post_process_script.isEmpty() ? post_process - : feed_lookup.post_process_script); - - if (!feed_icon.isNull()) { - new_feed->setIcon(feed_icon); - } - - if (feed_type == QL1S("RSS1")) { - new_feed->setType(StandardFeed::Type::Rdf); - } - else if (feed_type == QL1S("JSON")) { - new_feed->setType(StandardFeed::Type::Json); - } - else if (feed_type == QL1S("ATOM")) { - new_feed->setType(StandardFeed::Type::Atom10); - } - else { - new_feed->setType(StandardFeed::Type::Rss2X); - } - } + fillFeedFromFeedLookupData(new_feed, feed_lookup); } QMutexLocker mtx(&m_mtxLookup); @@ -295,6 +261,53 @@ bool FeedsImportExportModel::produceFeed(const FeedLookup& feed_lookup) { } } +void FeedsImportExportModel::fillFeedFromFeedLookupData(StandardFeed* feed, const FeedLookup& feed_lookup) { + if (feed_lookup.custom_data.isEmpty()) { + // We assume these are "best-guess" defaults. + feed->setSourceType(StandardFeed::SourceType::Url); + feed->setType(StandardFeed::Type::Rss2X); + feed->setSource(feed_lookup.url); + feed->setTitle(feed_lookup.url); + feed->setIcon(qApp->icons()->fromTheme(QSL("application-rss+xml"))); + feed->setEncoding(QSL(DEFAULT_FEED_ENCODING)); + feed->setPostProcessScript(feed_lookup.post_process_script); + } + else { + QString feed_title = feed_lookup.custom_data[QSL("title")].toString(); + QString feed_encoding = feed_lookup.custom_data.value(QSL("encoding"), QSL(DEFAULT_FEED_ENCODING)).toString(); + QString feed_type = feed_lookup.custom_data.value(QSL("type"), QSL(DEFAULT_FEED_TYPE)).toString().toUpper(); + QString feed_description = feed_lookup.custom_data[QSL("description")].toString(); + QIcon feed_icon = feed_lookup.custom_data[QSL("icon")].value(); + StandardFeed::SourceType source_type = feed_lookup.custom_data[QSL("sourceType")].value(); + QString post_process = feed_lookup.custom_data[QSL("postProcessScript")].toString(); + + feed->setTitle(feed_title); + feed->setDescription(feed_description); + feed->setEncoding(feed_encoding); + feed->setSource(feed_lookup.url); + feed->setSourceType(source_type); + feed->setPostProcessScript(feed_lookup.post_process_script.isEmpty() ? post_process + : feed_lookup.post_process_script); + + if (!feed_icon.isNull()) { + feed->setIcon(feed_icon); + } + + if (feed_type == QL1S("RSS1")) { + feed->setType(StandardFeed::Type::Rdf); + } + else if (feed_type == QL1S("JSON")) { + feed->setType(StandardFeed::Type::Json); + } + else if (feed_type == QL1S("ATOM")) { + feed->setType(StandardFeed::Type::Atom10); + } + else { + feed->setType(StandardFeed::Type::Rss2X); + } + } +} + void FeedsImportExportModel::importAsOPML20(const QByteArray& data, bool fetch_metadata_online, bool do_not_fetch_titles, diff --git a/src/librssguard-standard/src/standardfeedsimportexportmodel.h b/src/librssguard-standard/src/standardfeedsimportexportmodel.h index 2f4703fb7..860a515c4 100644 --- a/src/librssguard-standard/src/standardfeedsimportexportmodel.h +++ b/src/librssguard-standard/src/standardfeedsimportexportmodel.h @@ -19,6 +19,7 @@ struct FeedLookup { bool fetch_metadata_online; bool do_not_fetch_titles; bool do_not_fetch_icons; + bool add_errored_feeds; QNetworkProxy custom_proxy; QString post_process_script; }; @@ -62,6 +63,8 @@ class FeedsImportExportModel : public AccountCheckSortedModel { private: bool produceFeed(const FeedLookup& feed_lookup); + void fillFeedFromFeedLookupData(StandardFeed* feed, const FeedLookup& feed_lookup); + private: StandardServiceRoot* m_account; QMutex m_mtxLookup; diff --git a/src/librssguard/core/feeddownloader.cpp b/src/librssguard/core/feeddownloader.cpp index 1cd11688d..8eaca567e 100644 --- a/src/librssguard/core/feeddownloader.cpp +++ b/src/librssguard/core/feeddownloader.cpp @@ -155,9 +155,9 @@ void FeedDownloader::updateFeeds(const QList& feeds) { std::function func = [=](const FeedUpdateRequest& fd) -> FeedUpdateResult { - #if defined(Q_OS_LINUX) - setThreadPriority(Priority::LOWEST); - #endif +#if defined(Q_OS_LINUX) + setThreadPriority(Priority::Lowest); +#endif return updateThreadedFeed(fd); }; @@ -437,8 +437,7 @@ void FeedDownloader::updateOneFeed(ServiceRoot* acc, } void FeedDownloader::finalizeUpdate() { - qDebugNN << LOGSEC_FEEDDOWNLOADER << "Finished feed updates in thread" - << QUOTE_W_SPACE_DOT(getThreadID()); + qDebugNN << LOGSEC_FEEDDOWNLOADER << "Finished feed updates in thread" << QUOTE_W_SPACE_DOT(getThreadID()); m_feeds.clear(); diff --git a/src/librssguard/gui/webviewers/qtextbrowser/textbrowserviewer.cpp b/src/librssguard/gui/webviewers/qtextbrowser/textbrowserviewer.cpp index d42710166..912aa046a 100644 --- a/src/librssguard/gui/webviewers/qtextbrowser/textbrowserviewer.cpp +++ b/src/librssguard/gui/webviewers/qtextbrowser/textbrowserviewer.cpp @@ -42,7 +42,7 @@ TextBrowserViewer::TextBrowserViewer(QWidget* parent) setDocument(m_document.data()); m_resourceDownloader->moveToThread(m_resourceDownloaderThread); - m_resourceDownloaderThread->start(QThread::LowPriority); + m_resourceDownloaderThread->start(QThread::Priority::LowPriority); connect(this, &TextBrowserViewer::reloadDocument, this, [this]() { const auto scr = verticalScrollBarPosition(); diff --git a/src/librssguard/miscellaneous/application.cpp b/src/librssguard/miscellaneous/application.cpp index 47aa0aaa7..fea4952c8 100644 --- a/src/librssguard/miscellaneous/application.cpp +++ b/src/librssguard/miscellaneous/application.cpp @@ -1157,10 +1157,10 @@ void Application::setupWorkHorsePool() { m_workHorsePool->setMaxThreadCount((std::min)(MAX_THREADPOOL_THREADS, 2 * ideal_th_count)); } -#if QT_VERSION_MAJOR == 6 +#if QT_VERSION >= 0x060200 // Qt >= 6.2.0 // Avoid competing with interactive processes/threads by running the // worker pool at a very low priority - m_workHorsePool->setThreadPriority(QThread::LowestPriority); + m_workHorsePool->setThreadPriority(QThread::Priority::LowestPriority); #endif // NOTE: Do not expire threads so that their IDs are not reused. diff --git a/src/librssguard/miscellaneous/feedreader.cpp b/src/librssguard/miscellaneous/feedreader.cpp index 9c6fd7fc1..b241a4389 100644 --- a/src/librssguard/miscellaneous/feedreader.cpp +++ b/src/librssguard/miscellaneous/feedreader.cpp @@ -128,7 +128,7 @@ void FeedReader::initializeFeedDownloader() { connect(m_feedDownloader, &FeedDownloader::updateStarted, this, &FeedReader::feedUpdatesStarted); connect(m_feedDownloader, &FeedDownloader::updateFinished, qApp->feedUpdateLock(), &Mutex::unlock); - m_feedDownloaderThread->start(QThread::LowPriority); + m_feedDownloaderThread->start(QThread::Priority::LowPriority); } } diff --git a/src/librssguard/miscellaneous/thread.cpp b/src/librssguard/miscellaneous/thread.cpp index 3b9b4a12e..832f50b7e 100644 --- a/src/librssguard/miscellaneous/thread.cpp +++ b/src/librssguard/miscellaneous/thread.cpp @@ -1,8 +1,9 @@ // For license of this file, see /LICENSE.md. -#include "definitions/definitions.h" #include "miscellaneous/thread.h" +#include "definitions/definitions.h" + #include #if defined(Q_OS_LINUX) @@ -11,57 +12,61 @@ #include #endif -// Returns the thread ID of the caller +// Returns the thread ID of the caller. qlonglong getThreadID() { - #if defined(Q_OS_LINUX) +#if defined(Q_OS_LINUX) return qlonglong(gettid()); - #else +#else return qlonglong(QThread::currentThreadId()); - #endif +#endif } #if defined(Q_OS_LINUX) -// On Linux QThread priorities do nothing with the default scheduler SCHED_OTHER -// Set the nice value manually in this case until Qt supports nice values +// On Linux QThread priorities do nothing with the default scheduler SCHED_OTHER. +// +// Set the nice value manually in this case until Qt supports nice values. void setThreadPriority(Priority prio) { int current_policy = sched_getscheduler(0); + if (current_policy != -1) { - // If the current scheduling policy is neither of these the QThread priority should be working + // If the current scheduling policy is neither of these the QThread priority should be working. if (current_policy != SCHED_BATCH && current_policy != SCHED_OTHER) { return; } - // Set the scheduler to SCHED_BATCH if needed, indicating that this process is non-interactive + // Set the scheduler to SCHED_BATCH if needed, indicating that this process is non-interactive. if (current_policy == SCHED_OTHER) { struct sched_param p = {0}; + if (sched_setscheduler(0, SCHED_BATCH, &p) != 0) { - qDebugNN << "Setting the scheduler to SCHED_BATCH for thread" - << QUOTE_W_SPACE(getThreadID()) + qDebugNN << "Setting the scheduler to SCHED_BATCH for thread" << QUOTE_W_SPACE(getThreadID()) << "failed with error" << QUOTE_W_SPACE_DOT(errno); - // We can still try to set the nice value + // We can still try to set the nice value. } } - errno = 0; // Clear errno since -1 is a legitimate return value + errno = 0; // Clear errno since -1 is a legitimate return value. + int current_priority = getpriority(PRIO_PROCESS, 0); + if (errno != 0) { - qDebugNN << "Getting the priority for thread" - << QUOTE_W_SPACE(getThreadID()) - << "failed with error" << QUOTE_W_SPACE_DOT(errno); - } else { + qDebugNN << "Getting the priority for thread" << QUOTE_W_SPACE(getThreadID()) << "failed with error" + << QUOTE_W_SPACE_DOT(errno); + } + else { if (current_priority != prio) { setpriority(PRIO_PROCESS, 0, prio); + if (errno != 0) { - qDebugNN << "Setting the priority for thread" - << QUOTE_W_SPACE(getThreadID()) - << "failed with error" << QUOTE_W_SPACE_DOT(errno); + qDebugNN << "Setting the priority for thread" << QUOTE_W_SPACE(getThreadID()) << "failed with error" + << QUOTE_W_SPACE_DOT(errno); } } } - } else { - qDebugNN << "Getting the priority for thread" - << QUOTE_W_SPACE(getThreadID()) - << "failed with error" << QUOTE_W_SPACE_DOT(errno); + } + else { + qDebugNN << "Getting the priority for thread" << QUOTE_W_SPACE(getThreadID()) << "failed with error" + << QUOTE_W_SPACE_DOT(errno); } } #endif diff --git a/src/librssguard/miscellaneous/thread.h b/src/librssguard/miscellaneous/thread.h index fe76b6618..d556d115a 100644 --- a/src/librssguard/miscellaneous/thread.h +++ b/src/librssguard/miscellaneous/thread.h @@ -3,14 +3,16 @@ #ifndef THREAD_H #define THREAD_H +#include + qlonglong getThreadID(); #if defined(Q_OS_LINUX) -// Values corresponding to nice values +// Values corresponding to nice values. enum Priority { - LOWEST = 19, - LOW = 10, - NORMAL = 0 + Lowest = 19, + Low = 10, + Normal = 0 }; void setThreadPriority(Priority);