Port kdeconnectd to KDBusServices and QGuiApp

This commit is contained in:
Àlex Fiestas 2014-09-22 01:53:07 +02:00
parent e43be5d843
commit c2f6956d93
2 changed files with 12 additions and 20 deletions

View file

@ -4,7 +4,7 @@ add_definitions(-DTRANSLATION_DOMAIN="kdeconnect-kded")
configure_file(config-kded.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kded.h) configure_file(config-kded.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kded.h)
add_executable(kdeconnectd kdeconnectd.cpp) add_executable(kdeconnectd kdeconnectd.cpp)
target_link_libraries(kdeconnectd kdeconnectcore KF5::ConfigWidgets) target_link_libraries(kdeconnectd kdeconnectcore KF5::DBusAddons KF5::ConfigWidgets)
add_library(kded_kdeconnect MODULE kded.cpp) add_library(kded_kdeconnect MODULE kded.cpp)

View file

@ -24,9 +24,9 @@
#include <unistd.h> #include <unistd.h>
#include <QSocketNotifier> #include <QSocketNotifier>
#include <KUniqueApplication> #include <QGuiApplication>
#include <k4aboutdata.h>
#include <KCmdLineArgs> #include <KDBusService>
#include "core/daemon.h" #include "core/daemon.h"
@ -59,23 +59,15 @@ void initializeTermHandlers(QCoreApplication* app, Daemon* daemon)
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
K4AboutData aboutData("kdeconnect", "kdeconnect-kded", QCoreApplication::setApplicationName("kdeconnect");
ki18n("kdeconnect"), QCoreApplication::setApplicationVersion("0.1");
"0.1", QCoreApplication::setOrganizationDomain("kde.org");
ki18n("Connect your devices and KDE"),
K4AboutData::License_GPL,
KLocalizedString(),
KLocalizedString(),
"http://albertvaka.wordpress.com");
aboutData.setOrganizationDomain("kde.org"); QGuiApplication app(argc, argv);
KCmdLineArgs::init(argc, argv, &aboutData);
KUniqueApplication app(true); // WARNING GUI required for QClipboard access
app.disableSessionManagement();
app.setQuitOnLastWindowClosed(false); app.setQuitOnLastWindowClosed(false);
KDBusService dbusService(KDBusService::Unique);
//Force daemon to destroy when KApplications in alive //Force daemon to destroy when KApplications in alive
//belongs to bug KApplications resoure freeing //belongs to bug KApplications resoure freeing
Daemon* daemon = new Daemon(0); Daemon* daemon = new Daemon(0);