[SCM] kdeconnect packaging branch, master, updated. debian/0.9g-1-1183-g9d69498

Maximiliano Curia maxy at moszumanska.debian.org
Fri Oct 14 14:28:15 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/kdeconnect.git;a=commitdiff;h=18ba161

The following commit has been merged in the master branch:
commit 18ba161f17bf71cbaef5bcee7ff62c702fd92bc2
Author: Albert Vaca <albertvaka at gmail.com>
Date:   Mon Feb 23 22:12:45 2015 -0800

    Fully replaced KDED for autostart + dbus activation, so we work outside KDE
---
 CMakeLists.txt                                 |   2 +-
 daemon/CMakeLists.txt                          |  15 ++++
 {kded => daemon}/Messages.sh                   |   0
 {kded => daemon}/kdeconnect.desktop            |   0
 {kded => daemon}/kdeconnectd.cpp               |   7 +-
 {kded => daemon}/kdeconnectd.desktop.cmake     |   0
 {kded => daemon}/org.kde.kdeconnect.service.in |   0
 interfaces/CMakeLists.txt                      |   1 +
 interfaces/dbusinterfaces.cpp                  |  19 ++--
 interfaces/dbusinterfaces.h                    |   4 +-
 kded/CMakeLists.txt                            |  30 -------
 kded/config-kded.h.cmake                       |   1 -
 kded/kded.cpp                                  | 120 -------------------------
 kded/kded.h                                    |  60 -------------
 14 files changed, 33 insertions(+), 226 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7d991fa..32cda38 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -33,7 +33,7 @@ add_subdirectory(kio)
 add_subdirectory(icon)
 add_subdirectory(interfaces)
 
-add_subdirectory(kded)
+add_subdirectory(daemon)
 add_subdirectory(plugins)
 add_subdirectory(plasmoid)
 add_subdirectory(cli)
diff --git a/daemon/CMakeLists.txt b/daemon/CMakeLists.txt
new file mode 100644
index 0000000..af4d6bc
--- /dev/null
+++ b/daemon/CMakeLists.txt
@@ -0,0 +1,15 @@
+project(kdeconnectd)
+
+include_directories(${CMAKE_SOURCE_DIR})
+
+add_definitions(-DTRANSLATION_DOMAIN="kdeconnect-daemon")
+
+add_executable(kdeconnectd kdeconnectd.cpp)
+target_link_libraries(kdeconnectd kdeconnectcore KF5::DBusAddons KF5::ConfigWidgets)
+
+configure_file(kdeconnectd.desktop.cmake ${CMAKE_CURRENT_BINARY_DIR}/kdeconnectd.desktop)
+configure_file(org.kde.kdeconnect.service.in ${CMAKE_CURRENT_BINARY_DIR}/org.kde.kdeconnect.service)
+
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/kdeconnectd.desktop DESTINATION ${AUTOSTART_INSTALL_DIR})
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.kde.kdeconnect.service DESTINATION ${DBUS_SERVICES_INSTALL_DIR})
+install(TARGETS kdeconnectd DESTINATION ${LIBEXEC_INSTALL_DIR})
diff --git a/kded/Messages.sh b/daemon/Messages.sh
similarity index 100%
rename from kded/Messages.sh
rename to daemon/Messages.sh
diff --git a/kded/kdeconnect.desktop b/daemon/kdeconnect.desktop
similarity index 100%
rename from kded/kdeconnect.desktop
rename to daemon/kdeconnect.desktop
diff --git a/kded/kdeconnectd.cpp b/daemon/kdeconnectd.cpp
similarity index 92%
copy from kded/kdeconnectd.cpp
copy to daemon/kdeconnectd.cpp
index 9b26a5e..40a53e5 100644
--- a/kded/kdeconnectd.cpp
+++ b/daemon/kdeconnectd.cpp
@@ -29,7 +29,8 @@
 #include <KDBusService>
 
 #include "core/daemon.h"
-#include "kdeconnect-version.h"
+
+#include "../kdeconnect-version.h"
 
 static int sigtermfd[2];
 const static char deadbeef = 1;
@@ -61,15 +62,13 @@ void initializeTermHandlers(QCoreApplication* app, Daemon* daemon)
 int main(int argc, char* argv[])
 {
     QApplication app(argc, argv);
-    app.setApplicationName("kdeconnect");
+    app.setApplicationName("kdeconnectd");
     app.setApplicationVersion(QLatin1String(KDECONNECT_VERSION_STRING));
     app.setOrganizationDomain("kde.org");
     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);
     QObject::connect(daemon, SIGNAL(destroyed(QObject*)), &app, SLOT(quit()));
     initializeTermHandlers(&app, daemon);
diff --git a/kded/kdeconnectd.desktop.cmake b/daemon/kdeconnectd.desktop.cmake
similarity index 100%
rename from kded/kdeconnectd.desktop.cmake
rename to daemon/kdeconnectd.desktop.cmake
diff --git a/kded/org.kde.kdeconnect.service.in b/daemon/org.kde.kdeconnect.service.in
similarity index 100%
rename from kded/org.kde.kdeconnect.service.in
rename to daemon/org.kde.kdeconnect.service.in
diff --git a/interfaces/CMakeLists.txt b/interfaces/CMakeLists.txt
index d71425b..c94dff0 100644
--- a/interfaces/CMakeLists.txt
+++ b/interfaces/CMakeLists.txt
@@ -1,3 +1,4 @@
+project(KDEConnectInterfaces)
 
 include_directories(${CMAKE_CURRENT_BINARY_DIR}
                     ${CMAKE_CURRENT_SOURCE_DIR}
diff --git a/interfaces/dbusinterfaces.cpp b/interfaces/dbusinterfaces.cpp
index c9b09fd..141ef64 100644
--- a/interfaces/dbusinterfaces.cpp
+++ b/interfaces/dbusinterfaces.cpp
@@ -18,11 +18,16 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-
 #include "dbusinterfaces.h"
 
+QString activatedService() {
+    static const QString service = "org.kde.kdeconnect";
+    QDBusConnection::sessionBus().interface()->startService(service);
+    return service;
+}
+
 DaemonDbusInterface::DaemonDbusInterface(QObject* parent)
-    : OrgKdeKdeconnectDaemonInterface("org.kde.kdeconnect", "/modules/kdeconnect", QDBusConnection::sessionBus(), parent)
+    : OrgKdeKdeconnectDaemonInterface(activatedService(), "/modules/kdeconnect", QDBusConnection::sessionBus(), parent)
 {
 
 }
@@ -33,7 +38,7 @@ DaemonDbusInterface::~DaemonDbusInterface()
 }
 
 DeviceDbusInterface::DeviceDbusInterface(const QString& id, QObject* parent)
-    : OrgKdeKdeconnectDeviceInterface("org.kde.kdeconnect", "/modules/kdeconnect/devices/"+id, QDBusConnection::sessionBus(), parent)
+    : OrgKdeKdeconnectDeviceInterface(activatedService(), "/modules/kdeconnect/devices/"+id, QDBusConnection::sessionBus(), parent)
 {
 
 }
@@ -44,7 +49,7 @@ DeviceDbusInterface::~DeviceDbusInterface()
 }
 
 DeviceBatteryDbusInterface::DeviceBatteryDbusInterface(const QString& id, QObject* parent)
-    : OrgKdeKdeconnectDeviceBatteryInterface("org.kde.kdeconnect", "/modules/kdeconnect/devices/"+id, QDBusConnection::sessionBus(), parent)
+    : OrgKdeKdeconnectDeviceBatteryInterface(activatedService(), "/modules/kdeconnect/devices/"+id, QDBusConnection::sessionBus(), parent)
 {
 
 }
@@ -55,7 +60,7 @@ DeviceBatteryDbusInterface::~DeviceBatteryDbusInterface()
 }
 
 DeviceNotificationsDbusInterface::DeviceNotificationsDbusInterface(const QString& id, QObject* parent)
-    : OrgKdeKdeconnectDeviceNotificationsInterface("org.kde.kdeconnect", "/modules/kdeconnect/devices/"+id, QDBusConnection::sessionBus(), parent)
+    : OrgKdeKdeconnectDeviceNotificationsInterface(activatedService(), "/modules/kdeconnect/devices/"+id, QDBusConnection::sessionBus(), parent)
 {
 
 }
@@ -66,7 +71,7 @@ DeviceNotificationsDbusInterface::~DeviceNotificationsDbusInterface()
 }
 
 NotificationDbusInterface::NotificationDbusInterface(const QString& deviceId, const QString& notificationId, QObject* parent)
-    : OrgKdeKdeconnectDeviceNotificationsNotificationInterface("org.kde.kdeconnect", "/modules/kdeconnect/devices/"+deviceId+"/notifications/"+notificationId, QDBusConnection::sessionBus(), parent)
+    : OrgKdeKdeconnectDeviceNotificationsNotificationInterface(activatedService(), "/modules/kdeconnect/devices/"+deviceId+"/notifications/"+notificationId, QDBusConnection::sessionBus(), parent)
 {
 
 }
@@ -77,7 +82,7 @@ NotificationDbusInterface::~NotificationDbusInterface()
 }
 
 SftpDbusInterface::SftpDbusInterface(const QString& id, QObject* parent)
-    : OrgKdeKdeconnectDeviceSftpInterface("org.kde.kdeconnect", "/modules/kdeconnect/devices/" + id + "/sftp", QDBusConnection::sessionBus(), parent)
+    : OrgKdeKdeconnectDeviceSftpInterface(activatedService(), "/modules/kdeconnect/devices/" + id + "/sftp", QDBusConnection::sessionBus(), parent)
 {
 
 }
diff --git a/interfaces/dbusinterfaces.h b/interfaces/dbusinterfaces.h
index 702d6bb..8f49fe3 100644
--- a/interfaces/dbusinterfaces.h
+++ b/interfaces/dbusinterfaces.h
@@ -88,6 +88,4 @@ public:
     virtual ~SftpDbusInterface();
 };
 
-
-
-#endif // DEVICEINTERFACE_H
+#endif
diff --git a/kded/CMakeLists.txt b/kded/CMakeLists.txt
deleted file mode 100644
index 46d25a9..0000000
--- a/kded/CMakeLists.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-include_directories(${CMAKE_SOURCE_DIR})
-
-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::DBusAddons KF5::ConfigWidgets)
-
-set(NEW_DAEMON_STARTUP_DESC "WIP: Start kdeconnectd without kded")
-option(WITH_AUTOSTART NEW_DAEMON_STARTUP_DESC Off)
-add_feature_info(WITH_AUTOSTART WITH_AUTOSTART NEW_DAEMON_STARTUP_DESC)
-
-if (NOT WITH_AUTOSTART)
-    add_library(kded_kdeconnect MODULE kded.cpp)
-    target_link_libraries(kded_kdeconnect KF5::Service KF5::DBusAddons)
-    install(TARGETS kded_kdeconnect DESTINATION ${PLUGIN_INSTALL_DIR})
-    install(FILES kdeconnect.desktop DESTINATION ${SERVICES_INSTALL_DIR}/kded)
-else()
-    configure_file(kdeconnectd.desktop.cmake ${CMAKE_CURRENT_BINARY_DIR}/kdeconnectd.desktop)
-    install(FILES ${CMAKE_CURRENT_BINARY_DIR}/kdeconnectd.desktop DESTINATION ${AUTOSTART_INSTALL_DIR})
-endif()
-
-install(TARGETS kdeconnectd DESTINATION ${LIBEXEC_INSTALL_DIR})
-
-configure_file(org.kde.kdeconnect.service.in
-               ${CMAKE_CURRENT_BINARY_DIR}/org.kde.kdeconnect.service)
-
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.kde.kdeconnect.service
-    DESTINATION ${DBUS_SERVICES_INSTALL_DIR})
diff --git a/kded/config-kded.h.cmake b/kded/config-kded.h.cmake
deleted file mode 100644
index 10882b7..0000000
--- a/kded/config-kded.h.cmake
+++ /dev/null
@@ -1 +0,0 @@
-#define KDECONNECTD_BIN "${CMAKE_INSTALL_PREFIX}/${LIBEXEC_INSTALL_DIR}/kdeconnectd"
diff --git a/kded/kded.cpp b/kded/kded.cpp
deleted file mode 100644
index 0986974..0000000
--- a/kded/kded.cpp
+++ /dev/null
@@ -1,120 +0,0 @@
-/**
- * Copyright 2014 Yuri Samoilenko <kinnalru at gmail.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License or (at your option) version 3 or any later version
- * accepted by the membership of KDE e.V. (or its successor approved
- * by the membership of KDE e.V.), which shall act as a proxy
- * defined in Section 14 of version 3 of the license.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "kded.h"
-
-#include <QTimer>
-#include <QDebug>
-
-#include <KPluginFactory>
-
-#include "config-kded.h"
-
-K_PLUGIN_FACTORY(KdeConnectFactory, registerPlugin<Kded>();)
-
-Q_LOGGING_CATEGORY(KDECONNECT_KDED, "kdeconnect.kded")
-
-Kded::Kded(QObject *parent, const QList<QVariant>&)
-    : KDEDModule(parent)
-    , m_daemon(0)
-{
-    QMetaObject::invokeMethod(this, "start", Qt::QueuedConnection);
-    qDebug(KDECONNECT_KDED) << "kded_kdeconnect started";
-}
-
-Kded::~Kded()
-{
-    stop();
-    qDebug(KDECONNECT_KDED) << "kded_kdeconnect stopped";
-}
-
-void Kded::start()
-{
-    if (m_daemon) {
-        return;
-    }
-
-    const QString daemon = QStringLiteral(KDECONNECTD_BIN);
-    qDebug(KDECONNECT_KDED) << "Starting daemon " << daemon;
-    m_daemon = new QProcess(this);
-    connect(m_daemon, SIGNAL(started()), SLOT(daemonStarted()));
-    connect(m_daemon, SIGNAL(error(QProcess::ProcessError)), this, SLOT(onError(QProcess::ProcessError)));
-    connect(m_daemon, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(onFinished(int,QProcess::ExitStatus)));
-    connect(m_daemon, SIGNAL(finished(int,QProcess::ExitStatus)), m_daemon, SLOT(deleteLater()));
-
-    m_daemon->setProgram(daemon);
-    m_daemon->closeReadChannel(QProcess::StandardOutput);
-    m_daemon->start();
-}
-
-void Kded::stop()
-{
-    if (!m_daemon) {
-        return;
-    }
-
-    m_daemon->terminate();
-    m_daemon->setProperty("terminate", true);
-    QTimer::singleShot(10000, this, SLOT(checkIfDaemonTerminated()));
-}
-
-void Kded::restart()
-{
-    stop();
-    return start();
-}
-
-void Kded::onError(QProcess::ProcessError errorCode)
-{
-    qCWarning(KDECONNECT_KDED) << "Process error code=" << errorCode;
-}
-
-void Kded::daemonStarted()
-{
-    qDebug(KDECONNECT_KDED) << "Daemon successfuly started";
-    Q_EMIT started();
-}
-
-void Kded::onFinished(int exitCode, QProcess::ExitStatus status)
-{
-    if (status == QProcess::CrashExit) {
-        qCWarning(KDECONNECT_KDED) << "Process crashed with code=" << exitCode;
-        qCWarning(KDECONNECT_KDED) << m_daemon->readAllStandardError();
-        qCWarning(KDECONNECT_KDED) << "Restarting in 5 sec...";
-        QTimer::singleShot(5000, this, SLOT(start()));        
-    } else {
-        qCWarning(KDECONNECT_KDED) << "Process finished with code=" << exitCode;
-    }
-
-    Q_EMIT stopped();
-    m_daemon = 0;
-}
-
-void Kded::checkIfDaemonTerminated()
-{
-    if (!m_daemon || !m_daemon->property("terminate").isValid()) {
-        return;
-    }
-
-    m_daemon->kill();
-    qCWarning(KDECONNECT_KDED) << "Daemon  killed";
-}
-
-#include "kded.moc"
diff --git a/kded/kded.h b/kded/kded.h
deleted file mode 100644
index 5d2fe3b..0000000
--- a/kded/kded.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/**
- * Copyright 2014 Yuri Samoilenko <kinnalru at gmail.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License or (at your option) version 3 or any later version
- * accepted by the membership of KDE e.V. (or its successor approved
- * by the membership of KDE e.V.), which shall act as a proxy
- * defined in Section 14 of version 3 of the license.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef KDECONNECT_KDED_H
-#define KDECONNECT_KDED_H
-
-#include <KDEDModule>
-#include <QProcess>
-
-#include <QLoggingCategory>
-
-class Kded
-    : public KDEDModule
-{
-    Q_OBJECT
-    Q_CLASSINFO("D-Bus Interface", "org.kde.kded.kdeconnect")
-
-public:
-    Kded(QObject *parent, const QList<QVariant>&);
-    ~Kded();
-
-public Q_SLOTS:
-
-    Q_SCRIPTABLE void start();
-    Q_SCRIPTABLE void stop();
-    Q_SCRIPTABLE void restart();
-
-Q_SIGNALS:
-    Q_SCRIPTABLE void started();
-    Q_SCRIPTABLE void stopped();
-
-private Q_SLOTS:
-    void onError(QProcess::ProcessError);
-    void onFinished(int, QProcess::ExitStatus);
-    void daemonStarted();
-    void checkIfDaemonTerminated();
-
-private:
-    QProcess* m_daemon;
-};
-
-Q_DECLARE_LOGGING_CATEGORY(KDECONNECT_KDED)
-#endif

-- 
kdeconnect packaging



More information about the pkg-kde-commits mailing list