From cdff8d0e8527a3c9b6ba10fd3a014238c1b497e0 Mon Sep 17 00:00:00 2001 From: Alexis Lopez Zubieta Date: Mon, 8 Jul 2019 18:49:35 -0500 Subject: [PATCH] Make QGtk 2 Theme and Style deployment optional --- src/main.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index deb5205..b31faa8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -89,8 +89,17 @@ bool deployPlatformPlugins(appdir::AppDir &appDir, const bf::path &qtPluginsPath // either loading succeeds, then the system Gtk shall be used anyway, otherwise loading fails and Qt will fall // back to the default UI theme // we don't care whether this works (it's an experimental feature), therefore we ignore the return values - appDir.deployFile(platformThemesPath / "libqgtk2.so", platformThemesDestination); - appDir.deployFile(stylesPath / "libqgtk2style.so", stylesDestination); + bf::path qgtkPlatformThemePath = platformThemesPath / "libqgtk2.so"; + if (bf::exists(qgtkPlatformThemePath)) + appDir.deployFile(qgtkPlatformThemePath, platformThemesDestination); + else + ldLog() << LD_ERROR << "Missing Gtk 2 platform theme file: " << qgtkPlatformThemePath << std::endl; + + bf::path qgtkStylePath = stylesPath / "libqgtk2style.so"; + if (bf::exists(qgtkStylePath)) + appDir.deployFile(qgtkStylePath, stylesDestination); + else + ldLog() << LD_ERROR << "Missing Gtk 2 platform style file: " << qgtkStylePath << std::endl; } return true;