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)
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)

View file

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