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

Maximiliano Curia maxy at moszumanska.debian.org
Fri Oct 14 14:27:02 UTC 2016


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

The following commit has been merged in the master branch:
commit e20adde7fd8f9cc0db7a0413ab01f28a5f319d65
Author: Albert Vaca <albertvaka at gmail.com>
Date:   Tue Sep 24 14:10:25 2013 +0200

    Moved filetransferjob from filetransfer plugin to networkpackage
---
 kded/CMakeLists.txt                                 | 1 +
 kded/{plugins/filetransfer => }/filetransferjob.cpp | 0
 kded/{plugins/filetransfer => }/filetransferjob.h   | 0
 kded/networkpackage.cpp                             | 7 +++++++
 kded/networkpackage.h                               | 5 +++++
 kded/plugins/battery/CMakeLists.txt                 | 2 ++
 kded/plugins/clipboard/CMakeLists.txt               | 2 ++
 kded/plugins/filetransfer/CMakeLists.txt            | 2 +-
 kded/plugins/filetransfer/filetransferplugin.cpp    | 7 +++----
 kded/plugins/mpriscontrol/CMakeLists.txt            | 2 ++
 kded/plugins/notifications/CMakeLists.txt           | 2 ++
 11 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/kded/CMakeLists.txt b/kded/CMakeLists.txt
index c6ecb26..53ad3e0 100644
--- a/kded/CMakeLists.txt
+++ b/kded/CMakeLists.txt
@@ -22,6 +22,7 @@ set(kded_kdeconnect_SRCS
     plugins/pluginloader.cpp
 
     networkpackage.cpp
+    filetransferjob.cpp
     daemon.cpp
     device.cpp
 )
diff --git a/kded/plugins/filetransfer/filetransferjob.cpp b/kded/filetransferjob.cpp
similarity index 100%
rename from kded/plugins/filetransfer/filetransferjob.cpp
rename to kded/filetransferjob.cpp
diff --git a/kded/plugins/filetransfer/filetransferjob.h b/kded/filetransferjob.h
similarity index 100%
rename from kded/plugins/filetransfer/filetransferjob.h
rename to kded/filetransferjob.h
diff --git a/kded/networkpackage.cpp b/kded/networkpackage.cpp
index 2f20220..86b691e 100644
--- a/kded/networkpackage.cpp
+++ b/kded/networkpackage.cpp
@@ -33,6 +33,8 @@
 #include <qjson/serializer.h>
 #include <qjson/qobjecthelper.h>
 
+#include "filetransferjob.h"
+
 const QCA::EncryptionAlgorithm NetworkPackage::EncryptionAlgorithm = QCA::EME_PKCS1v15;
 const int NetworkPackage::ProtocolVersion = 5;
 
@@ -172,3 +174,8 @@ bool NetworkPackage::decrypt(QCA::PrivateKey& key, NetworkPackage* out) const
 
 }
 
+FileTransferJob* NetworkPackage::createPayloadTransferJob(const KUrl& destination) const
+{
+    return new FileTransferJob(payload(), payloadSize(), destination);
+}
+
diff --git a/kded/networkpackage.h b/kded/networkpackage.h
index 61e8330..37433ec 100644
--- a/kded/networkpackage.h
+++ b/kded/networkpackage.h
@@ -23,6 +23,8 @@
 
 #include "networkpackagetypes.h"
 
+#include <KUrl>
+
 #include <QObject>
 #include <QDebug>
 #include <QString>
@@ -35,6 +37,8 @@
 
 #include "default_args.h"
 
+class FileTransferJob;
+
 class NetworkPackage : public QObject
 {
     Q_OBJECT
@@ -74,6 +78,7 @@ public:
     void setPayload(QIODevice* device, int payloadSize) { mPayload = device; mPayloadSize = payloadSize; Q_ASSERT(mPayloadSize >= -1); }
     bool hasPayload() const { return (mPayloadSize != 0); }
     int payloadSize() const { return mPayloadSize; } //-1 means it is an endless stream
+    FileTransferJob* createPayloadTransferJob(const KUrl& destination) const;
 
     //To be called by a particular DeviceLink
     QVariantMap payloadTransferInfo() const { return mPayloadTransferInfo; }
diff --git a/kded/plugins/battery/CMakeLists.txt b/kded/plugins/battery/CMakeLists.txt
index 405bdce..e38fec2 100644
--- a/kded/plugins/battery/CMakeLists.txt
+++ b/kded/plugins/battery/CMakeLists.txt
@@ -16,6 +16,7 @@ set(kdeconnect_battery_SRCS
     ../kdeconnectplugin.cpp
     ../pluginloader.cpp
     ../../networkpackage.cpp
+    ../../filetransferjob.cpp
     ../../device.cpp
 )
 
@@ -24,6 +25,7 @@ kde4_add_plugin(kdeconnect_battery ${kdeconnect_battery_SRCS})
 target_link_libraries(kdeconnect_battery
     ${KDE4_KDECORE_LIBS}
     ${KDE4_KDEUI_LIBS}
+    ${KDE4_KIO_LIBS}
     ${QT_QTNETWORK_LIBRARY}
     ${QJSON_LIBRARIES}
     ${QCA2_LIBRARIES}
diff --git a/kded/plugins/clipboard/CMakeLists.txt b/kded/plugins/clipboard/CMakeLists.txt
index 3309097..9cf8179 100644
--- a/kded/plugins/clipboard/CMakeLists.txt
+++ b/kded/plugins/clipboard/CMakeLists.txt
@@ -15,6 +15,7 @@ set(kdeconnect_clipboard_SRCS
     ../kdeconnectplugin.cpp
     ../pluginloader.cpp
     ../../networkpackage.cpp
+    ../../filetransferjob.cpp
     ../../device.cpp
 )
 
@@ -23,6 +24,7 @@ kde4_add_plugin(kdeconnect_clipboard ${kdeconnect_clipboard_SRCS})
 target_link_libraries(kdeconnect_clipboard
     ${KDE4_KDECORE_LIBS}
     ${KDE4_KDEUI_LIBS}
+    ${KDE4_KIO_LIBS}
     ${QT_QTNETWORK_LIBRARY}
     ${QJSON_LIBRARIES}
     ${QCA2_LIBRARIES}
diff --git a/kded/plugins/filetransfer/CMakeLists.txt b/kded/plugins/filetransfer/CMakeLists.txt
index f75b4a1..58370f6 100644
--- a/kded/plugins/filetransfer/CMakeLists.txt
+++ b/kded/plugins/filetransfer/CMakeLists.txt
@@ -13,10 +13,10 @@ include_directories(${KDE4_INCLUDES})
 
 set(kdeconnect_filetransfer_SRCS
     filetransferplugin.cpp
-    filetransferjob.cpp
     autoclosingqfile.cpp
     ../kdeconnectplugin.cpp
     ../pluginloader.cpp
+    ../../filetransferjob.cpp
     ../../networkpackage.cpp
     ../../device.cpp
 )
diff --git a/kded/plugins/filetransfer/filetransferplugin.cpp b/kded/plugins/filetransfer/filetransferplugin.cpp
index 7533f73..088d7c5 100644
--- a/kded/plugins/filetransfer/filetransferplugin.cpp
+++ b/kded/plugins/filetransfer/filetransferplugin.cpp
@@ -28,7 +28,7 @@
 #include <QFile>
 #include <QDesktopServices>
 
-#include "filetransferjob.h"
+#include "../../filetransferjob.h"
 #include "autoclosingqfile.h"
 
 K_PLUGIN_FACTORY( KdeConnectPluginFactory, registerPlugin< FileTransferPlugin >(); )
@@ -70,9 +70,8 @@ bool FileTransferPlugin::receivePackage(const NetworkPackage& np)
     if (np.hasPayload()) {
         qDebug() << "receiving file";
         QString filename = np.get<QString>("filename", mDestinationDir + QString::number(QDateTime::currentMSecsSinceEpoch()));
-        QIODevice* incoming = np.payload();
-        FileTransferJob* job = new FileTransferJob(incoming, np.payloadSize(), filename);
-        connect(job,SIGNAL(result(KJob*)), this, SLOT(finished(KJob*)));
+        FileTransferJob* job = np.createPayloadTransferJob(filename);
+        connect(job, SIGNAL(result(KJob*)), this, SLOT(finished(KJob*)));
         job->start();
     }
 
diff --git a/kded/plugins/mpriscontrol/CMakeLists.txt b/kded/plugins/mpriscontrol/CMakeLists.txt
index 03a0b0b..04965f6 100644
--- a/kded/plugins/mpriscontrol/CMakeLists.txt
+++ b/kded/plugins/mpriscontrol/CMakeLists.txt
@@ -15,6 +15,7 @@ set(kdeconnect_mpriscontrol_SRCS
     ../kdeconnectplugin.cpp
     ../pluginloader.cpp
     ../../networkpackage.cpp
+    ../../filetransferjob.cpp
     ../../device.cpp
 )
 
@@ -35,6 +36,7 @@ kde4_add_plugin(kdeconnect_mpriscontrol ${kdeconnect_mpriscontrol_SRCS})
 target_link_libraries(kdeconnect_mpriscontrol
     ${KDE4_KDECORE_LIBS}
     ${KDE4_KDEUI_LIBS}
+    ${KDE4_KIO_LIBS}
     ${QT_QTNETWORK_LIBRARY}
     ${QJSON_LIBRARIES}
     ${QCA2_LIBRARIES}
diff --git a/kded/plugins/notifications/CMakeLists.txt b/kded/plugins/notifications/CMakeLists.txt
index c7f4afa..37bf9dd 100644
--- a/kded/plugins/notifications/CMakeLists.txt
+++ b/kded/plugins/notifications/CMakeLists.txt
@@ -17,6 +17,7 @@ set(kdeconnect_notifications_SRCS
     ../kdeconnectplugin.cpp
     ../pluginloader.cpp
     ../../networkpackage.cpp
+    ../../filetransferjob.cpp
     ../../device.cpp
 )
 
@@ -25,6 +26,7 @@ kde4_add_plugin(kdeconnect_notifications ${kdeconnect_notifications_SRCS})
 target_link_libraries(kdeconnect_notifications
     ${KDE4_KDECORE_LIBS}
     ${KDE4_KDEUI_LIBS}
+    ${KDE4_KIO_LIBS}
     ${QT_QTNETWORK_LIBRARY}
     ${QJSON_LIBRARIES}
     ${QCA2_LIBRARIES}

-- 
kdeconnect packaging



More information about the pkg-kde-commits mailing list