fix webengine functionality on linux appimage builds
This commit is contained in:
parent
ee1841d3e0
commit
570973fdcc
3 changed files with 20 additions and 10 deletions
|
@ -215,15 +215,7 @@ Application::Application(const QString& id, int& argc, char** argv, const QStrin
|
||||||
|
|
||||||
QTimer::singleShot(1000, system(), &SystemFactory::checkForUpdatesOnStartup);
|
QTimer::singleShot(1000, system(), &SystemFactory::checkForUpdatesOnStartup);
|
||||||
|
|
||||||
auto ideal_th_count = QThread::idealThreadCount();
|
setupGlobalThreadPool();
|
||||||
|
|
||||||
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);
|
|
||||||
|
|
||||||
qDebugNN << LOGSEC_CORE << "OpenSSL version:" << QUOTE_W_SPACE_DOT(QSslSocket::sslLibraryVersionString());
|
qDebugNN << LOGSEC_CORE << "OpenSSL version:" << QUOTE_W_SPACE_DOT(QSslSocket::sslLibraryVersionString());
|
||||||
qDebugNN << LOGSEC_CORE << "OpenSSL supported:" << QUOTE_W_SPACE_DOT(QSslSocket::supportsSsl());
|
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;
|
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() {
|
void Application::onAdBlockFailure() {
|
||||||
qApp->showGuiMessage(Notification::Event::GeneralEvent,
|
qApp->showGuiMessage(Notification::Event::GeneralEvent,
|
||||||
{tr("AdBlock needs to be configured"),
|
{tr("AdBlock needs to be configured"),
|
||||||
|
|
|
@ -223,6 +223,7 @@ class RSSGUARD_DLLSPEC Application : public SingleApplication {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void setupCustomDataFolder(const QString& data_folder);
|
void setupCustomDataFolder(const QString& data_folder);
|
||||||
|
void setupGlobalThreadPool();
|
||||||
void determineFirstRuns();
|
void determineFirstRuns();
|
||||||
void eliminateFirstRuns();
|
void eliminateFirstRuns();
|
||||||
void displayLogMessageInDialog(const QString& message);
|
void displayLogMessageInDialog(const QString& message);
|
||||||
|
|
|
@ -405,7 +405,12 @@ DKEY Notifications::ID = "notifications";
|
||||||
DKEY Browser::ID = "browser";
|
DKEY Browser::ID = "browser";
|
||||||
|
|
||||||
DKEY Browser::WebEngineChromiumFlags = "webengine_chromium_flags";
|
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");
|
DVALUE(QString) Browser::WebEngineChromiumFlagsDef = QSL("--enable-smooth-scrolling");
|
||||||
|
#endif
|
||||||
|
|
||||||
DKEY Browser::OpenLinksInExternalBrowserRightAway = "open_link_externally_wo_confirmation";
|
DKEY Browser::OpenLinksInExternalBrowserRightAway = "open_link_externally_wo_confirmation";
|
||||||
DVALUE(bool) Browser::OpenLinksInExternalBrowserRightAwayDef = false;
|
DVALUE(bool) Browser::OpenLinksInExternalBrowserRightAwayDef = false;
|
||||||
|
|
Loading…
Add table
Reference in a new issue