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

Maximiliano Curia maxy at moszumanska.debian.org
Fri Oct 14 14:29:26 UTC 2016


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

The following commit has been merged in the master branch:
commit 42110549f48994fa7b6070660ef4fc99f862a400
Author: Aleix Pol <aleixpol at kde.org>
Date:   Mon Dec 7 03:27:40 2015 +0100

    Improve SharePlugin share notification method
    
    Make the share received notification explicitly internal.
    Fix runtime warning about how QUrl cannot be exported.
    Notify about all shares, not exclusively transferred files.
---
 plugins/share/shareplugin.cpp | 10 +++++++---
 plugins/share/shareplugin.h   |  2 +-
 tests/sendfiletest.cpp        |  4 ++--
 3 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/plugins/share/shareplugin.cpp b/plugins/share/shareplugin.cpp
index 44e52e2..ecefba4 100644
--- a/plugins/share/shareplugin.cpp
+++ b/plugins/share/shareplugin.cpp
@@ -114,11 +114,15 @@ bool SharePlugin::receivePackage(const NetworkPackage& np)
             tmpFile.open();
             tmpFile.write(text.toUtf8());
             tmpFile.close();
-            QDesktopServices::openUrl(QUrl::fromLocalFile(tmpFile.fileName()));
+
+            const QUrl url = QUrl::fromLocalFile(tmpFile.fileName());
+            Q_EMIT shareReceived(url);
+            QDesktopServices::openUrl(url);
         }
     } else if (np.has("url")) {
         QUrl url = QUrl::fromEncoded(np.get<QByteArray>("url"));
         QDesktopServices::openUrl(url);
+        Q_EMIT shareReceived(url);
     } else {
         qCDebug(KDECONNECT_PLUGIN_SHARE) << "Error: Nothing attached!";
     }
@@ -131,7 +135,7 @@ void SharePlugin::finished(KJob* job)
 {
     FileTransferJob* ftjob = qobject_cast<FileTransferJob*>(job);
     if (ftjob)
-        fileReceived(ftjob->destination());
+        Q_EMIT shareReceived(ftjob->destination());
 
     qCDebug(KDECONNECT_PLUGIN_SHARE) << "File transfer finished. Success:" << (!job->error()) << (ftjob ? ftjob->destination() : QUrl());
 }
@@ -156,7 +160,7 @@ void SharePlugin::shareUrl(const QUrl& url)
 
 void SharePlugin::connected()
 {
-    QDBusConnection::sessionBus().registerObject(dbusPath(), this, QDBusConnection::ExportAllContents);
+    QDBusConnection::sessionBus().registerObject(dbusPath(), this, QDBusConnection::ExportScriptableContents);
 }
 
 QString SharePlugin::dbusPath() const
diff --git a/plugins/share/shareplugin.h b/plugins/share/shareplugin.h
index 13b012b..4149e21 100644
--- a/plugins/share/shareplugin.h
+++ b/plugins/share/shareplugin.h
@@ -48,7 +48,7 @@ private Q_SLOTS:
     void openDestinationFolder();
 
 Q_SIGNALS:
-    void fileReceived(const QUrl& url);
+    void shareReceived(const QUrl& url);
 
 private:
     void shareUrl(const QUrl& url);
diff --git a/tests/sendfiletest.cpp b/tests/sendfiletest.cpp
index 015818b..4a40018 100644
--- a/tests/sendfiletest.cpp
+++ b/tests/sendfiletest.cpp
@@ -97,11 +97,11 @@ class TestSendFile : public QObject
             QVERIFY(plugin);
             plugin->metaObject()->invokeMethod(plugin, "shareUrl", Q_ARG(QString, QUrl::fromLocalFile(temp.fileName()).toString()));
 
-            QSignalSpy spy(plugin, SIGNAL(fileReceived(QUrl)));
+            QSignalSpy spy(plugin, SIGNAL(shareReceived(QUrl)));
             QVERIFY(spy.wait(2000));
 
             QVariantList args = spy.takeFirst();
-            QUrl sentFile = args.first().toUrl();
+            QUrl sentFile(args.first().toUrl());
 
             QFile file(sentFile.toLocalFile());
             QCOMPARE(file.size(), content.size());

-- 
kdeconnect packaging



More information about the pkg-kde-commits mailing list