diff --git a/src/librssguard/miscellaneous/application.cpp b/src/librssguard/miscellaneous/application.cpp index d4054f015..d62f431fd 100644 --- a/src/librssguard/miscellaneous/application.cpp +++ b/src/librssguard/miscellaneous/application.cpp @@ -215,15 +215,7 @@ Application::Application(const QString& id, int& argc, char** argv, const QStrin QTimer::singleShot(1000, system(), &SystemFactory::checkForUpdatesOnStartup); - auto ideal_th_count = QThread::idealThreadCount(); - - if (ideal_th_count > 1) { - QThreadPool::globalInstance()->setMaxThreadCount((std::min)(32, 2 * ideal_th_count)); - } - - // NOTE: Do not expire threads so that their IDs are not reused. - // This fixes cross-thread QSqlDatabase access. - QThreadPool::globalInstance()->setExpiryTimeout(-1); + setupGlobalThreadPool(); qDebugNN << LOGSEC_CORE << "OpenSSL version:" << QUOTE_W_SPACE_DOT(QSslSocket::sslLibraryVersionString()); qDebugNN << LOGSEC_CORE << "OpenSSL supported:" << QUOTE_W_SPACE_DOT(QSslSocket::supportsSsl()); @@ -952,6 +944,18 @@ void Application::setupCustomDataFolder(const QString& data_folder) { m_customDataFolder = data_folder; } +void Application::setupGlobalThreadPool() { + auto ideal_th_count = QThread::idealThreadCount(); + + if (ideal_th_count > 1) { + QThreadPool::globalInstance()->setMaxThreadCount((std::min)(32, 2 * ideal_th_count)); + } + + // NOTE: Do not expire threads so that their IDs are not reused. + // This fixes cross-thread QSqlDatabase access. + QThreadPool::globalInstance()->setExpiryTimeout(-1); +} + void Application::onAdBlockFailure() { qApp->showGuiMessage(Notification::Event::GeneralEvent, {tr("AdBlock needs to be configured"), diff --git a/src/librssguard/miscellaneous/application.h b/src/librssguard/miscellaneous/application.h index f15ac86d8..2576a63da 100644 --- a/src/librssguard/miscellaneous/application.h +++ b/src/librssguard/miscellaneous/application.h @@ -187,7 +187,7 @@ class RSSGUARD_DLLSPEC Application : public SingleApplication { // Processes incoming message from another RSS Guard instance. void parseCmdArgumentsFromOtherInstance(const QString& message); - void parseCmdArgumentsFromMyInstance(const QStringList& raw_cli_args, QString &custom_ua); + void parseCmdArgumentsFromMyInstance(const QStringList& raw_cli_args, QString& custom_ua); void displayLog(); @@ -223,6 +223,7 @@ class RSSGUARD_DLLSPEC Application : public SingleApplication { #endif void setupCustomDataFolder(const QString& data_folder); + void setupGlobalThreadPool(); void determineFirstRuns(); void eliminateFirstRuns(); void displayLogMessageInDialog(const QString& message); diff --git a/src/librssguard/miscellaneous/settings.cpp b/src/librssguard/miscellaneous/settings.cpp index 68431ac98..5f4760f86 100644 --- a/src/librssguard/miscellaneous/settings.cpp +++ b/src/librssguard/miscellaneous/settings.cpp @@ -405,7 +405,12 @@ DKEY Notifications::ID = "notifications"; DKEY Browser::ID = "browser"; DKEY Browser::WebEngineChromiumFlags = "webengine_chromium_flags"; + +#if defined(Q_OS_LINUX) && !defined(IS_FLATPAK_BUILD) +DVALUE(QString) Browser::WebEngineChromiumFlagsDef = QSL("--disable-gpu --no-sandbox --enable-smooth-scrolling"); +#else DVALUE(QString) Browser::WebEngineChromiumFlagsDef = QSL("--enable-smooth-scrolling"); +#endif DKEY Browser::OpenLinksInExternalBrowserRightAway = "open_link_externally_wo_confirmation"; DVALUE(bool) Browser::OpenLinksInExternalBrowserRightAwayDef = false;