diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-11-22 14:26:03 +0100 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-11-22 14:56:06 +0100 |
commit | ea326176b60849bfc3c1288292319e020719b06c (patch) | |
tree | 91228a8f1b9bca7a5bb32ca29a922daa3d03eb5c /src | |
parent | Fix transparent background being enabled if Plasma is found (diff) | |
download | smolbote-ea326176b60849bfc3c1288292319e020719b06c.tar.xz |
Add library check for Plasma and Breakpad configuration toggles
Diffstat (limited to 'src')
-rw-r--r-- | src/main.cpp | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/src/main.cpp b/src/main.cpp index 1a8dd11..c4e5d3f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -7,32 +7,41 @@ */ #include "browser.h" +#include "configuration.h" #include "session.h" #include "util.h" -#include <version.h> #include <QFile> #include <QLibraryInfo> +#include <QPluginLoader> #include <QTranslator> -#include "configuration.h" +#include <QVersionNumber> #include <iostream> #include <memory> -#include <QPluginLoader> #include <plugininterface.h> -#include <QVersionNumber> +#include <version.h> #ifdef _WIN32 #include <cstdio> #include <windows.h> #endif -#ifdef BreakpadEnabled +#include "config.h" +#if defined(CONFIG_USEPLASMA) && !defined(PLASMA) +#error "You have enabled Plasma integration, but Frameworks was not found." +#endif + +#if defined(CONFIG_USEBREAKPAD) && !defined(BREAKPAD) +#error "You have enabled Breakpad integration, but Breakpad was not found." +#endif + +#ifdef CONFIG_USEBREAKPAD struct BreakpadContext { char *handler = nullptr; }; #ifdef Q_OS_LINUX -#include <unistd.h> #include <client/linux/handler/exception_handler.h> +#include <unistd.h> // bool filter_callback (void*) // --> true: continue processing and write a minidump @@ -57,7 +66,7 @@ static bool dumpCallback(const google_breakpad::MinidumpDescriptor &descriptor, return succeeded; } #endif // Q_OS_LINUX -#endif +#endif // CONFIG_USEBREAKPAD int main(int argc, char **argv) { @@ -72,7 +81,7 @@ int main(int argc, char **argv) // Disable Chromium's crash handler so breakpad can capture crashes instead. // This has to be done before QtWebEngine gets initialized. const auto chromiumFlags = qgetenv("QTWEBENGINE_CHROMIUM_FLAGS"); - if (!chromiumFlags.contains("disable-in-process-stack-traces")) { + if(!chromiumFlags.contains("disable-in-process-stack-traces")) { qputenv("QTWEBENGINE_CHROMIUM_FLAGS", chromiumFlags + " --disable-in-process-stack-traces"); } @@ -154,7 +163,7 @@ int main(int argc, char **argv) // set this, otherwise the webview becomes black when using a stylesheet app.setAttribute(Qt::AA_DontCreateNativeWidgetSiblings, true); -#ifdef BreakpadEnabled +#ifdef CONFIG_USEBREAKPAD const std::string crashpath = config->value<std::string>("browser.crash.path").value_or("/tmp"); assert(!crashpath.empty()); @@ -175,7 +184,7 @@ int main(int argc, char **argv) #ifdef QT_DEBUG qDebug("Installed breakpad exception handler (path=%s)", crashpath.c_str()); #endif -#endif +#endif // CONFIG_USEBREAKPAD // translator if(config->exists("browser.locale")) { |