Commit ab8a3a12 authored by Volker Krause's avatar Volker Krause
Browse files

Ensure the KCrash availability is in sync in the code and in CMake

parent 2c23820a
......@@ -90,6 +90,9 @@ else()
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS DBusAddons)
find_package(KF5 ${KF5_MIN_VERSION} OPTIONAL_COMPONENTS Solid Crash)
endif()
if (TARGET KF5::Crash)
set(HAVE_KCRASH TRUE)
endif()
add_definitions(-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_URL_CAST_FROM_STRING)
add_definitions(-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT)
......
# SPDX-FileCopyrightText: 2018 Volker Krause <vkrause@kde.org>
# SPDX-License-Identifier: BSD-3-Clause
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config-itinerary.h.in ${CMAKE_CURRENT_BINARY_DIR}/config-itinerary.h)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/itinerary_version_detailed.h.in ${CMAKE_CURRENT_BINARY_DIR}/itinerary_version_detailed.h)
set(itinerary_srcs
......
/*
SPDX-FileCopyrightText: 2021 Volker Krause <vkrause@kde.org>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
#cmakedefine01 HAVE_KCRASH
......@@ -4,6 +4,7 @@
SPDX-License-Identifier: LGPL-2.0-or-later
*/
#include "config-itinerary.h"
#include "itinerary_version.h"
#include "logging.h"
......@@ -53,7 +54,7 @@
#include <KLocalizedString>
#include <KAboutData>
#ifndef Q_OS_ANDROID
#if HAVE_KCRASH
#include <KCrash>
#endif
......@@ -218,9 +219,11 @@ int main(int argc, char **argv)
parser.addPositionalArgument(QStringLiteral("file"), i18n("PkPass or JSON-LD file to import."));
parser.process(app);
aboutData.processCommandLine(&parser);
#ifndef Q_OS_ANDROID
#if HAVE_KCRASH
KCrash::initialize();
#endif
#ifndef Q_OS_ANDROID
KDBusService service(KDBusService::Unique);
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment