From 6645b23021d169c8d3fc0f4522e1725571ace288 Mon Sep 17 00:00:00 2001 From: John Zimmermann Date: Wed, 26 Sep 2018 20:36:13 +0200 Subject: [PATCH 2/7] Fix a few bugs that are caused by dynamic linking to qt5. --- Telegram/SourceFiles/core/launcher.cpp | 8 ++++++++ Telegram/SourceFiles/qt_static_plugins.cpp | 9 --------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git Telegram/SourceFiles/core/launcher.cpp Telegram/SourceFiles/core/launcher.cpp index d4bdadc17..bf9066274 100644 --- a/Telegram/SourceFiles/core/launcher.cpp +++ b/Telegram/SourceFiles/core/launcher.cpp @@ -59,6 +59,14 @@ int Launcher::exec() { Logs::start(this); // must be started before Platform is started Platform::start(); // must be started before QApplication is created + + // I don't know why path is not in QT_PLUGIN_PATH by default + QCoreApplication::addLibraryPath("/usr/lib/qt/plugins"); + // without this Telegram doesn't start on Ubuntu 17.04 due GTK errors + setenv("QT_STYLE_OVERRIDE", "qwerty", false); + // Telegram doesn't start when extraordinary theme is set, see launchpad.net/bugs/1680943 + unsetenv("QT_QPA_PLATFORMTHEME"); + auto result = executeApplication(); DEBUG_LOG(("Telegram finished, result: %1").arg(result)); diff --git Telegram/SourceFiles/qt_static_plugins.cpp Telegram/SourceFiles/qt_static_plugins.cpp index e29f348c8..122ff0f5d 100644 --- a/Telegram/SourceFiles/qt_static_plugins.cpp 2018-12-10 16:37:52.000000000 +0100 +++ b/Telegram/SourceFiles/qt_static_plugins.cpp 2018-12-10 16:37:52.000000000 +0100 @@ -14,7 +14,7 @@ Q_IMPORT_PLUGIN(QWebpPlugin) Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin) Q_IMPORT_PLUGIN(QGenericEnginePlugin) -#elif defined Q_OS_LINUX // Q_OS_WIN | Q_OS_MAC +#elif 0 // Q_OS_WIN | Q_OS_MAC Q_IMPORT_PLUGIN(QWebpPlugin) Q_IMPORT_PLUGIN(QXcbIntegrationPlugin) Q_IMPORT_PLUGIN(QConnmanEnginePlugin) -- 2.19.0