[calamares] Hook up to KDSAG again (instead of DBus activation)
This commit is contained in:
parent
784f591dee
commit
86d3932a16
3
3rdparty/kdsingleapplication/CMakeLists.txt
vendored
3
3rdparty/kdsingleapplication/CMakeLists.txt
vendored
@ -1,3 +1,5 @@
|
||||
set(KDSINGLEAPPLICATION_STATIC ON)
|
||||
|
||||
set(KDSINGLEAPPLICATION_SRCS kdsingleapplication.cpp kdsingleapplication_localsocket.cpp)
|
||||
|
||||
set(KDSINGLEAPPLICATION_INSTALLABLE_INCLUDES kdsingleapplication.h kdsingleapplication_lib.h)
|
||||
@ -11,6 +13,7 @@ else()
|
||||
add_library(kdsingleapplication SHARED ${KDSINGLEAPPLICATION_INSTALLABLE_INCLUDES} ${KDSINGLEAPPLICATION_SRCS})
|
||||
target_compile_definitions(kdsingleapplication PRIVATE KDSINGLEAPPLICATION_SHARED_BUILD)
|
||||
endif()
|
||||
set_target_properties( kdsingleapplication PROPERTIES AUTOMOC TRUE )
|
||||
|
||||
set(KDSINGLEAPPLICATION_INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR}/kdsingleapplication)
|
||||
|
||||
|
@ -321,7 +321,7 @@ if(ECM_FOUND)
|
||||
include(KDEInstallDirs)
|
||||
endif()
|
||||
|
||||
find_package(KF5 QUIET COMPONENTS CoreAddons Crash DBusAddons)
|
||||
find_package(KF5 QUIET COMPONENTS CoreAddons Crash)
|
||||
set_package_properties(
|
||||
KF5::CoreAddons
|
||||
PROPERTIES
|
||||
@ -330,14 +330,6 @@ set_package_properties(
|
||||
URL "https://api.kde.org/frameworks/kcoreaddons/"
|
||||
PURPOSE "About Calamares"
|
||||
)
|
||||
set_package_properties(
|
||||
KF5::DBusAddons
|
||||
PROPERTIES
|
||||
TYPE REQUIRED
|
||||
DESCRIPTION "Classes for DBus activation"
|
||||
URL "https://api.kde.org/frameworks/dbusaddons/"
|
||||
PURPOSE "Unique instance of Calamares"
|
||||
)
|
||||
if(NOT KF5Crash_FOUND)
|
||||
if(BUILD_KF5Crash)
|
||||
message(WARNING "BUILD_KF5Crash is set, but KF5::Crash is not available.")
|
||||
@ -551,6 +543,7 @@ include(GNUInstallDirs)
|
||||
# libraries for Calamares.
|
||||
set(Calamares_LIBRARIES calamares)
|
||||
|
||||
add_subdirectory(3rdparty/kdsingleapplication)
|
||||
add_subdirectory(src)
|
||||
|
||||
add_feature_info(Python ${WITH_PYTHON} "Python job modules")
|
||||
|
@ -36,13 +36,9 @@ calamares_automoc( calamares_bin )
|
||||
calamares_autouic( calamares_bin )
|
||||
calamares_autorcc( calamares_bin )
|
||||
|
||||
if(kdsagSources)
|
||||
set_source_files_properties(${kdsagSources} PROPERTIES AUTOMOC OFF)
|
||||
endif()
|
||||
|
||||
target_link_libraries(
|
||||
calamares_bin
|
||||
PRIVATE calamares calamaresui calamares-i18n Qt5::Core Qt5::Widgets KF5::CoreAddons KF5::DBusAddons
|
||||
PRIVATE calamares calamaresui calamares-i18n kdsingleapplication Qt5::Core Qt5::Widgets KF5::CoreAddons
|
||||
)
|
||||
if(BUILD_KF5Crash)
|
||||
target_link_libraries(calamares_bin PRIVATE KF5::Crash)
|
||||
|
@ -16,8 +16,10 @@
|
||||
#include "utils/Logger.h"
|
||||
#include "utils/Retranslator.h"
|
||||
|
||||
// From 3rdparty/
|
||||
#include "kdsingleapplication.h"
|
||||
|
||||
#include <KCoreAddons/KAboutData>
|
||||
#include <KDBusAddons/KDBusService>
|
||||
#ifdef BUILD_KF5Crash
|
||||
#include <KCrash/KCrash>
|
||||
#endif
|
||||
@ -26,6 +28,8 @@
|
||||
#include <QDebug>
|
||||
#include <QDir>
|
||||
|
||||
#include <memory>
|
||||
|
||||
/** @brief Gets debug-level from -D command-line-option
|
||||
*
|
||||
* If unset, use LOGERROR (corresponding to -D1), although
|
||||
@ -124,9 +128,17 @@ main( int argc, char* argv[] )
|
||||
KCrash::setFlags( KCrash::SaferDialog | KCrash::AlwaysDirectly );
|
||||
#endif
|
||||
|
||||
bool is_debug = handle_args( a );
|
||||
|
||||
KDBusService service( is_debug ? KDBusService::Multiple : KDBusService::Unique );
|
||||
std::unique_ptr< KDSingleApplication > possiblyUnique;
|
||||
const bool is_debug = handle_args( a );
|
||||
if ( !is_debug )
|
||||
{
|
||||
possiblyUnique = std::make_unique< KDSingleApplication >();
|
||||
if ( !possiblyUnique->isPrimaryInstance() )
|
||||
{
|
||||
qCritical() << "Calamares is already running.";
|
||||
return 87; // EUSERS on Linux
|
||||
}
|
||||
}
|
||||
|
||||
Calamares::Settings::init( is_debug );
|
||||
if ( !Calamares::Settings::instance() || !Calamares::Settings::instance()->isValid() )
|
||||
|
Loading…
Reference in New Issue
Block a user