[SCM] kdeconnect packaging branch, master, updated. debian/0.9g-1-1183-g9d69498
Maximiliano Curia
maxy at moszumanska.debian.org
Fri Oct 14 14:29:23 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/kdeconnect.git;a=commitdiff;h=30d2dd9
The following commit has been merged in the master branch:
commit 30d2dd991b249118832382dd3564a7050efcc3de
Merge: 646196b3eb30f155750d8ef761f8f74caffc6e1e 949408119de85211e0ed396a5b9d91c367edba3f
Author: Albert Vaca <albertvaka at gmail.com>
Date: Mon Nov 30 03:40:07 2015 -0800
Merge branch 'master' into sslmaster
CMakeLists.txt | 16 ++-
README.md | 2 +-
app/org.kde.kdeconnect.app.desktop | 22 ++++
cli/kdeconnect-cli.cpp | 42 +++++-
core/backends/lan/downloadjob.cpp | 35 ++++-
core/backends/lan/downloadjob.h | 8 +-
core/backends/lan/netaddress.h | 37 ------
core/backends/lan/socketlinereader.cpp | 4 +-
core/backends/loopback/loopbackdevicelink.cpp | 5 +-
core/core_debug.h | 4 +-
core/daemon.cpp | 4 +-
core/daemon.h | 2 +-
core/device.cpp | 30 ++++-
core/device.h | 13 +-
core/filetransferjob.cpp | 13 +-
core/filetransferjob.h | 4 +-
core/kdeconnectconfig.cpp | 12 +-
core/kdeconnectconfig.h | 11 +-
core/kdeconnectpluginconfig.cpp | 12 ++
core/kdeconnectpluginconfig.h | 10 +-
daemon/CMakeLists.txt | 2 +-
daemon/kdeconnect.desktop | 4 +
daemon/kdeconnectd.desktop.cmake | 6 +
doc/CMakeLists.txt | 1 +
doc/index.docbook | 55 ++++++++
fileitemactionplugin/CMakeLists.txt | 6 +-
fileitemactionplugin/kdeconnectsendfile.desktop | 5 +
interfaces/CMakeLists.txt | 2 +
interfaces/dbusinterfaces.cpp | 11 ++
interfaces/dbusinterfaces.h | 14 ++
interfaces/devicessortproxymodel.cpp | 4 +-
interfaces/devicessortproxymodel.h | 2 +-
interfaces/notificationsmodel.cpp | 3 +-
interfaces/notificationsmodel.h | 2 +-
kcm/CMakeLists.txt | 2 +-
kcm/kcm.cpp | 41 +++---
kcm/kcm.h | 3 +
kcm/kcm.ui | 41 +++++-
kcm/kcm_kdeconnect.desktop | 15 ++-
...nect.desktop => org.kde.kdeconnect.kcm.desktop} | 20 +++
kcmplugin/CMakeLists.txt | 3 +-
kdeconnect.appdata.xml | 105 +++++++++++++++
kio/kiokdeconnect.h | 2 +-
...desktop => org.kde.kdeconnect.nonplasma.desktop | 26 ++++
.../kdeconnectdeclarativeplugin.cpp | 21 ++-
plasmoid/declarativeplugin/objectfactory.h | 8 +-
plasmoid/declarativeplugin/responsewaiter.cpp | 4 +-
plasmoid/declarativeplugin/responsewaiter.h | 4 +-
plasmoid/package/contents/ui/DeviceDelegate.qml | 28 +++-
.../contents/ui/{Sftp.qml => FindMyPhone.qml} | 15 ++-
plasmoid/package/metadata.desktop | 10 +-
plugins/CMakeLists.txt | 3 +
plugins/battery/kdeconnect_battery.json | 7 +
plugins/clipboard/kdeconnect_clipboard.json | 7 +
plugins/findmyphone/CMakeLists.txt | 9 ++
.../findmyphoneplugin.cpp} | 49 +++----
.../findmyphoneplugin.h} | 21 ++-
plugins/findmyphone/kdeconnect_findmyphone.json | 71 +++++++++++
plugins/kdeconnect.notifyrc | 92 +++++++++++--
plugins/kdeconnect_plugin.desktop | 4 +-
plugins/lockdevice/kdeconnect_lockdevice.json | 9 ++
plugins/mousepad/kdeconnect_mousepad.json | 10 +-
plugins/mpriscontrol/kdeconnect_mpriscontrol.json | 7 +
plugins/mpriscontrol/mpriscontrolplugin.cpp | 13 +-
plugins/mprisremote/kdeconnect_mprisremote.json | 10 ++
.../notifications/kdeconnect_notifications.json | 8 ++
plugins/notifications/notification.cpp | 4 +-
plugins/notifications/notification.h | 6 +-
.../notifications/notificationsdbusinterface.cpp | 8 +-
plugins/notifications/notificationsdbusinterface.h | 2 +-
plugins/pausemusic/kdeconnect_pausemusic.json | 8 ++
.../kdeconnect_pausemusic_config.desktop | 3 +
plugins/ping/kdeconnect_ping.json | 8 ++
.../remotecontrol/kdeconnect_remotecontrol.json | 9 ++
plugins/runcommand/CMakeLists.txt | 26 ++++
plugins/runcommand/kdeconnect_runcommand.json | 75 +++++++++++
.../kdeconnect_runcommand_config.desktop | 33 +++++
plugins/runcommand/runcommand_config.cpp | 142 +++++++++++++++++++++
.../runcommand_config.h} | 24 ++--
plugins/runcommand/runcommandplugin.cpp | 94 ++++++++++++++
.../runcommandplugin.h} | 36 +++---
.../kdeconnect_screensaver_inhibit.json | 8 ++
.../screensaverinhibitplugin.cpp | 2 +-
plugins/sftp/CMakeLists.txt | 1 -
plugins/sftp/kdeconnect_sftp.json | 8 ++
plugins/sftp/mounter.cpp | 55 ++++----
plugins/sftp/mounter.h | 5 +-
plugins/share/kdeconnect_share.json | 8 ++
plugins/share/kdeconnect_share_config.desktop | 3 +
plugins/share/shareplugin.cpp | 2 +-
plugins/telephony/CMakeLists.txt | 2 +-
plugins/telephony/kdeconnect_telephony.json | 8 ++
telepathy-cm/connection.cpp | 2 +-
tests/CMakeLists.txt | 3 +
tests/downloadjobtest.cpp | 107 ++++++++++++++++
tests/pluginloadtest.cpp | 5 +
96 files changed, 1474 insertions(+), 294 deletions(-)
diff --cc core/backends/lan/downloadjob.cpp
index f3e0276,b51ff6c..fd10103
--- a/core/backends/lan/downloadjob.cpp
+++ b/core/backends/lan/downloadjob.cpp
@@@ -18,47 -18,49 +18,69 @@@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <kdeconnectconfig.h>
#include "downloadjob.h"
- DownloadJob::DownloadJob(QHostAddress address, QVariantMap transferInfo): KJob()
+ #include <core/core_debug.h>
+
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ #include <netinet/tcp.h>
+ #include <netdb.h>
+
+ #include "lanlinkprovider.h"
+
+ DownloadJob::DownloadJob(const QHostAddress &address, const QVariantMap &transferInfo): KJob()
{
mAddress = address;
mPort = transferInfo["port"].toInt();
- mSocket = QSharedPointer<QTcpSocket>(new QTcpSocket());
+ mSocket = QSharedPointer<QSslSocket>(new QSslSocket);
+ useSsl = transferInfo.value("useSsl", false).toBool();
+
+ // Setting ssl related properties for socket when using ssl
+ if (useSsl) {
+ mSocket->setLocalCertificate(KdeConnectConfig::instance()->certificate());
+ mSocket->setPrivateKey(KdeConnectConfig::instance()->privateKeyPath());
+ mSocket->setProtocol(QSsl::TlsV1_2);
+ mSocket->setPeerVerifyName(transferInfo.value("deviceId").toString());
+ mSocket->setPeerVerifyMode(QSslSocket::VerifyPeer);
+ mSocket->addCaCertificate(QSslCertificate(KdeConnectConfig::instance()->getTrustedDevice(
+ transferInfo.value("deviceId").toString()).certificate.toLatin1()));
+ }
}
+ DownloadJob::~DownloadJob()
+ {
++
+ }
+
void DownloadJob::start()
{
- //kDebug(kdeconnect_kded()) << "DownloadJob Start";
+ //TODO: Timeout?
+ connect(mSocket.data(), &QAbstractSocket::disconnected, this, &DownloadJob::done);
+ connect(mSocket.data(), SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(done()));
+ //connect(mSocket.data(), &QAbstractSocket::connected, [=](){ qDebug() << "Connected"; });
+
- mSocket->connectToHost(mAddress, mPort, QIODevice::ReadOnly);
+ if (useSsl) {
+ // Cannot use read only, might be due to ssl handshake, getting QIODevice::ReadOnly error and no connection
+ mSocket->connectToHostEncrypted(mAddress.toString(), mPort, QIODevice::ReadWrite);
+ mSocket->waitForEncrypted();
+ } else {
+ mSocket->connectToHost(mAddress, mPort, QIODevice::ReadOnly);
+ mSocket->waitForConnected();
+ }
- connect(mSocket.data(), SIGNAL(disconnected()),
- this, SLOT(disconnected()));
+
+ //mSocket->open(QIODevice::ReadOnly);
+
- //TODO: Implement payload encryption somehow (create an intermediate iodevice to encrypt the payload here?)
}
- void DownloadJob::disconnected()
+ void DownloadJob::done()
{
- //kDebug(kdeconnect_kded()) << "DownloadJob End";
+ if (mSocket->error()) {
+ qWarning(KDECONNECT_CORE) << mSocket->errorString();
+ }
emitResult();
+ deleteLater();
}
QSharedPointer<QIODevice> DownloadJob::getPayload()
diff --cc core/backends/lan/downloadjob.h
index bd1d02f,ddc9c93..54ad86a
--- a/core/backends/lan/downloadjob.h
+++ b/core/backends/lan/downloadjob.h
@@@ -40,14 -40,12 +41,13 @@@ public
QSharedPointer<QIODevice> getPayload();
private:
+ bool useSsl;
QHostAddress mAddress;
qint16 mPort;
- QSharedPointer<QTcpSocket> mSocket;
+ QSharedPointer<QSslSocket> mSocket;
-
private Q_SLOTS:
- void disconnected();
+ void done();
};
diff --cc core/device.h
index 82ecd29,e692c44..c39c224
--- a/core/device.h
+++ b/core/device.h
@@@ -26,11 -26,11 +26,12 @@@
#include <QVector>
#include <QSet>
#include <QSslKey>
-#include <QTimer>
#include <QtCrypto>
+#include <QSslCertificate>
+#include <QTimer>
#include "networkpackage.h"
+ #include "backends/devicelink.h"
class DeviceLink;
class KdeConnectPlugin;
@@@ -49,8 -48,11 +50,9 @@@ class KDECONNECTCORE_EXPORT Devic
Q_PROPERTY(bool isPaired READ isPaired NOTIFY pairingChanged)
Q_PROPERTY(QStringList unsupportedPlugins READ unsupportedPlugins NOTIFY pluginsChanged)
+ public:
enum PairStatus {
NotPaired,
- Requested,
- RequestedByPeer,
Paired,
};
@@@ -147,8 -139,14 +150,11 @@@ Q_SIGNALS
QT_DEPRECATED Q_SCRIPTABLE void unpaired();
private: //Methods
+ static DeviceType str2type(const QString &deviceType);
+ static QString type2str(DeviceType deviceType);
+
void setName(const QString &name);
QString iconForStatus(bool reachable, bool paired) const;
- void unpairInternal();
- void setAsPaired();
- bool sendOwnPublicKey();
private: //Fields (TODO: dPointer!)
const QString m_deviceId;
diff --cc core/kdeconnectconfig.cpp
index 8804353,7ad040d..ce62d5f
--- a/core/kdeconnectconfig.cpp
+++ b/core/kdeconnectconfig.cpp
@@@ -216,7 -171,7 +216,8 @@@ QStringList KdeConnectConfig::trustedDe
return list;
}
- void KdeConnectConfig::addTrustedDevice(QString id, QString name, QString type)
++
+ void KdeConnectConfig::addTrustedDevice(const QString &id, const QString &name, const QString &type, const QString &publicKey)
{
d->config->beginGroup("trustedDevices");
d->config->beginGroup(id);
@@@ -256,30 -211,7 +258,30 @@@ void KdeConnectConfig::removeTrustedDev
//We do not remove the config files.
}
+// Utility functions to set and get a value
+void KdeConnectConfig::setDeviceProperty(QString deviceId, QString key, QString value)
+{
+ d->config->beginGroup("trustedDevices");
+ d->config->beginGroup(deviceId);
+ d->config->setValue(key, value);
+ d->config->endGroup();
+ d->config->endGroup();
+ d->config->sync();
+}
+
+QString KdeConnectConfig::getDeviceProperty(QString deviceId, QString key, QString defaultValue)
+{
+ QString value;
+ d->config->beginGroup("trustedDevices");
+ d->config->beginGroup(deviceId);
+ value = d->config->value(key, defaultValue).toString();
+ d->config->endGroup();
+ d->config->endGroup();
+ return value;
+}
+
+
- QDir KdeConnectConfig::deviceConfigDir(QString deviceId)
+ QDir KdeConnectConfig::deviceConfigDir(const QString &deviceId)
{
QString deviceConfigPath = baseConfigDir().absoluteFilePath(deviceId);
return QDir(deviceConfigPath);
diff --cc core/kdeconnectconfig.h
index c20d97c,76e25a4..8666eb2
--- a/core/kdeconnectconfig.h
+++ b/core/kdeconnectconfig.h
@@@ -61,12 -56,10 +61,13 @@@ public
*/
QStringList trustedDevices(); //list of ids
- void removeTrustedDevice(QString id);
- void addTrustedDevice(QString id, QString name, QString type);
- KdeConnectConfig::DeviceInfo getTrustedDevice(QString id);
+ void removeTrustedDevice(const QString &id);
+ void addTrustedDevice(const QString &id, const QString &name, const QString &type, const QString &publicKey);
+ KdeConnectConfig::DeviceInfo getTrustedDevice(const QString &id);
+ void setDeviceProperty(QString deviceId, QString name, QString value);
+ QString getDeviceProperty(QString deviceId, QString name, QString defaultValue = QString());
+
+
/*
* Paths for config files, there is no guarantee the directories already exist
*/
diff --cc tests/CMakeLists.txt
index 927cddb,d585d2b..f82e85d
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@@ -19,36 -17,5 +19,39 @@@ set(kdeconnect_librarie
ecm_add_test(pluginloadtest.cpp LINK_LIBRARIES ${kdeconnect_libraries})
ecm_add_test(sendfiletest.cpp LINK_LIBRARIES ${kdeconnect_libraries})
ecm_add_test(networkpackagetests.cpp LINK_LIBRARIES ${kdeconnect_libraries})
-ecm_add_test(testsocketlinereader.cpp ../core/backends/lan/socketlinereader.cpp TEST_NAME testsocketlinereader LINK_LIBRARIES ${kdeconnect_libraries})
-ecm_add_test(downloadjobtest.cpp ../core/backends/lan/downloadjob.cpp TEST_NAME downloadjobtest LINK_LIBRARIES ${kdeconnect_libraries})
++
+ecm_add_test(testsocketlinereader.cpp ../core/backends/lan/socketlinereader.cpp ../core/backends/lan/server.cpp TEST_NAME testsocketlinereader LINK_LIBRARIES ${kdeconnect_libraries})
+
+set(testsslsocketlinereader_sources
+ ../core/backends/lan/server.cpp
+ ../core/backends/lan/socketlinereader.cpp
+)
+ecm_add_test(testsslsocketlinereader.cpp ${testsslsocketlinereader_sources} TEST_NAME testsslsocketlinereader LINK_LIBRARIES ${kdeconnect_libraries})
+
+set(kdeconnectconfigtest_sources
+ ../core/backends/pairinghandler.cpp
+ ../core/dbushelper.cpp
+ ../core/device.cpp
+ ../core/pluginloader.cpp
+)
+ecm_add_test(kdeconnectconfigtest.cpp ${kdeconnectconfigtest_sources} TEST_NAME kdeconnectconfgtest LINK_LIBRARIES ${kdeconnect_libraries})
+
+set(lanlinkprovidertest_sources
+ ../core/backends/devicelink.cpp
+ ../core/backends/lan/downloadjob.cpp
+ ../core/backends/lan/landevicelink.cpp
+ ../core/backends/lan/lanlinkprovider.cpp
+ ../core/backends/lan/lanpairinghandler.cpp
+ ../core/backends/lan/server.cpp
+ ../core/backends/lan/socketlinereader.cpp
+ ../core/backends/lan/uploadjob.cpp
+ ../core/backends/linkprovider.cpp
+ ../core/backends/pairinghandler.cpp
+ ../core/device.cpp
+ ../core/pluginloader.cpp
+)
+ecm_add_test(lanlinkprovidertest.cpp ${lanlinkprovidertest_sources} TEST_NAME lanlinkprovidertest LINK_LIBRARIES ${kdeconnect_libraries})
+
+ecm_add_test(devicetest.cpp ${lanlinkprovidertest_sources} TEST_NAME devicetest LINK_LIBRARIES ${kdeconnect_libraries})
++
++ecm_add_test(downloadjobtest.cpp ../core/backends/lan/downloadjob.cpp TEST_NAME downloadjobtest LINK_LIBRARIES ${kdeconnect_libraries})
--
kdeconnect packaging
More information about the pkg-kde-commits
mailing list