Commit 628c30ed authored by Ronan's avatar Ronan

feat(app): always use D-Bus Single Application on GNU/Linux

parent c38b164b
......@@ -32,7 +32,6 @@ set(CMAKE_CXX_STANDARD 11)
set(ASSETS_DIR assets)
option(ENABLE_DBUS "Enable single instance handling via DBus." NO)
option(ENABLE_UPDATE_CHECK "Enable update check." NO)
include(GNUInstallDirs)
......@@ -89,7 +88,7 @@ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG -DQT_QML_DEBUG -DQT_
# ------------------------------------------------------------------------------
set(QT5_PACKAGES Core Gui Quick Widgets QuickControls2 Svg LinguistTools Concurrent Network)
if (ENABLE_DBUS)
if (UNIX AND NOT APPLE)
list(APPEND QT5_PACKAGES DBus)
endif ()
set(QT5_PACKAGES_OPTIONAL TextToSpeech)
......@@ -255,7 +254,7 @@ else ()
)
endif ()
if (ENABLE_DBUS)
if (UNIX AND NOT APPLE)
list(APPEND SOURCES src/app/single-application/SingleApplicationDBus.cpp)
list(APPEND HEADERS src/app/single-application/SingleApplicationDBusPrivate.hpp)
else ()
......
......@@ -28,9 +28,6 @@ lcb_package_source(YES)
lcb_spec_file("linphoneqt.spec")
lcb_cmake_options("-DENABLE_UPDATE_CHECK=${ENABLE_UPDATE_CHECK}")
if(UNIX AND NOT APPLE)
lcb_cmake_options("-DENABLE_DBUS=${ENABLE_DBUS}")
endif()
# Add config step for packaging
set(LINPHONE_BUILDER_ADDITIONAL_CONFIG_STEPS "${CMAKE_CURRENT_LIST_DIR}/additional_steps.cmake")
......@@ -35,11 +35,11 @@ struct InstancesInfo {
};
class SingleApplicationPrivate : public QDBusAbstractAdaptor {
Q_OBJECT
Q_CLASSINFO("D-Bus Interface", "org.linphone.DBus.SingleApplication")
Q_OBJECT;
Q_CLASSINFO("D-Bus Interface", "org.linphone.DBus.SingleApplication");
public:
Q_DECLARE_PUBLIC(SingleApplication) SingleApplicationPrivate (SingleApplication *q_ptr);
SingleApplicationPrivate (SingleApplication *q_ptr);
QDBusConnection getBus () const;
......@@ -50,8 +50,12 @@ public:
SingleApplication::Options options;
quint32 instanceNumber;
private:
// Explicit public slot. Cannot be private, must be exported as a method via D-Bus.
public slots:
void handleMessageReceived (quint32 instanceId, QByteArray message);
private:
Q_DECLARE_PUBLIC(SingleApplication);
};
#endif // SINGLE_APPLICATION_DBUS_PRIVATE_H_
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