From ea326176b60849bfc3c1288292319e020719b06c Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Thu, 22 Nov 2018 14:26:03 +0100 Subject: Add library check for Plasma and Breakpad configuration toggles --- src/main.cpp | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) (limited to 'src/main.cpp') 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 #include #include +#include #include -#include "configuration.h" +#include #include #include -#include #include -#include +#include #ifdef _WIN32 #include #include #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 #include +#include // 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("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")) { -- cgit v1.2.1