[SCM] kdeconnect packaging branch, master, updated. debian/0.9g-1-1183-g9d69498
Maximiliano Curia
maxy at moszumanska.debian.org
Fri Oct 14 14:29:51 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/kdeconnect.git;a=commitdiff;h=e634952
The following commit has been merged in the master branch:
commit e6349524bcf77e136d6d4878366558f555423abc
Author: Aleix Pol <aleixpol at kde.org>
Date: Sat Jun 18 13:23:41 2016 +0200
Move all Telepathy bits into a Telepathy plugin
---
CMakeLists.txt | 2 -
plugins/CMakeLists.txt | 3 ++
plugins/telepathy/CMakeLists.txt | 18 +++++++
plugins/telepathy/kdeconnect_telepathy.json | 27 ++++++++++
.../telepathy/telepathy-cm}/CMakeLists.txt | 0
.../telepathy/telepathy-cm}/README | 0
.../telepathy/telepathy-cm}/connection.cpp | 0
.../telepathy/telepathy-cm}/connection.h | 0
.../telepathy/telepathy-cm}/kdeconnect.manager | 0
.../kdeconnecttelepathyprotocolfactory.cpp | 0
.../kdeconnecttelepathyprotocolfactory.h | 0
.../telepathy/telepathy-cm}/main.cpp | 0
.../telepathy/telepathy-cm}/protocol.cpp | 0
.../telepathy/telepathy-cm}/protocol.h | 0
.../telepathy/telepathy-cm}/textchannel.cpp | 0
.../telepathy/telepathy-cm}/textchannel.h | 0
plugins/telepathy/telepathyplugin.cpp | 63 ++++++++++++++++++++++
.../telepathyplugin.h} | 8 ++-
plugins/telephony/CMakeLists.txt | 10 +---
plugins/telephony/telephonyplugin.cpp | 10 ----
plugins/telephony/telephonyplugin.h | 2 -
21 files changed, 115 insertions(+), 28 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4efde15..7604b33 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -36,8 +36,6 @@ add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
include(GenerateExportHeader)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
-add_subdirectory(telepathy-cm)
-
add_subdirectory(core)
add_subdirectory(kcm)
add_subdirectory(kcmplugin)
diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt
index 88965df..03e8a43 100644
--- a/plugins/CMakeLists.txt
+++ b/plugins/CMakeLists.txt
@@ -24,6 +24,9 @@ if(EXPERIMENTALAPP_ENABLED)
add_subdirectory(remotecontrol)
add_subdirectory(lockdevice)
endif()
+if (TelepathyQt5_FOUND AND TelepathyQt5Service_FOUND)
+ add_subdirectory(telepathy)
+endif()
#FIXME: If we split notifications in several files, they won't appear in the same group in the Notifications KCM
install(FILES kdeconnect.notifyrc DESTINATION ${KNOTIFYRC_INSTALL_DIR})
diff --git a/plugins/telepathy/CMakeLists.txt b/plugins/telepathy/CMakeLists.txt
new file mode 100644
index 0000000..ee7f33c
--- /dev/null
+++ b/plugins/telepathy/CMakeLists.txt
@@ -0,0 +1,18 @@
+find_package(KF5 REQUIRED COMPONENTS Notifications)
+
+include_directories(${CMAKE_BINARY_DIR})
+
+add_subdirectory(telepathy-cm)
+
+qt5_generate_dbus_interface(${CMAKE_CURRENT_SOURCE_DIR}/telepathy-cm/protocol.h ${CMAKE_CURRENT_BINARY_DIR}/kdeconnectinterface.xml)
+qt5_add_dbus_interface(kdeconnect_telepathy_SRCS ${CMAKE_CURRENT_BINARY_DIR}/kdeconnectinterface.xml kdeconnectinterface)
+
+kdeconnect_add_plugin(kdeconnect_telepathy JSON kdeconnect_telepathy.json
+ SOURCES telepathyplugin.cpp ${kdeconnect_telepathy_SRCS})
+
+target_link_libraries(kdeconnect_telepathy
+ kdeconnectcore
+ KF5::I18n
+ KF5::Notifications
+ Qt5::DBus
+)
diff --git a/plugins/telepathy/kdeconnect_telepathy.json b/plugins/telepathy/kdeconnect_telepathy.json
new file mode 100644
index 0000000..dadd95b
--- /dev/null
+++ b/plugins/telepathy/kdeconnect_telepathy.json
@@ -0,0 +1,27 @@
+{
+ "Encoding": "UTF-8",
+ "KPlugin": {
+ "Authors": [
+ {
+ "Name": "David Edmundson",
+ "Email": "davidedmundson at kde.org",
+ }
+ ],
+ "Description": "Show notifications for calls and SMS (answering coming soon)",
+ "EnabledByDefault": true,
+ "Icon": "telepathy",
+ "Id": "kdeconnect_telepathy",
+ "License": "GPL",
+ "Name": "Telepathy service integration",
+ "ServiceTypes": [ "KdeConnect/Plugin" ],
+ "Version": "0.1",
+ "Website": "http://blog.davidedmundson.co.uk"
+ },
+ "X-KdeConnect-OutgoingPackageType": [
+ "kdeconnect.telephony.request",
+ "kdeconnect.sms.request"
+ ],
+ "X-KdeConnect-SupportedPackageType": [
+ "kdeconnect.telephony"
+ ]
+}
diff --git a/telepathy-cm/CMakeLists.txt b/plugins/telepathy/telepathy-cm/CMakeLists.txt
similarity index 100%
rename from telepathy-cm/CMakeLists.txt
rename to plugins/telepathy/telepathy-cm/CMakeLists.txt
diff --git a/telepathy-cm/README b/plugins/telepathy/telepathy-cm/README
similarity index 100%
rename from telepathy-cm/README
rename to plugins/telepathy/telepathy-cm/README
diff --git a/telepathy-cm/connection.cpp b/plugins/telepathy/telepathy-cm/connection.cpp
similarity index 100%
rename from telepathy-cm/connection.cpp
rename to plugins/telepathy/telepathy-cm/connection.cpp
diff --git a/telepathy-cm/connection.h b/plugins/telepathy/telepathy-cm/connection.h
similarity index 100%
rename from telepathy-cm/connection.h
rename to plugins/telepathy/telepathy-cm/connection.h
diff --git a/telepathy-cm/kdeconnect.manager b/plugins/telepathy/telepathy-cm/kdeconnect.manager
similarity index 100%
rename from telepathy-cm/kdeconnect.manager
rename to plugins/telepathy/telepathy-cm/kdeconnect.manager
diff --git a/telepathy-cm/kdeconnecttelepathyprotocolfactory.cpp b/plugins/telepathy/telepathy-cm/kdeconnecttelepathyprotocolfactory.cpp
similarity index 100%
rename from telepathy-cm/kdeconnecttelepathyprotocolfactory.cpp
rename to plugins/telepathy/telepathy-cm/kdeconnecttelepathyprotocolfactory.cpp
diff --git a/telepathy-cm/kdeconnecttelepathyprotocolfactory.h b/plugins/telepathy/telepathy-cm/kdeconnecttelepathyprotocolfactory.h
similarity index 100%
rename from telepathy-cm/kdeconnecttelepathyprotocolfactory.h
rename to plugins/telepathy/telepathy-cm/kdeconnecttelepathyprotocolfactory.h
diff --git a/telepathy-cm/main.cpp b/plugins/telepathy/telepathy-cm/main.cpp
similarity index 100%
rename from telepathy-cm/main.cpp
rename to plugins/telepathy/telepathy-cm/main.cpp
diff --git a/telepathy-cm/protocol.cpp b/plugins/telepathy/telepathy-cm/protocol.cpp
similarity index 100%
rename from telepathy-cm/protocol.cpp
rename to plugins/telepathy/telepathy-cm/protocol.cpp
diff --git a/telepathy-cm/protocol.h b/plugins/telepathy/telepathy-cm/protocol.h
similarity index 100%
rename from telepathy-cm/protocol.h
rename to plugins/telepathy/telepathy-cm/protocol.h
diff --git a/telepathy-cm/textchannel.cpp b/plugins/telepathy/telepathy-cm/textchannel.cpp
similarity index 100%
rename from telepathy-cm/textchannel.cpp
rename to plugins/telepathy/telepathy-cm/textchannel.cpp
diff --git a/telepathy-cm/textchannel.h b/plugins/telepathy/telepathy-cm/textchannel.h
similarity index 100%
rename from telepathy-cm/textchannel.h
rename to plugins/telepathy/telepathy-cm/textchannel.h
diff --git a/plugins/telepathy/telepathyplugin.cpp b/plugins/telepathy/telepathyplugin.cpp
new file mode 100644
index 0000000..ef4f0e1
--- /dev/null
+++ b/plugins/telepathy/telepathyplugin.cpp
@@ -0,0 +1,63 @@
+/**
+ * Copyright 2013 Albert Vaca <albertvaka 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 "telepathyplugin.h"
+
+#include <KLocalizedString>
+#include <QIcon>
+#include <QDebug>
+
+#include <KPluginFactory>
+
+K_PLUGIN_FACTORY_WITH_JSON( KdeConnectPluginFactory, "kdeconnect_telepathy.json", registerPlugin< TelepathyPlugin >(); )
+
+Q_LOGGING_CATEGORY(KDECONNECT_PLUGIN_TELEPHONY, "kdeconnect.plugin.telephony")
+
+TelepathyPlugin::TelepathyPlugin(QObject *parent, const QVariantList &args)
+ : KdeConnectPlugin(parent, args)
+ , m_telepathyInterface(new OrgFreedesktopTelepathyConnectionManagerKdeconnectInterface("org.freedesktop.Telepathy.ConnectionManager.kdeconnect", "/kdeconnect", QDBusConnection::sessionBus(), this))
+{
+ connect(m_telepathyInterface, SIGNAL(messageReceived(QString,QString)), SLOT(sendSms(QString,QString)));
+}
+
+bool TelepathyPlugin::receivePackage(const NetworkPackage& np)
+{
+ if (np.get<QString>("event") == QLatin1String("sms")) {
+ const QString messageBody = np.get<QString>("messageBody","");
+ const QString phoneNumber = np.get<QString>("phoneNumber", i18n("unknown number"));
+ const QString contactName = np.get<QString>("contactName", phoneNumber);
+ if (m_telepathyInterface->sendMessage(contactName, messageBody)) {
+ return true;
+ }
+ }
+
+ return true;
+}
+
+void TelepathyPlugin::sendSms(const QString& phoneNumber, const QString& messageBody)
+{
+ NetworkPackage np(PACKAGE_TYPE_SMS_REQUEST);
+ np.set("sendSms", true);
+ np.set("phoneNumber", phoneNumber);
+ np.set("messageBody", messageBody);
+ sendPackage(np);
+}
+
+#include "telepathyplugin.moc"
diff --git a/plugins/telephony/telephonyplugin.h b/plugins/telepathy/telepathyplugin.h
similarity index 90%
copy from plugins/telephony/telephonyplugin.h
copy to plugins/telepathy/telepathyplugin.h
index 58b9752..c8201f4 100644
--- a/plugins/telephony/telephonyplugin.h
+++ b/plugins/telepathy/telepathyplugin.h
@@ -33,22 +33,20 @@
Q_DECLARE_LOGGING_CATEGORY(KDECONNECT_PLUGIN_TELEPHONY)
-class TelephonyPlugin
+class TelepathyPlugin
: public KdeConnectPlugin
{
Q_OBJECT
public:
- explicit TelephonyPlugin(QObject *parent, const QVariantList &args);
+ explicit TelepathyPlugin(QObject *parent, const QVariantList &args);
+ void connected() override {}
public Q_SLOTS:
virtual bool receivePackage(const NetworkPackage& np) override;
- virtual void connected() override { }
- void sendMutePackage();
private Q_SLOTS:
void sendSms(const QString& phoneNumber, const QString& messageBody);
- void showSendSmsDialog();
private:
KNotification* createNotification(const NetworkPackage& np);
diff --git a/plugins/telephony/CMakeLists.txt b/plugins/telephony/CMakeLists.txt
index 583aa8f..52418e3 100644
--- a/plugins/telephony/CMakeLists.txt
+++ b/plugins/telephony/CMakeLists.txt
@@ -2,15 +2,7 @@ find_package(KF5 REQUIRED COMPONENTS Notifications)
include_directories(${CMAKE_BINARY_DIR})
-set(kdeconnect_telephony_SRCS
- telephonyplugin.cpp
- sendsmsdialog.cpp
-)
-
-qt5_generate_dbus_interface(${CMAKE_SOURCE_DIR}/telepathy-cm/protocol.h ${CMAKE_CURRENT_BINARY_DIR}/kdeconnectinterface.xml)
-qt5_add_dbus_interface(kdeconnect_telephony_SRCS ${CMAKE_CURRENT_BINARY_DIR}/kdeconnectinterface.xml kdeconnectinterface)
-
-kdeconnect_add_plugin(kdeconnect_telephony JSON kdeconnect_telephony.json SOURCES ${kdeconnect_telephony_SRCS})
+kdeconnect_add_plugin(kdeconnect_telephony JSON kdeconnect_telephony.json SOURCES telephonyplugin.cpp sendsmsdialog.cpp)
target_link_libraries(kdeconnect_telephony
kdeconnectcore
diff --git a/plugins/telephony/telephonyplugin.cpp b/plugins/telephony/telephonyplugin.cpp
index 5015c6c..84a3c30 100644
--- a/plugins/telephony/telephonyplugin.cpp
+++ b/plugins/telephony/telephonyplugin.cpp
@@ -34,9 +34,7 @@ Q_LOGGING_CATEGORY(KDECONNECT_PLUGIN_TELEPHONY, "kdeconnect.plugin.telephony")
TelephonyPlugin::TelephonyPlugin(QObject *parent, const QVariantList &args)
: KdeConnectPlugin(parent, args)
- , m_telepathyInterface(new OrgFreedesktopTelepathyConnectionManagerKdeconnectInterface("org.freedesktop.Telepathy.ConnectionManager.kdeconnect", "/kdeconnect", QDBusConnection::sessionBus(), this))
{
- connect(m_telepathyInterface, SIGNAL(messageReceived(QString,QString)), SLOT(sendSms(QString,QString)));
}
KNotification* TelephonyPlugin::createNotification(const NetworkPackage& np)
@@ -115,14 +113,6 @@ bool TelephonyPlugin::receivePackage(const NetworkPackage& np)
//TODO: Clear the old notification
return true;
}
- if (np.get<QString>("event") == QLatin1String("sms")) {
- const QString messageBody = np.get<QString>("messageBody","");
- const QString phoneNumber = np.get<QString>("phoneNumber", i18n("unknown number"));
- const QString contactName = np.get<QString>("contactName", phoneNumber);
- if (m_telepathyInterface->sendMessage(contactName, messageBody)) {
- return true;
- }
- }
KNotification* n = createNotification(np);
if (n != nullptr) n->sendEvent();
diff --git a/plugins/telephony/telephonyplugin.h b/plugins/telephony/telephonyplugin.h
index 58b9752..7992821 100644
--- a/plugins/telephony/telephonyplugin.h
+++ b/plugins/telephony/telephonyplugin.h
@@ -52,8 +52,6 @@ private Q_SLOTS:
private:
KNotification* createNotification(const NetworkPackage& np);
-
- OrgFreedesktopTelepathyConnectionManagerKdeconnectInterface* m_telepathyInterface;
};
#endif
--
kdeconnect packaging
More information about the pkg-kde-commits
mailing list