diff -Nru kdeconnect-plasma-0.0+git20150810/app/main.cpp kdeconnect-plasma-0.9+git20160315/app/main.cpp --- kdeconnect-plasma-0.0+git20150810/app/main.cpp 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/app/main.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -26,7 +26,7 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); - KAboutData aboutData("kdeconnect-kde", i18n("Awesome App"), "1.0", i18n("KDE Connect App"), KAboutLicense::GPL, i18n("(c) 2015, Aleix Pol Gonzalez")); + KAboutData aboutData("kdeconnect.app", i18n("Awesome App"), "1.0", i18n("KDE Connect App"), KAboutLicense::GPL, i18n("(c) 2015, Aleix Pol Gonzalez")); aboutData.addAuthor(i18n("Aleix Pol Gonzalez"), i18n("Maintainer"), "aleixpol@kde.org"); KAboutData::setApplicationData(aboutData); @@ -39,11 +39,13 @@ aboutData.processCommandLine(&parser); } - QQmlApplicationEngine engine(QUrl("qrc:/qml/main.qml")); + QQmlApplicationEngine engine; KDeclarative::KDeclarative kdeclarative; kdeclarative.setDeclarativeEngine(&engine); kdeclarative.setupBindings(); + engine.load(QUrl("qrc:/qml/main.qml")); + return app.exec(); } diff -Nru kdeconnect-plasma-0.0+git20150810/app/org.kde.kdeconnect.app.desktop kdeconnect-plasma-0.9+git20160315/app/org.kde.kdeconnect.app.desktop --- kdeconnect-plasma-0.0+git20150810/app/org.kde.kdeconnect.app.desktop 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/app/org.kde.kdeconnect.app.desktop 2016-03-15 09:57:50.000000000 +0000 @@ -1,55 +1,92 @@ [Desktop Entry] Name=KDE Connect Application +Name[ar]=تطبيق كدي المتّصل +Name[ast]=Aplicación KDE Connect Name[ca]=Aplicació KDE Connect +Name[ca@valencia]=Aplicació KDE Connect Name[cs]=Aplikace KDE Connect +Name[da]=Programmet KDE Connect Name[de]=KDE-Connect-Anwendung +Name[el]=Εφαρμογή KDE Connect +Name[en_GB]=KDE Connect Application Name[es]=Aplicación KDE Connect Name[fi]=KDE Connect -sovellus +Name[fr]=Application KDE Connect Name[gl]=Programa de KDE Connect +Name[hu]=KDE Connect alkalmazás Name[it]=Applicazione KDE Connect +Name[ko]=KDE Connect 프로그램 Name[nl]=KDE Connect-toepassing +Name[nn]=KDE Connect-program Name[pl]=Program KDE Connect Name[pt]=Aplicação do KDE Connect Name[pt_BR]=Aplicativo KDE Connect +Name[ru]=Приложение KDE Connect Name[sk]=KDE Connect aplikácia Name[sv]=Programmet KDE-anslut Name[tr]=KDE Bağlantı Uygulaması Name[uk]=Програма KDE Connect Name[x-test]=xxKDE Connect Applicationxx +Name[zh_CN]=KDE Connect 应用程序 GenericName=Device Synchronization +GenericName[ar]=مزامنة الأجهزة +GenericName[ast]=Sincronización de preseos GenericName[ca]=Sincronització de dispositius +GenericName[ca@valencia]=Sincronització de dispositius GenericName[cs]=Synchronizace zařízení +GenericName[da]=Enhedssynkronisering GenericName[de]=Geräteabgleich +GenericName[el]=Συγχρονισμός συσκευών +GenericName[en_GB]=Device Synchronisation GenericName[es]=Sincronización de dispositivos GenericName[fi]=Laitteiden synkronointi +GenericName[fr]=Synchronisation de périphériques GenericName[gl]=Sincronización de dispositivos +GenericName[hu]=Eszközszinkronizáció GenericName[it]=Sincronizzazione dispositivo +GenericName[ko]=장치 동기화 +GenericName[lt]=Įrenginių sinchronizavimas GenericName[nl]=Synchronisatie van apparaat +GenericName[nn]=Einingssynkronisering GenericName[pl]=Synchronizacja urządzenia GenericName[pt]=Sincronização de Dispositivos GenericName[pt_BR]=Sincronização de dispositivo +GenericName[ru]=Синхронизация с мобильным устройством GenericName[sk]=Synchronizácia zariadení GenericName[sv]=Enhetssynkronisering GenericName[tr]=Aygıt Eşzamanlaması GenericName[uk]=Синхронізація із пристроями GenericName[x-test]=xxDevice Synchronizationxx +GenericName[zh_CN]=设备同步 Comment=Make all your devices one +Comment[ar]=اجعل أجهزتك كلّها واحدًا +Comment[ast]=Fai tolos tos preseos ún mesmu Comment[ca]=Fa que tots els vostres dispositius siguin un +Comment[ca@valencia]=Fa que tots els vostres dispositius siguen un Comment[cs]=Sjednoťte svá zařízení +Comment[da]=Gør alle dine enheder til en Comment[de]=Gleichen Sie alle Ihre Geräte ab +Comment[el]=Όλες οι συσκευές σας σε μία +Comment[en_GB]=Make all your devices one Comment[es]=Convertir todos sus dispositivos en uno Comment[fi]=Yhdistä kaikki laitteesi toisiinsa +Comment[fr]=Unifiez vos périphériques Comment[gl]=Unifique os seus dispositivos. +Comment[hu]=Egyesítse eszközeit Comment[it]=Fai di tutti i tuoi dispositivi un solo dispositivo +Comment[ko]=모든 장치를 하나로 동기화 Comment[nl]=Al uw apparaten een maken +Comment[nn]=Slå alle einingane dine saman Comment[pl]=Uczyń wszystkie swoje urządzenia jednym Comment[pt]=Unifique todos os seus dispositivos Comment[pt_BR]=Torne todos os seus dispositivos em um +Comment[ru]=Объедините все ваши устройства Comment[sk]=Urobiť z vašich zariadení jedno Comment[sv]=Gör alla enheter till en Comment[tr]=Tüm aygıtlarınızı birleştirin Comment[uk]=Поєднайте усі ваші пристрої Comment[x-test]=xxMake all your devices onexx +Comment[zh_CN]=连接您所有设备 Exec=kcapp Icon=kdeconnect Type=Application diff -Nru kdeconnect-plasma-0.0+git20150810/app/qml/main.qml kdeconnect-plasma-0.9+git20160315/app/qml/main.qml --- kdeconnect-plasma-0.0+git20150810/app/qml/main.qml 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/app/qml/main.qml 2016-03-15 09:57:50.000000000 +0000 @@ -39,7 +39,7 @@ } Label { Layout.fillWidth: true - text: "KDE Connect" + text: i18n("KDE Connect") font.pointSize: 20 } } diff -Nru kdeconnect-plasma-0.0+git20150810/cli/CMakeLists.txt kdeconnect-plasma-0.9+git20160315/cli/CMakeLists.txt --- kdeconnect-plasma-0.0+git20150810/cli/CMakeLists.txt 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/cli/CMakeLists.txt 2016-03-15 09:57:50.000000000 +0000 @@ -1,5 +1,6 @@ add_executable(kdeconnect-cli kdeconnect-cli.cpp) +ecm_mark_nongui_executable(kdeconnect-cli) target_link_libraries(kdeconnect-cli kdeconnectinterfaces KF5::CoreAddons KF5::I18n) diff -Nru kdeconnect-plasma-0.0+git20150810/cli/kdeconnect-cli.cpp kdeconnect-plasma-0.9+git20160315/cli/kdeconnect-cli.cpp --- kdeconnect-plasma-0.0+git20150810/cli/kdeconnect-cli.cpp 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/cli/kdeconnect-cli.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -18,6 +18,7 @@ * along with this program. If not, see . */ +#include #include #include #include @@ -50,6 +51,7 @@ parser.addOption(QCommandLineOption("id-only", i18n("Make --list-devices or --list-available print only the devices id, to ease scripting"))); parser.addOption(QCommandLineOption("refresh", i18n("Search for devices in the network and re-establish connections"))); parser.addOption(QCommandLineOption("pair", i18n("Request pairing to a said device"))); + parser.addOption(QCommandLineOption("ring", i18n("Find the said device by ringing it."))); parser.addOption(QCommandLineOption("unpair", i18n("Stop pairing to a said device"))); parser.addOption(QCommandLineOption("ping", i18n("Sends a ping to said device"))); parser.addOption(QCommandLineOption("ping-msg", i18n("Same as ping but you can set the message to display"), i18n("message"))); @@ -63,11 +65,16 @@ parser.process(app); about.processCommandLine(&parser); + const QString id = "kdeconnect-cli-"+QString::number(QCoreApplication::applicationPid()); + DaemonDbusInterface iface; + if(parser.isSet("l") || parser.isSet("a")) { - DaemonDbusInterface iface; bool paired = true, reachable = false; if (parser.isSet("a")) { reachable = true; + } else { + iface.acquireDiscoveryMode(id); + QThread::sleep(2); } QDBusPendingReply reply = iface.devices(paired, reachable); reply.waitForFinished(); @@ -79,7 +86,7 @@ } else { DeviceDbusInterface deviceIface(id); QString statusInfo; - const bool isReachable = deviceIface.isReachable(), isPaired = deviceIface.isPaired(); + const bool isReachable = deviceIface.isReachable(), isPaired = deviceIface.property("isPaired").toBool(); if (isReachable && isPaired) { statusInfo = i18n("(paired and reachable)"); } else if (isReachable) { @@ -95,6 +102,8 @@ } else if (devices.isEmpty()) { QTextStream(stderr) << i18n("No devices found") << endl; } + + iface.releaseDiscoveryMode(id); } else if(parser.isSet("refresh")) { QDBusMessage msg = QDBusMessage::createMethodCall("org.kde.kdeconnect", "/modules/kdeconnect", "org.kde.kdeconnect.daemon", "forceOnNetworkChange"); QDBusConnection::sessionBus().call(msg); @@ -104,9 +113,8 @@ QTextStream(stderr) << i18n("No device specified") << endl; } device = parser.value("device"); - QUrl url; if(parser.isSet("share")) { - url = QUrl::fromUserInput(parser.value("share"), QDir::currentPath()); + QUrl url = QUrl::fromUserInput(parser.value("share"), QDir::currentPath()); parser.clearPositionalArguments(); if(!url.isEmpty() && !device.isEmpty()) { QDBusMessage msg = QDBusMessage::createMethodCall("org.kde.kdeconnect", "/modules/kdeconnect/devices/"+device+"/share", "org.kde.kdeconnect.device.share", "shareUrl"); @@ -117,17 +125,40 @@ } } else if(parser.isSet("pair")) { DeviceDbusInterface dev(device); - if(dev.isPaired()) + if (!dev.isReachable()) { + //Device doesn't exist, go into discovery mode and wait up to 30 seconds for the device to appear + QEventLoop wait; + QTextStream(stderr) << i18n("waiting for device...") << endl; + iface.acquireDiscoveryMode(id); + + QObject::connect(&iface, &DaemonDbusInterface::deviceAdded, [&](const QString &deviceAddedId) { + if (device == deviceAddedId) { + wait.quit(); + } + }); + QTimer::singleShot(30 * 1000, &wait, &QEventLoop::quit); + + wait.exec(); + } + + if (!dev.isReachable()) { + QTextStream(stderr) << i18n("Device not found") << endl; + } else if(dev.property("isPaired").toBool()) { QTextStream(stderr) << i18n("Already paired") << endl; - else { + } else { + QTextStream(stderr) << i18n("Pair requested") << endl; QDBusPendingReply req = dev.requestPair(); req.waitForFinished(); } + iface.releaseDiscoveryMode(id); } else if(parser.isSet("unpair")) { DeviceDbusInterface dev(device); - if(!dev.isPaired()) + if (!dev.isReachable()) { + QTextStream(stderr) << i18n("Device does not exist") << endl; + } else if(!dev.property("isPaired").toBool()) { QTextStream(stderr) << i18n("Already not paired") << endl; - else { + } else { + QTextStream(stderr) << i18n("Unpaired") << endl; QDBusPendingReply req = dev.unpair(); req.waitForFinished(); } @@ -138,6 +169,9 @@ msg.setArguments(QVariantList() << message); } QDBusConnection::sessionBus().call(msg); + } else if(parser.isSet("ring")) { + QDBusMessage msg = QDBusMessage::createMethodCall("org.kde.kdeconnect", "/modules/kdeconnect/devices/"+device+"/findmyphone", "org.kde.kdeconnect.device.findmyphone", "ring"); + QDBusConnection::sessionBus().call(msg); } else if(parser.isSet("list-notifications")) { NotificationsModel notifications; notifications.setDeviceId(device); diff -Nru kdeconnect-plasma-0.0+git20150810/CMakeLists.txt kdeconnect-plasma-0.9+git20160315/CMakeLists.txt --- kdeconnect-plasma-0.0+git20150810/CMakeLists.txt 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/CMakeLists.txt 2016-03-15 09:57:50.000000000 +0000 @@ -1,7 +1,7 @@ project(kdeconnect) set(KDECONNECT_VERSION_MAJOR 0) -set(KDECONNECT_VERSION_MINOR 8) +set(KDECONNECT_VERSION_MINOR 9) set(KDECONNECT_VERSION_PATCH 0) set(KDECONNECT_VERSION "${KDECONNECT_VERSION_MAJOR}.${KDECONNECT_VERSION_MINOR}.${KDECONNECT_VERSION_PATCH}") @@ -10,9 +10,15 @@ find_package(ECM 0.0.9 REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${CMAKE_SOURCE_DIR}/cmake) -find_package(Qt5 5.2 REQUIRED COMPONENTS Quick Test) -find_package(KF5 REQUIRED COMPONENTS I18n ConfigWidgets DBusAddons IconThemes) +find_package(Qt5 5.2 REQUIRED COMPONENTS Quick) +find_package(KF5 REQUIRED COMPONENTS I18n ConfigWidgets DBusAddons) +find_package(KF5DocTools) find_package(Qca-qt5 2.1.0 REQUIRED) +find_package(TelepathyQt5 0.9.5) +find_package(TelepathyQt5Service 0.9.7) +if (TelepathyQt5_FOUND AND TelepathyQt5Service_FOUND) + add_definitions(-DHAVE_TELEPATHY) +endif() include_directories(${CMAKE_SOURCE_DIR}) @@ -49,7 +55,17 @@ add_subdirectory(plasmoid) add_subdirectory(cli) add_subdirectory(fileitemactionplugin) +if(KF5DocTools_FOUND) + add_subdirectory(doc) +endif() -add_subdirectory(tests) +if (TelepathyQt5_FOUND AND TelepathyQt5Service_FOUND) + add_subdirectory(telepathy-cm) +endif() + +if(BUILD_TESTING) + add_subdirectory(tests) +endif() -install(PROGRAMS kdeconnect-non-plasma.desktop DESTINATION ${XDG_APPS_INSTALL_DIR}) +install(PROGRAMS org.kde.kdeconnect.nonplasma.desktop DESTINATION ${XDG_APPS_INSTALL_DIR}) +feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) diff -Nru kdeconnect-plasma-0.0+git20150810/core/backends/devicelink.cpp kdeconnect-plasma-0.9+git20160315/core/backends/devicelink.cpp --- kdeconnect-plasma-0.0+git20150810/core/backends/devicelink.cpp 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/core/backends/devicelink.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -22,15 +22,15 @@ #include "kdeconnectconfig.h" #include "linkprovider.h" -DeviceLink::DeviceLink(const QString& deviceId, LinkProvider* parent) +DeviceLink::DeviceLink(const QString& deviceId, LinkProvider* parent, ConnectionStarted connectionSource) : QObject(parent) + , mPrivateKey(KdeConnectConfig::instance()->privateKey()) , mDeviceId(deviceId) + , mConnectionSource(connectionSource) , mLinkProvider(parent) { Q_ASSERT(!deviceId.isEmpty()); setProperty("deviceId", deviceId); - - mPrivateKey = KdeConnectConfig::instance()->privateKey(); } diff -Nru kdeconnect-plasma-0.0+git20150810/core/backends/devicelink.h kdeconnect-plasma-0.9+git20160315/core/backends/devicelink.h --- kdeconnect-plasma-0.0+git20150810/core/backends/devicelink.h 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/core/backends/devicelink.h 2016-03-15 09:57:50.000000000 +0000 @@ -35,7 +35,9 @@ Q_OBJECT public: - DeviceLink(const QString& deviceId, LinkProvider* parent); + enum ConnectionStarted : bool { Locally, Remotely }; + + DeviceLink(const QString& deviceId, LinkProvider* parent, ConnectionStarted connectionSource); virtual ~DeviceLink() { }; const QString& deviceId() { return mDeviceId; } @@ -44,6 +46,10 @@ virtual bool sendPackage(NetworkPackage& np) = 0; virtual bool sendPackageEncrypted(QCA::PublicKey& publicKey, NetworkPackage& np) = 0; + ConnectionStarted connectionSource() const { + return mConnectionSource; + } + Q_SIGNALS: void receivedPackage(const NetworkPackage& np); @@ -51,7 +57,8 @@ QCA::PrivateKey mPrivateKey; private: - QString mDeviceId; + const QString mDeviceId; + const ConnectionStarted mConnectionSource; LinkProvider* mLinkProvider; }; diff -Nru kdeconnect-plasma-0.0+git20150810/core/backends/lan/downloadjob.cpp kdeconnect-plasma-0.9+git20160315/core/backends/lan/downloadjob.cpp --- kdeconnect-plasma-0.0+git20150810/core/backends/lan/downloadjob.cpp 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/core/backends/lan/downloadjob.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -20,30 +20,50 @@ #include "downloadjob.h" -DownloadJob::DownloadJob(QHostAddress address, QVariantMap transferInfo): KJob() +#include + +#include +#include +#include +#include + +#include "lanlinkprovider.h" + +DownloadJob::DownloadJob(const QHostAddress &address, const QVariantMap &transferInfo): KJob() { mAddress = address; mPort = transferInfo["port"].toInt(); - mSocket = QSharedPointer(new QTcpSocket); + mSocket = QSharedPointer(new QTcpSocket()); +} + +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); - 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 DownloadJob::getPayload() { - //kDebug(kdeconnect_kded()) << "getPayload"; return mSocket.staticCast(); } diff -Nru kdeconnect-plasma-0.0+git20150810/core/backends/lan/downloadjob.h kdeconnect-plasma-0.9+git20160315/core/backends/lan/downloadjob.h --- kdeconnect-plasma-0.0+git20150810/core/backends/lan/downloadjob.h 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/core/backends/lan/downloadjob.h 2016-03-15 09:57:50.000000000 +0000 @@ -34,8 +34,9 @@ { Q_OBJECT public: - DownloadJob(QHostAddress address, QVariantMap transferInfo); - virtual void start(); + DownloadJob(const QHostAddress &address, const QVariantMap &transferInfo); + ~DownloadJob(); + void start() Q_DECL_OVERRIDE; QSharedPointer getPayload(); private: @@ -43,9 +44,8 @@ qint16 mPort; QSharedPointer mSocket; - private Q_SLOTS: - void disconnected(); + void done(); }; diff -Nru kdeconnect-plasma-0.0+git20150810/core/backends/lan/landevicelink.cpp kdeconnect-plasma-0.9+git20160315/core/backends/lan/landevicelink.cpp --- kdeconnect-plasma-0.0+git20150810/core/backends/lan/landevicelink.cpp 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/core/backends/lan/landevicelink.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -21,18 +21,13 @@ #include "landevicelink.h" #include "core_debug.h" -#include -#include -#include -#include - #include "../linkprovider.h" #include "uploadjob.h" #include "downloadjob.h" #include "socketlinereader.h" -LanDeviceLink::LanDeviceLink(const QString& deviceId, LinkProvider* parent, QTcpSocket* socket) - : DeviceLink(deviceId, parent) +LanDeviceLink::LanDeviceLink(const QString& deviceId, LinkProvider* parent, QTcpSocket* socket, ConnectionStarted connectionSource) + : DeviceLink(deviceId, parent, connectionSource) , mSocketLineReader(new SocketLineReader(socket)) { connect(mSocketLineReader, SIGNAL(readyRead()), @@ -106,7 +101,7 @@ } else { if (unserialized.hasPayloadTransferInfo()) { - qWarning() << "Ignoring unencrypted payload"; + qCWarning(KDECONNECT_CORE) << "Ignoring unencrypted payload"; } Q_EMIT receivedPackage(unserialized); diff -Nru kdeconnect-plasma-0.0+git20150810/core/backends/lan/landevicelink.h kdeconnect-plasma-0.9+git20160315/core/backends/lan/landevicelink.h --- kdeconnect-plasma-0.0+git20150810/core/backends/lan/landevicelink.h 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/core/backends/lan/landevicelink.h 2016-03-15 09:57:50.000000000 +0000 @@ -35,10 +35,10 @@ Q_OBJECT public: - LanDeviceLink(const QString& deviceId, LinkProvider* parent, QTcpSocket* socket); + LanDeviceLink(const QString& deviceId, LinkProvider* parent, QTcpSocket* socket, ConnectionStarted connectionSource); - bool sendPackage(NetworkPackage& np); - bool sendPackageEncrypted(QCA::PublicKey& key, NetworkPackage& np); + bool sendPackage(NetworkPackage& np) override; + bool sendPackageEncrypted(QCA::PublicKey& key, NetworkPackage& np) override; private Q_SLOTS: void dataReceived(); diff -Nru kdeconnect-plasma-0.0+git20150810/core/backends/lan/lanlinkprovider.cpp kdeconnect-plasma-0.9+git20160315/core/backends/lan/lanlinkprovider.cpp --- kdeconnect-plasma-0.0+git20150810/core/backends/lan/lanlinkprovider.cpp 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/core/backends/lan/lanlinkprovider.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -21,10 +21,12 @@ #include "lanlinkprovider.h" #include "core_debug.h" +#ifndef Q_OS_WIN #include #include #include #include +#endif #include #include @@ -47,14 +49,16 @@ connect(mTcpServer,SIGNAL(newConnection()),this, SLOT(newConnection())); //Detect when a network interface changes status, so we announce ourelves in the new network - QNetworkConfigurationManager* networkManager; - networkManager = new QNetworkConfigurationManager(this); - connect(networkManager, &QNetworkConfigurationManager::configurationChanged, [this, networkManager](QNetworkConfiguration config) { - Q_UNUSED(config); - //qCDebug(KDECONNECT_CORE) << config.name() << " state changed to " << config.state(); - //qCDebug(KDECONNECT_CORE) << "Online status: " << (networkManager->isOnline()? "online":"offline"); + QNetworkConfigurationManager* networkManager = new QNetworkConfigurationManager(this); + connect(networkManager, &QNetworkConfigurationManager::configurationChanged, this, &LanLinkProvider::onNetworkConfigurationChanged); +} + +void LanLinkProvider::onNetworkConfigurationChanged(const QNetworkConfiguration &config) +{ + if (m_lastConfig != config) { + m_lastConfig = config; onNetworkChange(); - }); + } } LanLinkProvider::~LanLinkProvider() @@ -104,7 +108,7 @@ //I'm the existing device, a new device is kindly introducing itself. //I will create a TcpSocket and try to connect. This can result in either connected() or connectError(). -void LanLinkProvider::newUdpConnection() +void LanLinkProvider::newUdpConnection() //udpBroadcastReceived { while (mUdpServer->hasPendingDatagrams()) { QByteArray datagram; @@ -147,7 +151,7 @@ disconnect(socket, SIGNAL(connected()), this, SLOT(connected())); disconnect(socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(connectError())); - qCDebug(KDECONNECT_CORE) << "Fallback (1), try reverse connection (send udp packet)"; + qCDebug(KDECONNECT_CORE) << "Fallback (1), try reverse connection (send udp packet)" << socket->errorString(); NetworkPackage np(""); NetworkPackage::createIdentityPackage(&np); np.set("tcpPort", mTcpPort); @@ -172,8 +176,8 @@ NetworkPackage* receivedPackage = receivedIdentityPackages[socket].np; const QString& deviceId = receivedPackage->get("deviceId"); //qCDebug(KDECONNECT_CORE) << "Connected" << socket->isWritable(); + LanDeviceLink* deviceLink = new LanDeviceLink(deviceId, this, socket, DeviceLink::Remotely); - LanDeviceLink* deviceLink = new LanDeviceLink(deviceId, this, socket); NetworkPackage np2(""); NetworkPackage::createIdentityPackage(&np2); @@ -223,7 +227,7 @@ configureSocket(socket); //This socket is still managed by us (and child of the QTcpServer), if //it disconnects before we manage to pass it to a LanDeviceLink, it's - //our responsability to delete it. We do so with this connection. + //our responsibility to delete it. We do so with this connection. connect(socket, SIGNAL(disconnected()), socket, SLOT(deleteLater())); connect(socket, SIGNAL(readyRead()), @@ -260,7 +264,7 @@ socket, SLOT(deleteLater())); const QString& deviceId = np.get("deviceId"); - LanDeviceLink* deviceLink = new LanDeviceLink(deviceId, this, socket); + LanDeviceLink* deviceLink = new LanDeviceLink(deviceId, this, socket, DeviceLink::Locally); connect(deviceLink, SIGNAL(destroyed(QObject*)), this, SLOT(deviceLinkDestroyed(QObject*))); diff -Nru kdeconnect-plasma-0.0+git20150810/core/backends/lan/lanlinkprovider.h kdeconnect-plasma-0.9+git20160315/core/backends/lan/lanlinkprovider.h --- kdeconnect-plasma-0.0+git20150810/core/backends/lan/lanlinkprovider.h 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/core/backends/lan/lanlinkprovider.h 2016-03-15 09:57:50.000000000 +0000 @@ -26,7 +26,6 @@ #include #include "../linkprovider.h" -#include "netaddress.h" class LanLinkProvider : public LinkProvider @@ -37,13 +36,13 @@ LanLinkProvider(); ~LanLinkProvider(); - QString name() { return "LanLinkProvider"; } - int priority() { return PRIORITY_HIGH; } + QString name() override { return "LanLinkProvider"; } + int priority() override { return PRIORITY_HIGH; } public Q_SLOTS: - virtual void onNetworkChange(); - virtual void onStart(); - virtual void onStop(); + virtual void onNetworkChange() override; + virtual void onStart() override; + virtual void onStop() override; void connected(); void connectError(); @@ -52,6 +51,7 @@ void newConnection(); void dataReceived(); void deviceLinkDestroyed(QObject* destroyedDeviceLink); + void onNetworkConfigurationChanged(const QNetworkConfiguration &config); private: static void configureSocket(QTcpSocket* socket); @@ -69,6 +69,7 @@ QHostAddress sender; }; QMap receivedIdentityPackages; + QNetworkConfiguration m_lastConfig; }; diff -Nru kdeconnect-plasma-0.0+git20150810/core/backends/lan/netaddress.h kdeconnect-plasma-0.9+git20160315/core/backends/lan/netaddress.h --- kdeconnect-plasma-0.0+git20150810/core/backends/lan/netaddress.h 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/core/backends/lan/netaddress.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,37 +0,0 @@ -/** - * Copyright 2013 Albert Vaca - * - * 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 . - */ - -#ifndef NETADDRESS_H -#define NETADDRESS_H - -#include - -struct NetAddress { - NetAddress() { } - NetAddress(QHostAddress _ip, quint16 _port) : ip(_ip), port(_port) { } - QHostAddress ip; - quint16 port; -}; - -inline bool operator< (const NetAddress& a, const NetAddress& b){ - return (a.ip.toString()+a.port) < (b.ip.toString()+b.port); -} - -#endif // NETADDRESS_H diff -Nru kdeconnect-plasma-0.0+git20150810/core/backends/lan/socketlinereader.cpp kdeconnect-plasma-0.9+git20160315/core/backends/lan/socketlinereader.cpp --- kdeconnect-plasma-0.0+git20150810/core/backends/lan/socketlinereader.cpp 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/core/backends/lan/socketlinereader.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -33,8 +33,8 @@ { while (mSocket->canReadLine()) { const QByteArray line = mSocket->readLine(); - if (line.length() > 1) { - mPackages.enqueue(line);//we don't want single \n + if (line.length() > 1) { //we don't want a single \n + mPackages.enqueue(line); } } diff -Nru kdeconnect-plasma-0.0+git20150810/core/backends/lan/socketlinereader.h kdeconnect-plasma-0.9+git20160315/core/backends/lan/socketlinereader.h --- kdeconnect-plasma-0.0+git20150810/core/backends/lan/socketlinereader.h 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/core/backends/lan/socketlinereader.h 2016-03-15 09:57:50.000000000 +0000 @@ -37,7 +37,7 @@ Q_OBJECT public: - SocketLineReader(QTcpSocket* socket, QObject* parent = 0); + explicit SocketLineReader(QTcpSocket* socket, QObject* parent = nullptr); QByteArray readLine() { return mPackages.dequeue(); } qint64 write(const QByteArray& data) { return mSocket->write(data); } diff -Nru kdeconnect-plasma-0.0+git20150810/core/backends/lan/uploadjob.cpp kdeconnect-plasma-0.9+git20160315/core/backends/lan/uploadjob.cpp --- kdeconnect-plasma-0.0+git20150810/core/backends/lan/uploadjob.cpp 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/core/backends/lan/uploadjob.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -18,17 +18,18 @@ * along with this program. If not, see . */ +#include "uploadjob.h" + #include #include -#include "uploadjob.h" #include "core_debug.h" UploadJob::UploadJob(const QSharedPointer& source): KJob() { mInput = source; mServer = new QTcpServer(this); - mSocket = 0; + mSocket = nullptr; mPort = 0; connect(mInput.data(), SIGNAL(readyRead()), this, SLOT(readyRead())); @@ -41,7 +42,7 @@ while (!mServer->listen(QHostAddress::Any, mPort)) { mPort++; if (mPort > 1764) { //No ports available? - qWarning(KDECONNECT_CORE) << "Error opening a port in range 1739-1764 for file transfer"; + qCWarning(KDECONNECT_CORE) << "Error opening a port in range 1739-1764 for file transfer"; mPort = 0; return; } @@ -55,7 +56,7 @@ if (mSocket || !mServer->hasPendingConnections()) return; if (!mInput->open(QIODevice::ReadOnly)) { - qWarning() << "error when opening the input to upload"; + qCWarning(KDECONNECT_CORE) << "error when opening the input to upload"; return; //TODO: Handle error, clean up... } @@ -72,7 +73,7 @@ qint64 bytes = qMin(mInput->bytesAvailable(), (qint64)4096); int w = mSocket->write(mInput->read(bytes)); if (w<0) { - qWarning() << "error when writing data to upload" << bytes << mInput->bytesAvailable(); + qCWarning(KDECONNECT_CORE) << "error when writing data to upload" << bytes << mInput->bytesAvailable(); break; } else diff -Nru kdeconnect-plasma-0.0+git20150810/core/backends/lan/uploadjob.h kdeconnect-plasma-0.9+git20160315/core/backends/lan/uploadjob.h --- kdeconnect-plasma-0.0+git20150810/core/backends/lan/uploadjob.h 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/core/backends/lan/uploadjob.h 2016-03-15 09:57:50.000000000 +0000 @@ -34,8 +34,8 @@ { Q_OBJECT public: - UploadJob(const QSharedPointer& source); - virtual void start(); + explicit UploadJob(const QSharedPointer& source); + virtual void start() override; QVariantMap getTransferInfo(); private: diff -Nru kdeconnect-plasma-0.0+git20150810/core/backends/loopback/loopbackdevicelink.cpp kdeconnect-plasma-0.9+git20160315/core/backends/loopback/loopbackdevicelink.cpp --- kdeconnect-plasma-0.0+git20150810/core/backends/loopback/loopbackdevicelink.cpp 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/core/backends/loopback/loopbackdevicelink.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -23,7 +23,7 @@ #include "loopbacklinkprovider.h" LoopbackDeviceLink::LoopbackDeviceLink(const QString& deviceId, LoopbackLinkProvider* provider) - : DeviceLink(deviceId, provider) + : DeviceLink(deviceId, provider, Remotely) { } @@ -44,14 +44,17 @@ NetworkPackage output(QString::null); unserialized.decrypt(mPrivateKey, &output); + bool b = true; //LoopbackDeviceLink does not need deviceTransferInfo if (input.hasPayload()) { + b = input.payload()->open(QIODevice::ReadOnly); + Q_ASSERT(b); output.setPayload(input.payload(), input.payloadSize()); } Q_EMIT receivedPackage(output); - return true; + return b; } bool LoopbackDeviceLink::sendPackage(NetworkPackage& input) @@ -61,6 +64,8 @@ //LoopbackDeviceLink does not need deviceTransferInfo if (input.hasPayload()) { + bool b = input.payload()->open(QIODevice::ReadOnly); + Q_ASSERT(b); output.setPayload(input.payload(), input.payloadSize()); } diff -Nru kdeconnect-plasma-0.0+git20150810/core/backends/loopback/loopbackdevicelink.h kdeconnect-plasma-0.9+git20160315/core/backends/loopback/loopbackdevicelink.h --- kdeconnect-plasma-0.0+git20150810/core/backends/loopback/loopbackdevicelink.h 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/core/backends/loopback/loopbackdevicelink.h 2016-03-15 09:57:50.000000000 +0000 @@ -32,8 +32,8 @@ public: LoopbackDeviceLink(const QString& d, LoopbackLinkProvider* a); - virtual bool sendPackage(NetworkPackage& np); - virtual bool sendPackageEncrypted(QCA::PublicKey& publicKey, NetworkPackage& np); + virtual bool sendPackage(NetworkPackage& np) override; + virtual bool sendPackageEncrypted(QCA::PublicKey& publicKey, NetworkPackage& np) override; }; diff -Nru kdeconnect-plasma-0.0+git20150810/core/backends/loopback/loopbacklinkprovider.cpp kdeconnect-plasma-0.9+git20160315/core/backends/loopback/loopbacklinkprovider.cpp --- kdeconnect-plasma-0.0+git20150810/core/backends/loopback/loopbacklinkprovider.cpp 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/core/backends/loopback/loopbacklinkprovider.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -25,7 +25,6 @@ LoopbackLinkProvider::LoopbackLinkProvider() : identityPackage(PACKAGE_TYPE_IDENTITY) { - loopbackDeviceLink = 0; NetworkPackage::createIdentityPackage(&identityPackage); } @@ -55,7 +54,6 @@ { if (loopbackDeviceLink) { delete loopbackDeviceLink; - loopbackDeviceLink = 0; } } diff -Nru kdeconnect-plasma-0.0+git20150810/core/backends/loopback/loopbacklinkprovider.h kdeconnect-plasma-0.9+git20160315/core/backends/loopback/loopbacklinkprovider.h --- kdeconnect-plasma-0.0+git20150810/core/backends/loopback/loopbacklinkprovider.h 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/core/backends/loopback/loopbacklinkprovider.h 2016-03-15 09:57:50.000000000 +0000 @@ -23,6 +23,7 @@ #include "../linkprovider.h" #include "loopbackdevicelink.h" +#include class LoopbackLinkProvider : public LinkProvider @@ -32,15 +33,15 @@ LoopbackLinkProvider(); ~LoopbackLinkProvider(); - QString name() { return "LoopbackLinkProvider"; } - int priority() { return PRIORITY_LOW; } + QString name() override { return "LoopbackLinkProvider"; } + int priority() override { return PRIORITY_LOW; } - virtual void onStart(); - virtual void onStop(); - virtual void onNetworkChange(); + virtual void onStart() override; + virtual void onStop() override; + virtual void onNetworkChange() override; private: - LoopbackDeviceLink* loopbackDeviceLink; + QPointer loopbackDeviceLink; NetworkPackage identityPackage; }; diff -Nru kdeconnect-plasma-0.0+git20150810/core/CMakeLists.txt kdeconnect-plasma-0.9+git20160315/core/CMakeLists.txt --- kdeconnect-plasma-0.0+git20150810/core/CMakeLists.txt 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/core/CMakeLists.txt 2016-03-15 09:57:50.000000000 +0000 @@ -48,6 +48,6 @@ ) target_include_directories(kdeconnectcore PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) -generate_export_header(kdeconnectcore EXPORT_FILE_NAME ${CMAKE_CURRENT_BINARY_DIR}/kdeconnectcore_export.h BASE_NAME KDEConnectCore) +generate_export_header(kdeconnectcore EXPORT_FILE_NAME kdeconnectcore_export.h BASE_NAME KDEConnectCore) install(TARGETS kdeconnectcore EXPORT kdeconnectLibraryTargets ${INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP) diff -Nru kdeconnect-plasma-0.0+git20150810/core/core_debug.h kdeconnect-plasma-0.9+git20160315/core/core_debug.h --- kdeconnect-plasma-0.0+git20150810/core/core_debug.h 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/core/core_debug.h 2016-03-15 09:57:50.000000000 +0000 @@ -23,6 +23,8 @@ #include -Q_DECLARE_LOGGING_CATEGORY(KDECONNECT_CORE) +#include "kdeconnectcore_export.h" -#endif //CORE_DEBUG_H \ No newline at end of file +KDECONNECTCORE_EXPORT Q_DECLARE_LOGGING_CATEGORY(KDECONNECT_CORE) + +#endif //CORE_DEBUG_H diff -Nru kdeconnect-plasma-0.0+git20150810/core/daemon.cpp kdeconnect-plasma-0.9+git20160315/core/daemon.cpp --- kdeconnect-plasma-0.0+git20150810/core/daemon.cpp 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/core/daemon.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -31,7 +31,6 @@ #include "backends/lan/lanlinkprovider.h" #include "backends/loopback/loopbacklinkprovider.h" #include "device.h" -#include "networkpackage.h" #include "backends/devicelink.h" #include "backends/linkprovider.h" @@ -45,6 +44,7 @@ //Every known device QMap mDevices; + QSet mDiscoveryModeAcquisitions; }; Daemon* Daemon::instance() @@ -53,7 +53,7 @@ return *s_instance; } -Daemon::Daemon(QObject *parent) +Daemon::Daemon(QObject *parent, bool testMode) : QObject(parent) , d(new DaemonPrivate) { @@ -62,8 +62,10 @@ qCDebug(KDECONNECT_CORE) << "KdeConnect daemon starting"; //Load backends - d->mLinkProviders.insert(new LanLinkProvider()); - //d->mLinkProviders.insert(new LoopbackLinkProvider()); + if (testMode) + d->mLinkProviders.insert(new LoopbackLinkProvider()); + else + d->mLinkProviders.insert(new LanLinkProvider()); //Read remebered paired devices const QStringList& list = KdeConnectConfig::instance()->trustedDevices(); @@ -77,10 +79,10 @@ //Listen to new devices Q_FOREACH (LinkProvider* a, d->mLinkProviders) { - connect(a, SIGNAL(onConnectionReceived(NetworkPackage, DeviceLink*)), - this, SLOT(onNewDeviceLink(NetworkPackage, DeviceLink*))); + connect(a, SIGNAL(onConnectionReceived(NetworkPackage,DeviceLink*)), + this, SLOT(onNewDeviceLink(NetworkPackage,DeviceLink*))); + a->onStart(); } - setDiscoveryEnabled(true); //Register on DBus QDBusConnection::sessionBus().registerService("org.kde.kdeconnect"); @@ -89,13 +91,41 @@ qCDebug(KDECONNECT_CORE) << "KdeConnect daemon started"; } -void Daemon::setDiscoveryEnabled(bool b) +void Daemon::acquireDiscoveryMode(const QString &key) { - Q_FOREACH (LinkProvider* a, d->mLinkProviders) { - if (b) - a->onStart(); - else - a->onStop(); + bool oldState = d->mDiscoveryModeAcquisitions.isEmpty(); + + d->mDiscoveryModeAcquisitions.insert(key); + + if (oldState != d->mDiscoveryModeAcquisitions.isEmpty()) { + forceOnNetworkChange(); + } +} + +void Daemon::releaseDiscoveryMode(const QString &key) +{ + bool oldState = d->mDiscoveryModeAcquisitions.isEmpty(); + + d->mDiscoveryModeAcquisitions.remove(key); + + if (oldState != d->mDiscoveryModeAcquisitions.isEmpty()) { + cleanDevices(); + } +} + +void Daemon::removeDevice(Device* device) +{ + d->mDevices.remove(device->id()); + device->deleteLater(); + Q_EMIT deviceRemoved(device->id()); +} + +void Daemon::cleanDevices() +{ + Q_FOREACH(Device* device, d->mDevices) { + if (device->pairStatus() == Device::NotPaired && device->connectionSource() == DeviceLink::ConnectionStarted::Remotely) { + removeDevice(device); + } } } @@ -107,12 +137,12 @@ } } -QStringList Daemon::devices(bool onlyReachable, bool onlyVisible) const +QStringList Daemon::devices(bool onlyReachable, bool onlyPaired) const { QStringList ret; Q_FOREACH(Device* device, d->mDevices) { if (onlyReachable && !device->isReachable()) continue; - if (onlyVisible && !device->isPaired()) continue; + if (onlyPaired && !device->isPaired()) continue; ret.append(device->id()); } return ret; @@ -133,36 +163,39 @@ Q_EMIT deviceVisibilityChanged(id, true); } } else { + Device* device = new Device(this, identityPackage, dl); //qCDebug(KDECONNECT_CORE) << "It is a new device"; - Device* device = new Device(this, identityPackage, dl); - connect(device, SIGNAL(reachableStatusChanged()), this, SLOT(onDeviceStatusChanged())); - connect(device, SIGNAL(pairingChanged(bool)), this, SLOT(onDeviceStatusChanged())); - d->mDevices[id] = device; + //we discard the connections that we created but it's not paired. + //we keep the remotely initiated ones, since the remotes require them + if (!isDiscoveringDevices() && !device->isPaired() && dl->connectionSource() == DeviceLink::ConnectionStarted::Locally) { + device->deleteLater(); + } else { + connect(device, SIGNAL(reachableStatusChanged()), this, SLOT(onDeviceStatusChanged())); + connect(device, SIGNAL(pairingChanged(bool)), this, SLOT(onDeviceStatusChanged())); + d->mDevices[id] = device; - Q_EMIT deviceAdded(id); + Q_EMIT deviceAdded(id); + } } } void Daemon::onDeviceStatusChanged() { Device* device = (Device*)sender(); - QString id = device->id(); - qCDebug(KDECONNECT_CORE) << "Device" << device->name() << "status changed. Reachable:" << device->isReachable() << ". Paired: " << device->isPaired(); + //qCDebug(KDECONNECT_CORE) << "Device" << device->name() << "status changed. Reachable:" << device->isReachable() << ". Paired: " << device->isPaired(); if (!device->isReachable() && !device->isPaired()) { - qCDebug(KDECONNECT_CORE) << "Destroying device" << device->name(); - d->mDevices.remove(id); - device->deleteLater(); - Q_EMIT deviceRemoved(id); + //qCDebug(KDECONNECT_CORE) << "Destroying device" << device->name(); + removeDevice(device); } else { - Q_EMIT deviceVisibilityChanged(id, device->isReachable()); + Q_EMIT deviceVisibilityChanged(device->id(), device->isReachable()); } } -void Daemon::setAnnouncedName(QString name) +void Daemon::setAnnouncedName(const QString &name) { qCDebug(KDECONNECT_CORE()) << "Announcing name"; KdeConnectConfig::instance()->setName(name); @@ -183,8 +216,17 @@ return manager; } -Daemon::~Daemon() +QList Daemon::devicesList() const { + return d->mDevices.values(); +} +bool Daemon::isDiscoveringDevices() const +{ + return !d->mDiscoveryModeAcquisitions.isEmpty(); } +Daemon::~Daemon() +{ + +} diff -Nru kdeconnect-plasma-0.0+git20150810/core/daemon.h kdeconnect-plasma-0.9+git20160315/core/daemon.h --- kdeconnect-plasma-0.0+git20150810/core/daemon.h 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/core/daemon.h 2016-03-15 09:57:50.000000000 +0000 @@ -37,12 +37,12 @@ { Q_OBJECT Q_CLASSINFO("D-Bus Interface", "org.kde.kdeconnect.daemon") + Q_PROPERTY(bool isDiscoveringDevices READ isDiscoveringDevices) public: - Daemon(QObject *parent); + explicit Daemon(QObject *parent, bool testMode = false); ~Daemon(); -public Q_SLOTS: /** * Returns the daemon. * @@ -50,20 +50,24 @@ */ static Daemon* instance(); - //After calling this, signal deviceDiscovered will be triggered for each device - Q_SCRIPTABLE void setDiscoveryEnabled(bool b); + QList devicesList() const; + + virtual void requestPairing(Device *d) = 0; + virtual void reportError(const QString &title, const QString &description) = 0; + virtual QNetworkAccessManager* networkAccessManager(); + +public Q_SLOTS: + Q_SCRIPTABLE void acquireDiscoveryMode(const QString &id); + Q_SCRIPTABLE void releaseDiscoveryMode(const QString &id); Q_SCRIPTABLE void forceOnNetworkChange(); + ///don't try to turn into Q_PROPERTY, it doesn't work Q_SCRIPTABLE QString announcedName(); - Q_SCRIPTABLE void setAnnouncedName(QString name); + Q_SCRIPTABLE void setAnnouncedName(const QString &name); //Returns a list of ids. The respective devices can be manipulated using the dbus path: "/modules/kdeconnect/Devices/"+id - Q_SCRIPTABLE QStringList devices(bool onlyReachable = false, bool onlyVisible = false) const; - - virtual void requestPairing(Device *d) = 0; - virtual void reportError(const QString &title, const QString &description) = 0; - virtual QNetworkAccessManager* networkAccessManager(); + Q_SCRIPTABLE QStringList devices(bool onlyReachable = false, bool onlyPaired = false) const; Q_SIGNALS: Q_SCRIPTABLE void deviceAdded(const QString& id); @@ -75,6 +79,10 @@ void onDeviceStatusChanged(); private: + bool isDiscoveringDevices() const; + void removeDevice(Device* d); + void cleanDevices(); + QScopedPointer d; }; diff -Nru kdeconnect-plasma-0.0+git20150810/core/dbushelper.cpp kdeconnect-plasma-0.9+git20160315/core/dbushelper.cpp --- kdeconnect-plasma-0.0+git20150810/core/dbushelper.cpp 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/core/dbushelper.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -30,4 +30,4 @@ s.replace(regexp,"_"); } -} \ No newline at end of file +} diff -Nru kdeconnect-plasma-0.0+git20150810/core/dbushelper.h kdeconnect-plasma-0.9+git20160315/core/dbushelper.h --- kdeconnect-plasma-0.0+git20150810/core/dbushelper.h 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/core/dbushelper.h 2016-03-15 09:57:50.000000000 +0000 @@ -26,4 +26,4 @@ void filterNonExportableCharacters(QString& s); } -#endif \ No newline at end of file +#endif diff -Nru kdeconnect-plasma-0.0+git20150810/core/default_args.h kdeconnect-plasma-0.9+git20160315/core/default_args.h --- kdeconnect-plasma-0.0+git20150810/core/default_args.h 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/core/default_args.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,61 +0,0 @@ -/** - * Copyright 2013 Albert Vaca - * - * 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 . - */ - -#ifndef DEFAULTARG_H -#define DEFAULTARG_H - -#include - -template -struct default_arg { - static T get(); //Not defined for any other value -}; - -//bool -> false -template<> -struct default_arg { - static bool get() { return false; } -}; - -//int -> -1 -template<> -struct default_arg { - static int get() { return -1; } -}; - -//QByteArray-> empty qbytearray -template<> -struct default_arg { - static QByteArray get() { return QByteArray(); } -}; - -//QStrings -> empty string -template<> -struct default_arg { - static QString get() { return QString(); } -}; - -template -struct default_arg { - static T* get() { return NULL;} -}; - - -#endif // DEFAULTARG_H diff -Nru kdeconnect-plasma-0.0+git20150810/core/device.cpp kdeconnect-plasma-0.9+git20160315/core/device.cpp --- kdeconnect-plasma-0.0+git20150810/core/device.cpp 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/core/device.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -73,12 +73,10 @@ , m_deviceName(identityPackage.get("deviceName")) , m_deviceType(str2type(identityPackage.get("deviceType"))) , m_pairStatus(Device::NotPaired) - , m_protocolVersion(identityPackage.get("protocolVersion")) - , m_incomingCapabilities(identityPackage.get("SupportedIncomingInterfaces", QStringList()).toSet()) - , m_outgoingCapabilities(identityPackage.get("SupportedOutgoingInterfaces", QStringList()).toSet()) + , m_protocolVersion(identityPackage.get("protocolVersion", -1)) { addLink(identityPackage, dl); - + //Register in bus QDBusConnection::sessionBus().registerObject(dbusPath(), this, QDBusConnection::ExportScriptableContents | QDBusConnection::ExportAdaptors); @@ -93,7 +91,7 @@ Device::~Device() { - + qDeleteAll(m_deviceLinks); } bool Device::hasPlugin(const QString& name) const @@ -111,43 +109,45 @@ QHash newPluginMap; QMultiMap newPluginsByIncomingInterface; QMultiMap newPluginsByOutgoingInterface; + QSet supportedIncomingInterfaces; + QSet supportedOutgoingInterfaces; + QStringList unsupportedPlugins; if (isPaired() && isReachable()) { //Do not load any plugin for unpaired devices, nor useless loading them for unreachable devices KConfigGroup pluginStates = KSharedConfig::openConfig(pluginsConfigFile())->group("Plugins"); PluginLoader* loader = PluginLoader::instance(); + const bool deviceSupportsCapabilities = !m_incomingCapabilities.isEmpty() || !m_outgoingCapabilities.isEmpty(); - //Code borrowed from KWin foreach (const QString& pluginName, loader->getPluginList()) { - QString enabledKey = pluginName + QString::fromLatin1("Enabled"); + const KPluginMetaData service = loader->getPluginInfo(pluginName); + const QSet incomingInterfaces = KPluginMetaData::readStringList(service.rawData(), "X-KdeConnect-SupportedPackageType").toSet(); + const QSet outgoingInterfaces = KPluginMetaData::readStringList(service.rawData(), "X-KdeConnect-OutgoingPackageType").toSet(); + + const bool pluginEnabled = isPluginEnabled(pluginName); + + if (pluginEnabled) { + supportedIncomingInterfaces += incomingInterfaces; + supportedOutgoingInterfaces += outgoingInterfaces; + } - bool isPluginEnabled = (pluginStates.hasKey(enabledKey) ? pluginStates.readEntry(enabledKey, false) - : loader->getPluginInfo(pluginName).isEnabledByDefault()); + //If we don't find intersection with the received on one end and the sent on the other, we don't + //let the plugin stay + //Also, if no capabilities are specified on the other end, we don't apply this optimizaton, as + //we assume that the other client doesn't know about capabilities. + const bool capabilitiesSupported = deviceSupportsCapabilities && (!incomingInterfaces.isEmpty() || !outgoingInterfaces.isEmpty()); + if (capabilitiesSupported + && (m_incomingCapabilities & outgoingInterfaces).isEmpty() + && (m_outgoingCapabilities & incomingInterfaces).isEmpty() + ) { + qCWarning(KDECONNECT_CORE) << "not loading " << pluginName << "because of unmatched capabilities"; + unsupportedPlugins.append(pluginName); + continue; + } - if (isPluginEnabled) { + if (pluginEnabled) { KdeConnectPlugin* plugin = m_plugins.take(pluginName); - QStringList incomingInterfaces, outgoingInterfaces; - if (plugin) { - incomingInterfaces = m_pluginsByIncomingInterface.keys(plugin); - outgoingInterfaces = m_pluginsByOutgoingInterface.keys(plugin); - } else { - const KPluginMetaData service = loader->getPluginInfo(pluginName); - incomingInterfaces = KPluginMetaData::readStringList(service.rawData(), "X-KdeConnect-SupportedPackageType"); - outgoingInterfaces = KPluginMetaData::readStringList(service.rawData(), "X-KdeConnect-OutgoingPackageType"); - } - - //If we don't find intersection with the received on one end and the sent on the other, we don't - //let the plugin stay - //Also, if no capabilities are specified on the other end, we don't apply this optimizaton, as - //we asume that the other client doesn't know about capabilities. - if (!m_incomingCapabilities.isEmpty() && !m_outgoingCapabilities.isEmpty() - && (m_incomingCapabilities & outgoingInterfaces.toSet()).isEmpty() - && (m_outgoingCapabilities & incomingInterfaces.toSet()).isEmpty() - ) { - delete plugin; - continue; - } if (!plugin) { plugin = loader->instantiatePluginForDevice(pluginName, this); @@ -159,6 +159,7 @@ foreach(const QString& interface, outgoingInterfaces) { newPluginsByOutgoingInterface.insert(interface, plugin); } + newPluginMap[pluginName] = plugin; } } @@ -166,17 +167,30 @@ //Erase all left plugins in the original map (meaning that we don't want //them anymore, otherwise they would have been moved to the newPluginMap) + const QStringList newSupportedIncomingInterfaces = supportedIncomingInterfaces.toList(); + const QStringList newSupportedOutgoingInterfaces = supportedOutgoingInterfaces.toList(); + const bool capabilitiesChanged = (m_pluginsByOutgoingInterface != newPluginsByOutgoingInterface + || m_supportedIncomingInterfaces != newSupportedIncomingInterfaces); qDeleteAll(m_plugins); m_plugins = newPluginMap; - m_pluginsByIncomingInterface = newPluginsByIncomingInterface; + m_supportedIncomingInterfaces = newSupportedIncomingInterfaces; + m_supportedOutgoingInterfaces = newSupportedOutgoingInterfaces; m_pluginsByOutgoingInterface = newPluginsByOutgoingInterface; + m_pluginsByIncomingInterface = newPluginsByIncomingInterface; + m_unsupportedPlugins = unsupportedPlugins; Q_FOREACH(KdeConnectPlugin* plugin, m_plugins) { plugin->connected(); } - Q_EMIT pluginsChanged(); + if (capabilitiesChanged && isReachable() && isPaired()) + { + NetworkPackage np(PACKAGE_TYPE_CAPABILITIES); + np.set("IncomingCapabilities", newSupportedIncomingInterfaces); + np.set("OutgoingCapabilities", newSupportedOutgoingInterfaces); + sendPackage(np); + } } QString Device::pluginsConfigFile() const @@ -263,9 +277,9 @@ { //qCDebug(KDECONNECT_CORE) << "Adding link to" << id() << "via" << link->provider(); - m_protocolVersion = identityPackage.get("protocolVersion"); + m_protocolVersion = identityPackage.get("protocolVersion", -1); if (m_protocolVersion != NetworkPackage::ProtocolVersion) { - qWarning() << m_deviceName << "- warning, device uses a different protocol version" << m_protocolVersion << "expected" << NetworkPackage::ProtocolVersion; + qCWarning(KDECONNECT_CORE) << m_deviceName << "- warning, device uses a different protocol version" << m_protocolVersion << "expected" << NetworkPackage::ProtocolVersion; } connect(link, SIGNAL(destroyed(QObject*)), @@ -287,6 +301,8 @@ qSort(m_deviceLinks.begin(), m_deviceLinks.end(), lessThan); if (m_deviceLinks.size() == 1) { + m_incomingCapabilities = identityPackage.get("IncomingCapabilities", QStringList()).toSet(); + m_outgoingCapabilities = identityPackage.get("OutgoingCapabilities", QStringList()).toSet(); reloadPlugins(); //Will load the plugins Q_EMIT reachableStatusChanged(); } else { @@ -338,7 +354,7 @@ bool wantsPair = np.get("pair"); if (wantsPair == isPaired()) { - qCDebug(KDECONNECT_CORE) << "Already" << (wantsPair? "paired":"unpaired"); + qCDebug(KDECONNECT_CORE) << m_deviceName << "already" << (wantsPair? "paired":"unpaired"); if (m_pairStatus == Device::Requested) { m_pairStatus = Device::NotPaired; m_pairingTimeut.stop(); @@ -391,6 +407,15 @@ } + } else if (np.type() == PACKAGE_TYPE_CAPABILITIES) { + QSet newIncomingCapabilities = np.get("IncomingCapabilities", QStringList()).toSet(); + QSet newOutgoingCapabilities = np.get("OutgoingCapabilities", QStringList()).toSet(); + + if (newOutgoingCapabilities != m_outgoingCapabilities || newIncomingCapabilities != m_incomingCapabilities) { + m_incomingCapabilities = newIncomingCapabilities; + m_outgoingCapabilities = newOutgoingCapabilities; + reloadPlugins(); + } } else if (isPaired()) { QList plugins = m_pluginsByIncomingInterface.values(np.type()); foreach(KdeConnectPlugin* plugin, plugins) { @@ -464,6 +489,18 @@ } +DeviceLink::ConnectionStarted Device::connectionSource() const +{ + DeviceLink::ConnectionStarted ret = DeviceLink::Remotely; + Q_FOREACH(DeviceLink* link, m_deviceLinks) { + if(link->connectionSource() == DeviceLink::ConnectionStarted::Locally) { + ret = DeviceLink::ConnectionStarted::Locally; + break; + } + } + return ret; +} + QStringList Device::availableLinks() const { QStringList sl; @@ -473,7 +510,7 @@ return sl; } -Device::DeviceType Device::str2type(QString deviceType) { +Device::DeviceType Device::str2type(const QString &deviceType) { if (deviceType == "desktop") return Desktop; if (deviceType == "laptop") return Laptop; if (deviceType == "smartphone" || deviceType == "phone") return Phone; @@ -512,7 +549,7 @@ QString status = (reachable? (paired? QStringLiteral("connected") : QStringLiteral("disconnected")) : QStringLiteral("trusted")); QString type = type2str(deviceType); - return type+"-"+status; + return type+'-'+status; } void Device::setName(const QString &name) @@ -522,3 +559,31 @@ Q_EMIT nameChanged(name); } } + +Device::PairStatus Device::pairStatus() const +{ + return m_pairStatus; +} + +KdeConnectPlugin* Device::plugin(const QString& pluginName) const +{ + return m_plugins[pluginName]; +} + +void Device::setPluginEnabled(const QString& pluginName, bool enabled) +{ + KConfigGroup pluginStates = KSharedConfig::openConfig(pluginsConfigFile())->group("Plugins"); + + const QString enabledKey = pluginName + QStringLiteral("Enabled"); + pluginStates.writeEntry(enabledKey, enabled); + reloadPlugins(); +} + +bool Device::isPluginEnabled(const QString& pluginName) const +{ + const QString enabledKey = pluginName + QStringLiteral("Enabled"); + KConfigGroup pluginStates = KSharedConfig::openConfig(pluginsConfigFile())->group("Plugins"); + + return (pluginStates.hasKey(enabledKey) ? pluginStates.readEntry(enabledKey, false) + : PluginLoader::instance()->getPluginInfo(pluginName).isEnabledByDefault()); +} diff -Nru kdeconnect-plasma-0.0+git20150810/core/device.h kdeconnect-plasma-0.9+git20160315/core/device.h --- kdeconnect-plasma-0.0+git20150810/core/device.h 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/core/device.h 2016-03-15 09:57:50.000000000 +0000 @@ -30,6 +30,7 @@ #include #include "networkpackage.h" +#include "backends/devicelink.h" class DeviceLink; class KdeConnectPlugin; @@ -45,7 +46,9 @@ Q_PROPERTY(QString statusIconName READ statusIconName) Q_PROPERTY(bool isReachable READ isReachable NOTIFY reachableStatusChanged) Q_PROPERTY(bool isPaired READ isPaired NOTIFY pairingChanged) + Q_PROPERTY(QStringList unsupportedPlugins READ unsupportedPlugins NOTIFY pluginsChanged) +public: enum PairStatus { NotPaired, Requested, @@ -60,10 +63,7 @@ Phone, Tablet, }; - static DeviceType str2type(QString deviceType); - static QString type2str(DeviceType deviceType); -public: /** * Restores the @p device from the saved configuration * @@ -86,6 +86,7 @@ QString type() const { return type2str(m_deviceType); }; QString iconName() const; QString statusIconName() const; + QStringList unsupportedPlugins() const { return m_unsupportedPlugins; } //Add and remove links void addLink(const NetworkPackage& identityPackage, DeviceLink*); @@ -102,6 +103,14 @@ Q_SCRIPTABLE QString pluginsConfigFile() const; + KdeConnectPlugin* plugin(const QString& pluginName) const; + void setPluginEnabled(const QString& pluginName, bool enabled); + bool isPluginEnabled(const QString& pluginName) const; + + PairStatus pairStatus() const; + + DeviceLink::ConnectionStarted connectionSource() const; + public Q_SLOTS: ///sends a @p np package to the device virtual bool sendPackage(NetworkPackage& np); @@ -130,6 +139,9 @@ 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(); @@ -150,9 +162,11 @@ QMultiMap m_pluginsByOutgoingInterface; QTimer m_pairingTimeut; - const QSet m_incomingCapabilities; - const QSet m_outgoingCapabilities; - + QSet m_incomingCapabilities; + QSet m_outgoingCapabilities; + QStringList m_supportedIncomingInterfaces; + QStringList m_supportedOutgoingInterfaces; + QStringList m_unsupportedPlugins; }; Q_DECLARE_METATYPE(Device*) diff -Nru kdeconnect-plasma-0.0+git20150810/core/filetransferjob.cpp kdeconnect-plasma-0.9+git20160315/core/filetransferjob.cpp --- kdeconnect-plasma-0.0+git20150810/core/filetransferjob.cpp 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/core/filetransferjob.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -33,20 +33,22 @@ : KJob() , mOrigin(origin) , mReply(Q_NULLPTR) - , mDeviceName("KDE Connect") //TODO: Actually fetch the device name + , mFrom("KDE Connect") , mDestination(destination) , mSpeedBytes(0) , mWritten(0) { Q_ASSERT(mOrigin); + Q_ASSERT(mOrigin->isReadable()); if (mDestination.scheme().isEmpty()) { - qWarning() << "Destination QUrl" << mDestination << "lacks a scheme. Setting its scheme to 'file'."; + qCWarning(KDECONNECT_CORE) << "Destination QUrl" << mDestination << "lacks a scheme. Setting its scheme to 'file'."; mDestination.setScheme("file"); } if (size >= 0) { setTotalAmount(Bytes, size); } + setCapabilities(Killable); qCDebug(KDECONNECT_CORE) << "FileTransferJob Downloading payload to" << destination; } @@ -59,9 +61,8 @@ void FileTransferJob::doStart() { - description(this, i18n("Receiving file over KDE-Connect"), - QPair(i18nc("File transfer origin", "From"), - mDeviceName) + description(this, i18n("Receiving file over KDE Connect"), + QPair(i18nc("File transfer origin", "From"), mFrom) ); if (mDestination.isLocalFile() && QFile::exists(mDestination.toLocalFile())) { @@ -77,12 +78,14 @@ { setProcessedAmount(Bytes, 0); mTime = QTime::currentTime(); - description(this, i18n("Receiving file over KDE-Connect"), - QPair(i18nc("File transfer origin", "From"), - QString(mDeviceName)), + description(this, i18n("Receiving file over KDE Connect"), + QPair(i18nc("File transfer origin", "From"), mFrom), QPair(i18nc("File transfer destination", "To"), mDestination.toLocalFile())); - mReply = Daemon::instance()->networkAccessManager()->put(QNetworkRequest(mDestination), mOrigin.data()); + QNetworkRequest req(mDestination); + req.setHeader(QNetworkRequest::ContentLengthHeader, totalAmount(Bytes)); + mReply = Daemon::instance()->networkAccessManager()->put(req, mOrigin.data()); + connect(mReply, &QNetworkReply::uploadProgress, this, [this](qint64 bytesSent, qint64 /*bytesTotal*/) { setProcessedAmount(Bytes, bytesSent); emitSpeed(bytesSent/mTime.elapsed()); diff -Nru kdeconnect-plasma-0.0+git20150810/core/filetransferjob.h kdeconnect-plasma-0.9+git20160315/core/filetransferjob.h --- kdeconnect-plasma-0.0+git20150810/core/filetransferjob.h 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/core/filetransferjob.h 2016-03-15 09:57:50.000000000 +0000 @@ -33,13 +33,15 @@ #include #include +#include "kdeconnectcore_export.h" + /** * @short It will stream a device into a url destination * * Given a QIODevice, the file transfer job will use the system's QNetworkAccessManager * for putting the stream into the requested location. */ -class FileTransferJob +class KDECONNECTCORE_EXPORT FileTransferJob : public KJob { Q_OBJECT @@ -53,7 +55,7 @@ FileTransferJob(const QSharedPointer& origin, qint64 size, const QUrl &destination); virtual void start() Q_DECL_OVERRIDE; QUrl destination() const { return mDestination; } - void setDeviceName(const QString &deviceName) { mDeviceName = deviceName; } + void setOriginName(QString from) { mFrom = from; } private Q_SLOTS: void doStart(); @@ -67,7 +69,7 @@ QSharedPointer mOrigin; QNetworkReply* mReply; - QString mDeviceName; + QString mFrom; QUrl mDestination; QTime mTime; qulonglong mSpeedBytes; diff -Nru kdeconnect-plasma-0.0+git20150810/core/kdeconnectconfig.cpp kdeconnect-plasma-0.9+git20160315/core/kdeconnectconfig.cpp --- kdeconnect-plasma-0.0+git20150810/core/kdeconnectconfig.cpp 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/core/kdeconnectconfig.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include @@ -114,7 +113,7 @@ QString KdeConnectConfig::name() { - QString defaultName = qgetenv("USER") + "@" + QHostInfo::localHostName(); + QString defaultName = qgetenv("USER") + '@' + QHostInfo::localHostName(); d->config->beginGroup("myself"); QString name = d->config->value("name", defaultName).toString(); d->config->endGroup(); @@ -172,7 +171,7 @@ return list; } -void KdeConnectConfig::addTrustedDevice(QString id, QString name, QString type, QString publicKey) +void KdeConnectConfig::addTrustedDevice(const QString &id, const QString &name, const QString &type, const QString &publicKey) { d->config->beginGroup("trustedDevices"); d->config->beginGroup(id); @@ -186,7 +185,7 @@ QDir().mkpath(deviceConfigDir(id).path()); } -KdeConnectConfig::DeviceInfo KdeConnectConfig::getTrustedDevice(QString id) +KdeConnectConfig::DeviceInfo KdeConnectConfig::getTrustedDevice(const QString &id) { d->config->beginGroup("trustedDevices"); d->config->beginGroup(id); @@ -201,7 +200,7 @@ return info; } -void KdeConnectConfig::removeTrustedDevice(QString deviceId) +void KdeConnectConfig::removeTrustedDevice(const QString &deviceId) { d->config->beginGroup("trustedDevices"); d->config->beginGroup(deviceId); @@ -212,13 +211,13 @@ //We do not remove the config files. } -QDir KdeConnectConfig::deviceConfigDir(QString deviceId) +QDir KdeConnectConfig::deviceConfigDir(const QString &deviceId) { QString deviceConfigPath = baseConfigDir().absoluteFilePath(deviceId); return QDir(deviceConfigPath); } -QDir KdeConnectConfig::pluginConfigDir(QString deviceId, QString pluginName) +QDir KdeConnectConfig::pluginConfigDir(const QString &deviceId, const QString &pluginName) { QString deviceConfigPath = baseConfigDir().absoluteFilePath(deviceId); QString pluginConfigDir = QDir(deviceConfigPath).absoluteFilePath(pluginName); diff -Nru kdeconnect-plasma-0.0+git20150810/core/kdeconnectconfig.h kdeconnect-plasma-0.9+git20160315/core/kdeconnectconfig.h --- kdeconnect-plasma-0.0+git20150810/core/kdeconnectconfig.h 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/core/kdeconnectconfig.h 2016-03-15 09:57:50.000000000 +0000 @@ -56,16 +56,16 @@ */ QStringList trustedDevices(); //list of ids - void removeTrustedDevice(QString id); - void addTrustedDevice(QString id, QString name, QString type, QString publicKey); - 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); /* * Paths for config files, there is no guarantee the directories already exist */ QDir baseConfigDir(); - QDir deviceConfigDir(QString deviceId); - QDir pluginConfigDir(QString deviceId, QString pluginName); //Used by KdeConnectPluginConfig + QDir deviceConfigDir(const QString &deviceId); + QDir pluginConfigDir(const QString &deviceId, const QString &pluginName); //Used by KdeConnectPluginConfig private: KdeConnectConfig(); diff -Nru kdeconnect-plasma-0.0+git20150810/core/kdeconnectpluginconfig.cpp kdeconnect-plasma-0.9+git20160315/core/kdeconnectpluginconfig.cpp --- kdeconnect-plasma-0.0+git20150810/core/kdeconnectpluginconfig.cpp 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/core/kdeconnectpluginconfig.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -22,6 +22,8 @@ #include #include +#include +#include #include "kdeconnectconfig.h" @@ -29,6 +31,7 @@ { QDir mConfigDir; QSettings* mConfig; + QDBusMessage signal; }; KdeConnectPluginConfig::KdeConnectPluginConfig(const QString& deviceId, const QString& pluginName) @@ -38,6 +41,9 @@ QDir().mkpath(d->mConfigDir.path()); d->mConfig = new QSettings(d->mConfigDir.absoluteFilePath("config"), QSettings::IniFormat); + + d->signal = QDBusMessage::createSignal("/kdeconnect/"+deviceId+"/"+pluginName, "org.kde.kdeconnect.config", "configChanged"); + QDBusConnection::sessionBus().connect("", "/kdeconnect/"+deviceId+"/"+pluginName, "org.kde.kdeconnect.config", "configChanged", this, SLOT(slotConfigChanged())); } KdeConnectPluginConfig::~KdeConnectPluginConfig() @@ -56,8 +62,44 @@ return d->mConfig->value(key, defaultValue); } +QVariantList KdeConnectPluginConfig::getList(const QString& key, + const QVariantList& defaultValue) +{ + QVariantList list; + d->mConfig->sync(); // note: need sync() to get recent changes signalled from other process + int size = d->mConfig->beginReadArray(key); + if (size < 1) { + d->mConfig->endArray(); + return defaultValue; + } + for (int i = 0; i < size; ++i) { + d->mConfig->setArrayIndex(i); + list << d->mConfig->value("value"); + } + d->mConfig->endArray(); + return list; +} + void KdeConnectPluginConfig::set(const QString& key, const QVariant& value) { d->mConfig->setValue(key, value); d->mConfig->sync(); + QDBusConnection::sessionBus().send(d->signal); +} + +void KdeConnectPluginConfig::setList(const QString& key, const QVariantList& list) +{ + d->mConfig->beginWriteArray(key); + for (int i = 0; i < list.size(); ++i) { + d->mConfig->setArrayIndex(i); + d->mConfig->setValue("value", list.at(i)); + } + d->mConfig->endArray(); + d->mConfig->sync(); + QDBusConnection::sessionBus().send(d->signal); +} + +void KdeConnectPluginConfig::slotConfigChanged() +{ + Q_EMIT configChanged(); } diff -Nru kdeconnect-plasma-0.0+git20150810/core/kdeconnectpluginconfig.h kdeconnect-plasma-0.9+git20160315/core/kdeconnectpluginconfig.h --- kdeconnect-plasma-0.0+git20150810/core/kdeconnectpluginconfig.h 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/core/kdeconnectpluginconfig.h 2016-03-15 09:57:50.000000000 +0000 @@ -21,18 +21,20 @@ #ifndef KDECONNECTPLUGINCONFIG_H #define KDECONNECTPLUGINCONFIG_H +#include #include #include #include #include -#include "default_args.h" #include "kdeconnectcore_export.h" struct KdeConnectPluginConfigPrivate; -class KDECONNECTCORE_EXPORT KdeConnectPluginConfig +class KDECONNECTCORE_EXPORT KdeConnectPluginConfig : public QObject { + Q_OBJECT + public: KdeConnectPluginConfig(const QString& deviceId, const QString& pluginName); ~KdeConnectPluginConfig(); @@ -49,6 +51,12 @@ void set(const QString& key, const QVariant& value); /** + * Store a list of values in this config object under the array name + * specified in key. + */ + void setList(const QString& key, const QVariantList& list); + + /** * Read a key-value pair from this config object */ QVariant get(const QString& key, const QVariant& defaultValue); @@ -56,10 +64,17 @@ /** * Convenience method that will convert the QVariant to whatever type for you */ - template T get(const QString& key, const T& defaultValue = default_arg::get()) { + template T get(const QString& key, const T& defaultValue = {}) { return get(key, QVariant(defaultValue)).template value(); //Important note: Awesome template syntax is awesome } + QVariantList getList(const QString& key, const QVariantList& defaultValue = {}); + +private Q_SLOTS: + void slotConfigChanged(); + +Q_SIGNALS: + void configChanged(); private: QScopedPointer d; diff -Nru kdeconnect-plasma-0.0+git20150810/core/kdeconnectplugin.cpp kdeconnect-plasma-0.9+git20160315/core/kdeconnectplugin.cpp --- kdeconnect-plasma-0.0+git20150810/core/kdeconnectplugin.cpp 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/core/kdeconnectplugin.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -20,7 +20,7 @@ #include "kdeconnectplugin.h" -#include +#include "core_debug.h" struct KdeConnectPluginPrivate { @@ -37,7 +37,7 @@ d->mDevice = qvariant_cast< Device* >(args.at(0)); d->mPluginName = args.at(1).toString(); d->mOutgoingTypes = args.at(2).toStringList().toSet(); - d->mConfig = 0; + d->mConfig = nullptr; } KdeConnectPluginConfig* KdeConnectPlugin::config() const @@ -69,9 +69,9 @@ bool KdeConnectPlugin::sendPackage(NetworkPackage& np) const { if(!d->mOutgoingTypes.contains(np.type())) { - qWarning() << metaObject()->className() << "tried to send an unsupported package type" << np.type() << ". Supported:" << d->mOutgoingTypes; + qCWarning(KDECONNECT_CORE) << metaObject()->className() << "tried to send an unsupported package type" << np.type() << ". Supported:" << d->mOutgoingTypes; return false; } -// qWarning() << metaObject()->className() << "sends" << np.type() << ". Supported:" << d->mOutgoingTypes; +// qCWarning(KDECONNECT_CORE) << metaObject()->className() << "sends" << np.type() << ". Supported:" << d->mOutgoingTypes; return d->mDevice->sendPackage(np); } diff -Nru kdeconnect-plasma-0.0+git20150810/core/networkpackage.cpp kdeconnect-plasma-0.9+git20160315/core/networkpackage.cpp --- kdeconnect-plasma-0.0+git20150810/core/networkpackage.cpp 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/core/networkpackage.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -59,8 +59,8 @@ np->set("deviceName", config->name()); np->set("deviceType", config->deviceType()); np->set("protocolVersion", NetworkPackage::ProtocolVersion); - np->set("SupportedIncomingInterfaces", PluginLoader::instance()->incomingInterfaces().join(",")); - np->set("SupportedOutgoingInterfaces", PluginLoader::instance()->outgoingInterfaces().join(",")); + np->set("IncomingCapabilities", PluginLoader::instance()->incomingInterfaces()); + np->set("OutgoingCapabilities", PluginLoader::instance()->outgoingInterfaces()); //qCDebug(KDECONNECT_CORE) << "createIdentityPackage" << np->serialize(); } diff -Nru kdeconnect-plasma-0.0+git20150810/core/networkpackage.h kdeconnect-plasma-0.9+git20160315/core/networkpackage.h --- kdeconnect-plasma-0.0+git20150810/core/networkpackage.h 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/core/networkpackage.h 2016-03-15 09:57:50.000000000 +0000 @@ -33,7 +33,6 @@ #include #include "kdeconnectcore_export.h" -#include "default_args.h" class FileTransferJob; @@ -52,7 +51,7 @@ const static QCA::EncryptionAlgorithm EncryptionAlgorithm; const static int ProtocolVersion; - NetworkPackage(const QString& type); + explicit NetworkPackage(const QString& type); static void createIdentityPackage(NetworkPackage*); @@ -69,7 +68,7 @@ const QVariantMap& body() const { return mBody; } //Get and set info from body. Note that id and type can not be accessed through these. - template T get(const QString& key, const T& defaultValue = default_arg::get()) const { + template T get(const QString& key, const T& defaultValue = {}) const { return mBody.value(key,defaultValue).template value(); //Important note: Awesome template syntax is awesome } template void set(const QString& key, const T& value) { mBody[key] = QVariant(value); } diff -Nru kdeconnect-plasma-0.0+git20150810/core/networkpackagetypes.h kdeconnect-plasma-0.9+git20160315/core/networkpackagetypes.h --- kdeconnect-plasma-0.0+git20150810/core/networkpackagetypes.h 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/core/networkpackagetypes.h 2016-03-15 09:57:50.000000000 +0000 @@ -23,6 +23,7 @@ #define PACKAGE_TYPE_IDENTITY QLatin1String("kdeconnect.identity") #define PACKAGE_TYPE_PAIR QLatin1String("kdeconnect.pair") +#define PACKAGE_TYPE_CAPABILITIES QLatin1String("kdeconnect.capabilities") #define PACKAGE_TYPE_ENCRYPTED QLatin1String("kdeconnect.encrypted") #endif // NETWORKPACKAGETYPES_H diff -Nru kdeconnect-plasma-0.0+git20150810/core/pluginloader.cpp kdeconnect-plasma-0.9+git20160315/core/pluginloader.cpp --- kdeconnect-plasma-0.0+git20150810/core/pluginloader.cpp 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/core/pluginloader.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -80,7 +80,7 @@ return ret; } - qCDebug(KDECONNECT_CORE) << "Loaded plugin:" << service.pluginId(); + //qCDebug(KDECONNECT_CORE) << "Loaded plugin:" << service.pluginId(); return ret; } diff -Nru kdeconnect-plasma-0.0+git20150810/daemon/CMakeLists.txt kdeconnect-plasma-0.9+git20160315/daemon/CMakeLists.txt --- kdeconnect-plasma-0.0+git20150810/daemon/CMakeLists.txt 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/daemon/CMakeLists.txt 2016-03-15 09:57:50.000000000 +0000 @@ -7,9 +7,15 @@ add_executable(kdeconnectd kdeconnectd.cpp) target_link_libraries(kdeconnectd kdeconnectcore KF5::KIOWidgets KF5::DBusAddons KF5::Notifications KF5::I18n Qt5::Widgets) +ecm_mark_nongui_executable(kdeconnectd) +if(TelepathyQt5_FOUND AND TelepathyQt5Service_FOUND) + target_link_libraries(kdeconnectd connectcm) +endif() + 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 -Nru kdeconnect-plasma-0.0+git20150810/daemon/kdeconnectd.cpp kdeconnect-plasma-0.9+git20160315/daemon/kdeconnectd.cpp --- kdeconnect-plasma-0.0+git20150810/daemon/kdeconnectd.cpp 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/daemon/kdeconnectd.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -18,7 +18,6 @@ * along with this program. If not, see . */ -#include #include #include @@ -35,9 +34,23 @@ #include "core/device.h" #include "kdeconnect-version.h" +#ifdef HAVE_TELEPATHY +#include "kdeconnecttelepathyprotocolfactory.h" +#endif + + +#ifndef Q_OS_WIN +#include +#endif + static int sigtermfd[2]; const static char deadbeef = 1; + + +// TODO: Implement for Windows. +#ifndef Q_OS_WIN struct sigaction action; +#endif void sighandler(int signum) { @@ -50,6 +63,8 @@ void initializeTermHandlers(QCoreApplication* app, Daemon* daemon) { +// TODO: Implement for Windows. +#ifndef Q_OS_WIN ::socketpair(AF_UNIX, SOCK_STREAM, 0, sigtermfd); QSocketNotifier* snTerm = new QSocketNotifier(sigtermfd[1], QSocketNotifier::Read, app); QObject::connect(snTerm, SIGNAL(activated(int)), daemon, SLOT(deleteLater())); @@ -58,8 +73,9 @@ sigemptyset(&action.sa_mask); action.sa_flags = 0; - sigaction(SIGTERM, &action, NULL); - sigaction(SIGINT, &action, NULL); + sigaction(SIGTERM, &action, nullptr); + sigaction(SIGINT, &action, nullptr); +#endif } class DesktopDaemon : public Daemon @@ -115,6 +131,11 @@ Daemon* daemon = new DesktopDaemon; QObject::connect(daemon, SIGNAL(destroyed(QObject*)), &app, SLOT(quit())); initializeTermHandlers(&app, daemon); + +#ifdef HAVE_TELEPATHY + //keep a reference to the KTP CM so that we can register on DBus + auto telepathyPlugin = KDEConnectTelepathyProtocolFactory::interface(); +#endif return app.exec(); } diff -Nru kdeconnect-plasma-0.0+git20150810/daemon/kdeconnectd.desktop.cmake kdeconnect-plasma-0.9+git20160315/daemon/kdeconnectd.desktop.cmake --- kdeconnect-plasma-0.0+git20150810/daemon/kdeconnectd.desktop.cmake 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/daemon/kdeconnectd.desktop.cmake 2016-03-15 09:57:50.000000000 +0000 @@ -1,27 +1,36 @@ [Desktop Entry] -Type=Service -Exec=${CMAKE_INSTALL_PREFIX}/${LIBEXEC_INSTALL_DIR}/kdeconnectd +Type=Application +Exec=${LIBEXEC_INSTALL_DIR}/kdeconnectd X-KDE-StartupNotify=false X-KDE-autostart-phase=0 X-GNOME-Autostart-enabled=true -OnlyShowIn=KDE;GNOME;Unity;XFCE +OnlyShowIn=KDE;GNOME;Unity;XFCE; NoDisplay=true Name=KDEConnect daemon +Name[ar]=عفريت KDEConnect +Name[ast]=Degorriu KDEConnect Name[bg]=Услуга KDE Connect Name[ca]=Dimoni del KDEConnect +Name[ca@valencia]=Dimoni del KDEConnect Name[cs]=Démon KDE Connect +Name[da]=KDEConnect-dæmon Name[de]=KDE-Connect-Dienst +Name[el]=Δαίμονας του KDEConnect Name[en_GB]=KDEConnect daemon Name[es]=Demonio de KDE Connect Name[fi]=KDEConnect-taustapalvelu +Name[fr]=Démon KDE Connect Name[gl]=Servizo de KDE Connect Name[hu]=KDEConnect szolgáltatás Name[it]=Demone KDE Connect +Name[ko]=KDE Connect 데몬 Name[nl]=KDEConnect-daemon +Name[nn]=KDEConnect-teneste Name[pl]=Usługa KDEConnect Name[pt]=Serviço do KDE Connect Name[pt_BR]=Serviço do KDE Connect +Name[ru]=Служба KDE Connect Name[sk]=KDEConnect démon Name[sv]=Demon för KDE-anslut Name[tr]=KDEConnect süreci diff -Nru kdeconnect-plasma-0.0+git20150810/daemon/kdeconnect.desktop kdeconnect-plasma-0.9+git20160315/daemon/kdeconnect.desktop --- kdeconnect-plasma-0.0+git20150810/daemon/kdeconnect.desktop 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/daemon/kdeconnect.desktop 2016-03-15 09:57:50.000000000 +0000 @@ -10,12 +10,16 @@ X-KDE-Kded-phase=1 Name=KDE Connect +Name[ar]=كدي المتّصل +Name[ast]=KDE Connect Name[bg]=KDE Connect Name[bs]=Konekcija KDE Name[ca]=KDE Connect +Name[ca@valencia]=KDE Connect Name[cs]=KDE Connect Name[da]=KDE Connect Name[de]=KDE-Connect +Name[el]=KDE Connect Name[en_GB]=KDE Connect Name[es]=KDE Connect Name[fi]=KDE Connect @@ -25,25 +29,30 @@ Name[it]=KDE Connect Name[ko]=KDE Connect Name[nl]=KDE Connect +Name[nn]=KDE Connect Name[pl]=KDE Connect Name[pt]=KDE Connect Name[pt_BR]=KDE Connect Name[ro]=KDE Connect Name[ru]=KDE Connect Name[sk]=KDE Connect -Name[sv]=KDE anslut +Name[sv]=KDE-anslut Name[tr]=KDE Bağlan Name[uk]=З’єднання KDE Name[x-test]=xxKDE Connectxx Name[zh_CN]=KDE Connect Comment=Connect KDE with your smartphone +Comment[ar]=أوصل كدي بهاتفك الذّكيّ +Comment[ast]=Coneuta KDE col to preséu Comment[bg]=Свържете КДЕ с вашия смартфон Comment[bs]=Konektujte se na KDE sa Vašim mobitelom Comment[ca]=Connecta el KDE amb el vostre telèfon intel·ligent +Comment[ca@valencia]=Connecta el KDE amb el vostre telèfon intel·ligent Comment[cs]=Propojte KDE s vaším telefonem Comment[da]=Forbind KDE med din smartphone Comment[de]=KDE mit Ihren Smartphone verbinden +Comment[el]=Σύνδεση του KDE με το έξυπνο τηλέφωνό σας Comment[en_GB]=Connect KDE with your smartphone Comment[es]=Conecte KDE con su teléfono móvil Comment[fi]=Yhdistä KDE älypuhelimeesi @@ -53,6 +62,7 @@ Comment[it]=Connetti KDE con il tuo smartphone Comment[ko]=KDE와 스마트폰 연결 Comment[nl]=KDE met uw smartphone verbinden +Comment[nn]=Kopla KDE til smarttelefonen din Comment[pl]=Podłącz swój smartfon do KDE Comment[pt]=Ligue o KDE ao seu telemóvel Comment[pt_BR]=Conecte o KDE ao seu celular diff -Nru kdeconnect-plasma-0.0+git20150810/daemon/org.kde.kdeconnect.service.in kdeconnect-plasma-0.9+git20160315/daemon/org.kde.kdeconnect.service.in --- kdeconnect-plasma-0.0+git20150810/daemon/org.kde.kdeconnect.service.in 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/daemon/org.kde.kdeconnect.service.in 2016-03-15 09:57:50.000000000 +0000 @@ -1,3 +1,3 @@ [D-BUS Service] Name=org.kde.kdeconnect -Exec=${CMAKE_INSTALL_PREFIX}/${LIBEXEC_INSTALL_DIR}/kdeconnectd +Exec=@KDE_INSTALL_FULL_LIBEXECDIR@/kdeconnectd diff -Nru kdeconnect-plasma-0.0+git20150810/debian/changelog kdeconnect-plasma-0.9+git20160315/debian/changelog --- kdeconnect-plasma-0.0+git20150810/debian/changelog 2015-08-11 10:25:14.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/debian/changelog 2016-03-19 19:56:33.000000000 +0000 @@ -1,3 +1,13 @@ +kdeconnect-plasma (0.9+git20160315-0ubuntu1~ubuntu16.04~ppa1) xenial; urgency=medium + + * New upstream release (adopting upstream version number) + * Fixed install file to include translations, changed filenames + for new desktop files and incremented so version numbers + * Fixed install file for typo (kdeconnectfileitemaction.so) + * Adding usr/share/doc/HTML/en/kdeconnect/ to install file + + -- Clive Johnston Wed, 13 Jan 2016 21:53:49 +0000 + kdeconnect-plasma (0.0+git20150810-0ubuntu1) wily; urgency=medium * New upstream snapshot to fix functionality. diff -Nru kdeconnect-plasma-0.0+git20150810/debian/control kdeconnect-plasma-0.9+git20160315/debian/control --- kdeconnect-plasma-0.0+git20150810/debian/control 2015-08-11 10:22:45.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/debian/control 2016-03-15 09:57:58.000000000 +0000 @@ -1,11 +1,12 @@ Source: kdeconnect-plasma Section: kde Priority: optional -Maintainer: Debian/Kubuntu Qt/KDE Maintainers -XSBC-Original-Maintainer: Maintainer: David Suárez +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Debian/Kubuntu Qt/KDE Maintainers Build-Depends: cmake, debhelper (>= 9.0.0), extra-cmake-modules, + kdoctools-dev, kio-dev, kwayland-dev, libfakekey-dev, @@ -18,19 +19,21 @@ libqca-qt5-2-dev, libqjson-dev, libqt5x11extras5-dev, + libtelepathy-qt5-dev, libxtst-dev, pkg-config, pkg-kde-tools, qtbase5-dev, qtdeclarative5-dev Standards-Version: 3.9.6 -Homepage: https://projects.kde.org/projects/playground/base/kdeconnect-kde +Homepage: https://community.kde.org/KDEConnect Vcs-Browser: http://anonscm.debian.org/cgit/pkg-kde/kde-extras/kdeconnect-plasma.git/ Vcs-Git: git://anonscm.debian.org/pkg-kde/kde-extras/kdeconnect-plasma.git Package: kdeconnect-plasma Architecture: any -Depends: libqca-qt5-2-plugins, +Depends: kde-cli-tools, + libqca-qt5-2-plugins, plasma-workspace, sshfs, ${misc:Depends}, diff -Nru kdeconnect-plasma-0.0+git20150810/debian/kdeconnect-plasma.install kdeconnect-plasma-0.9+git20160315/debian/kdeconnect-plasma.install --- kdeconnect-plasma-0.0+git20150810/debian/kdeconnect-plasma.install 2015-08-11 10:22:45.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/debian/kdeconnect-plasma.install 2016-03-15 09:57:54.000000000 +0000 @@ -1,39 +1,35 @@ etc/xdg/autostart/kdeconnectd.desktop usr/bin/kdeconnect-cli usr/lib/*/libexec/kdeconnectd -usr/lib/*/libkdeconnectcore.so.0 -usr/lib/*/libkdeconnectcore.so.0.8.0 -usr/lib/*/libkdeconnectinterfaces.so.0 -usr/lib/*/libkdeconnectinterfaces.so.0.8.0 -usr/lib/*/libkdeconnectpluginkcm.so.0 -usr/lib/*/libkdeconnectpluginkcm.so.0.8.0 +usr/lib/*/libkdeconnectcore.so.0* +usr/lib/*/libkdeconnectinterfaces.so.0* +usr/lib/*/libkdeconnectpluginkcm.so.0* usr/lib/*/qt5/plugins/kcm_kdeconnect.so usr/lib/*/qt5/plugins/kdeconnect/* +usr/lib/*/qt5/plugins/kdeconnect_notifications_config.so usr/lib/*/qt5/plugins/kdeconnect_pausemusic_config.so +usr/lib/*/qt5/plugins/kdeconnect_runcommand_config.so usr/lib/*/qt5/plugins/kdeconnect_share_config.so -usr/lib/*/qt5/plugins/kdeconnectfiletiemaction.so +usr/lib/*/qt5/plugins/kdeconnectfileitemaction.so usr/lib/*/qt5/plugins/kio_kdeconnect.so usr/lib/*/qt5/qml/org/kde/kdeconnect/libkdeconnectdeclarativeplugin.so usr/lib/*/qt5/qml/org/kde/kdeconnect/qmldir -usr/share/applications/kdeconnect-non-plasma.desktop -usr/share/applications/kdeconnect.desktop +usr/share/applications/org.kde.kdeconnect.kcm.desktop +usr/share/applications/org.kde.kdeconnect.nonplasma.desktop +usr/share/doc/HTML/en/kdeconnect usr/share/dbus-1/services/org.kde.kdeconnect.service -usr/share/icons/hicolor/128x128/apps/kdeconnect.png -usr/share/icons/hicolor/16x16/apps/kdeconnect.png -usr/share/icons/hicolor/22x22/apps/kdeconnect.png -usr/share/icons/hicolor/256x256/apps/kdeconnect.png -usr/share/icons/hicolor/32x32/apps/kdeconnect.png -usr/share/icons/hicolor/32x32/status/laptop-connected.png -usr/share/icons/hicolor/32x32/status/laptop-disconnected.png -usr/share/icons/hicolor/32x32/status/laptop-trusted.png -usr/share/icons/hicolor/32x32/status/smartphone-connected.png -usr/share/icons/hicolor/32x32/status/smartphone-disconnected.png -usr/share/icons/hicolor/32x32/status/smartphone-trusted.png -usr/share/icons/hicolor/32x32/status/tablet-connected.png -usr/share/icons/hicolor/32x32/status/tablet-disconnected.png -usr/share/icons/hicolor/32x32/status/tablet-trusted.png -usr/share/icons/hicolor/48x48/apps/kdeconnect.png -usr/share/icons/hicolor/64x64/apps/kdeconnect.png +usr/share/doc/HTML/en/kdeconnect/index.cache.bz2 +usr/share/doc/HTML/en/kdeconnect/index.docbook +usr/share/icons/hicolor/*/apps/kdeconnect.png +usr/share/icons/hicolor/*/status/laptop-connected.png +usr/share/icons/hicolor/*/status/laptop-disconnected.png +usr/share/icons/hicolor/*/status/laptop-trusted.png +usr/share/icons/hicolor/*/status/smartphone-connected.png +usr/share/icons/hicolor/*/status/smartphone-disconnected.png +usr/share/icons/hicolor/*/status/smartphone-trusted.png +usr/share/icons/hicolor/*/status/tablet-connected.png +usr/share/icons/hicolor/*/status/tablet-disconnected.png +usr/share/icons/hicolor/*/status/tablet-trusted.png usr/share/icons/hicolor/scalable/apps/kdeconnect.svgz usr/share/icons/hicolor/scalable/status/laptop-connected.svg usr/share/icons/hicolor/scalable/status/laptop-disconnected.svg @@ -47,7 +43,9 @@ usr/share/knotifications5/kdeconnect.notifyrc usr/share/kservices5/kcm_kdeconnect.desktop usr/share/kservices5/kdeconnect.protocol +usr/share/kservices5/kdeconnect_notifications_config.desktop usr/share/kservices5/kdeconnect_pausemusic_config.desktop +usr/share/kservices5/kdeconnect_runcommand_config.desktop usr/share/kservices5/kdeconnect_share_config.desktop usr/share/kservices5/kdeconnectsendfile.desktop usr/share/kservices5/plasma-kdeconnect.desktop @@ -55,6 +53,7 @@ usr/share/plasma/plasmoids/org.kde.kdeconnect/contents/ui/Battery.qml usr/share/plasma/plasmoids/org.kde.kdeconnect/contents/ui/CompactRepresentation.qml usr/share/plasma/plasmoids/org.kde.kdeconnect/contents/ui/DeviceDelegate.qml +usr/share/plasma/plasmoids/org.kde.kdeconnect/contents/ui/FindMyPhone.qml usr/share/plasma/plasmoids/org.kde.kdeconnect/contents/ui/FullRepresentation.qml usr/share/plasma/plasmoids/org.kde.kdeconnect/contents/ui/Sftp.qml usr/share/plasma/plasmoids/org.kde.kdeconnect/contents/ui/main.qml diff -Nru kdeconnect-plasma-0.0+git20150810/debian/kdeconnect-plasma.lintian-overrides kdeconnect-plasma-0.9+git20160315/debian/kdeconnect-plasma.lintian-overrides --- kdeconnect-plasma-0.0+git20150810/debian/kdeconnect-plasma.lintian-overrides 2015-08-11 10:18:48.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/debian/kdeconnect-plasma.lintian-overrides 2016-03-15 09:57:54.000000000 +0000 @@ -1,3 +1,3 @@ -desktop-command-not-in-package usr/share/applications/kdeconnect.desktop kcmshell5 -desktop-command-not-in-package usr/share/applications/kdeconnect-non-plasma.desktop plasmawindowed -package-name-doesnt-match-sonames libkdeconnectcore0 libkdeconnectinterfaces0 +kdeconnect-plasma: package-name-doesnt-match-sonames libkdeconnectcore0 libkdeconnectinterfaces0 libkdeconnectpluginkcm0 +kdeconnect-plasma: desktop-command-not-in-package usr/share/applications/org.kde.kdeconnect.nonplasma.desktop plasmawindowed +kdeconnect-plasma: desktop-command-not-in-package usr/share/applications/org.kde.kdeconnect.kcm.desktop kcmshell5 diff -Nru kdeconnect-plasma-0.0+git20150810/debian/watch kdeconnect-plasma-0.9+git20160315/debian/watch --- kdeconnect-plasma-0.0+git20150810/debian/watch 2015-08-11 10:18:48.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/debian/watch 2016-03-15 09:57:54.000000000 +0000 @@ -1,3 +1,3 @@ version=3 -http://download.kde.org/unstable/kdeconnect/([\d\.]+)/src/kdeconnect-kde-([\d\.]+)\.tar\.xz \ No newline at end of file +http://download.kde.org/unstable/kdeconnect/([\d\.]+)/src/kdeconnect-kde-(.+)\.tar\.xz diff -Nru kdeconnect-plasma-0.0+git20150810/.directory kdeconnect-plasma-0.9+git20160315/.directory --- kdeconnect-plasma-0.0+git20150810/.directory 2015-08-10 16:22:54.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/.directory 1970-01-01 01:00:00.000000000 +0100 @@ -1,3 +0,0 @@ -[Dolphin] -Timestamp=2015,8,10,8,22,54 -Version=3 diff -Nru kdeconnect-plasma-0.0+git20150810/doc/CMakeLists.txt kdeconnect-plasma-0.9+git20160315/doc/CMakeLists.txt --- kdeconnect-plasma-0.0+git20150810/doc/CMakeLists.txt 1970-01-01 01:00:00.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/doc/CMakeLists.txt 2016-03-15 09:57:50.000000000 +0000 @@ -0,0 +1 @@ +kdoctools_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR kdeconnect) diff -Nru kdeconnect-plasma-0.0+git20150810/doc/index.docbook kdeconnect-plasma-0.9+git20160315/doc/index.docbook --- kdeconnect-plasma-0.0+git20150810/doc/index.docbook 1970-01-01 01:00:00.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/doc/index.docbook 2016-03-15 09:57:50.000000000 +0000 @@ -0,0 +1,55 @@ + + + +]> + +
+ +KDE Connect + +&Aleix.Pol; + + + +2015-10-19 +0.9 + + +KDE +Connect +phone +remote +device +pair + + + + + +KDE Connect + +You can use this dialog to configure which devices we're paired to and what we're sharing. The UI is divided in 2 main parts: + + +Devices List + +It contains a list of devices separated between paired and unpaired. Select one to pair it and when it's paired, configure it. + + + +Device Configuration + +It offers a list of the available plugins related to the device. These plugins will correspond to the different features available for the device. This is useful mainly for knowing what plugins are available and, in case there's some information that should not be shared with a device, explicitly disable it. + + + +General interaction with the devices + +KDE Connect doesn't offer a central place to interact with your devices. It's designed to integrate properly with your operating system, making it possible to share files from the different applications or integrating with the notification system to display information. + + + + +
diff -Nru kdeconnect-plasma-0.0+git20150810/fileitemactionplugin/CMakeLists.txt kdeconnect-plasma-0.9+git20160315/fileitemactionplugin/CMakeLists.txt --- kdeconnect-plasma-0.0+git20150810/fileitemactionplugin/CMakeLists.txt 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/fileitemactionplugin/CMakeLists.txt 2016-03-15 09:57:50.000000000 +0000 @@ -3,11 +3,11 @@ add_definitions(-DTRANSLATION_DOMAIN="kdeconnect-fileitemaction") include_directories(${CMAKE_SOURCE_DIR}) -add_library(kdeconnectfiletiemaction MODULE sendfileitemaction.cpp) -target_link_libraries(kdeconnectfiletiemaction +add_library(kdeconnectfileitemaction MODULE sendfileitemaction.cpp) +target_link_libraries(kdeconnectfileitemaction KF5::KIOWidgets KF5::I18n kdeconnectinterfaces ) -install(TARGETS kdeconnectfiletiemaction DESTINATION ${PLUGIN_INSTALL_DIR}) +install(TARGETS kdeconnectfileitemaction DESTINATION ${PLUGIN_INSTALL_DIR}) install(FILES kdeconnectsendfile.desktop DESTINATION ${SERVICES_INSTALL_DIR}) diff -Nru kdeconnect-plasma-0.0+git20150810/fileitemactionplugin/kdeconnectsendfile.desktop kdeconnect-plasma-0.9+git20160315/fileitemactionplugin/kdeconnectsendfile.desktop --- kdeconnect-plasma-0.0+git20150810/fileitemactionplugin/kdeconnectsendfile.desktop 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/fileitemactionplugin/kdeconnectsendfile.desktop 2016-03-15 09:57:50.000000000 +0000 @@ -1,12 +1,16 @@ [Desktop Entry] Type=Service Name=Send file via KDE Connect service +Name[ar]=أرسل ملفًّا عبر خدمة «كدي المتّصل» +Name[ast]=Unviar ficheru pente'l serviciu KDE Connect Name[bg]=Изпращане на файл през услугата KDE Connect Name[bs]=Pošalji datoteku putem KDE Connect servisa Name[ca]=Envia un fitxer a través del servei KDE Connect +Name[ca@valencia]=Envia un fitxer a través del servei KDE Connect Name[cs]=Poslat soubor přes službu KDE Connect Name[da]=Send fil via KDE Connect-tjeneste Name[de]=Datei mit KDE-Connect -Dienst versenden +Name[el]=Αποστολή αρχείου μέσω της υπηρεσίας KDE Connect Name[en_GB]=Send file via KDE Connect service Name[es]=Enviar archivo usando el servicio KDE Connect Name[fi]=Lähetä tiedosto KDE Connect -palvelulla @@ -16,9 +20,11 @@ Name[it]=Invia un file tramite il servizio KDE Connect Name[ko]=KDE Connect 서비스로 파일 보내기 Name[nl]=Bestand via de service KDE Connect versturen +Name[nn]=Send fil med KDE Connect-tenesta Name[pl]=Wyślij plik przez usługę KDE Connect Name[pt]=Enviar um ficheiro pelo serviço KDE Connect Name[pt_BR]=Enviar arquivo pelo serviço KDE Connect +Name[ru]=Отправить файл через KDE Connect Name[sk]=Poslať súbor cez službu KDE Connect Name[sv]=Skicka fil via KDE:s anslutningstjänst Name[tr]=KDE Bağlantı servisi ile dosya gönderin @@ -27,12 +33,16 @@ Name[zh_CN]=通过 KDE Connect 服务发送文件 X-KDE-Library=kdeconnectfiletiemaction X-KDE-Submenu=Connect +X-KDE-Submenu[ar]=اتّصل,اتصل +X-KDE-Submenu[ast]=Coneutar X-KDE-Submenu[bg]=Свързване X-KDE-Submenu[bs]=Uspostavi vezu X-KDE-Submenu[ca]=Connecta +X-KDE-Submenu[ca@valencia]=Connecta X-KDE-Submenu[cs]=Připojit X-KDE-Submenu[da]=Forbind X-KDE-Submenu[de]=Verbinden +X-KDE-Submenu[el]=Σύνδεση X-KDE-Submenu[en_GB]=Connect X-KDE-Submenu[es]=Conectar X-KDE-Submenu[fi]=Yhdistä @@ -42,9 +52,11 @@ X-KDE-Submenu[it]=Connetti X-KDE-Submenu[ko]=연결 X-KDE-Submenu[nl]=Verbinden +X-KDE-Submenu[nn]=Kopla til X-KDE-Submenu[pl]=Połącz X-KDE-Submenu[pt]=Ligar X-KDE-Submenu[pt_BR]=Conectar +X-KDE-Submenu[ru]=KDE Connect X-KDE-Submenu[sk]=Pripojiť X-KDE-Submenu[sv]=Anslut X-KDE-Submenu[tr]=Bağlan diff -Nru kdeconnect-plasma-0.0+git20150810/fileitemactionplugin/sendfileitemaction.h kdeconnect-plasma-0.9+git20160315/fileitemactionplugin/sendfileitemaction.h --- kdeconnect-plasma-0.0+git20150810/fileitemactionplugin/sendfileitemaction.h 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/fileitemactionplugin/sendfileitemaction.h 2016-03-15 09:57:50.000000000 +0000 @@ -35,7 +35,7 @@ Q_OBJECT public: SendFileItemAction(QObject* parent, const QVariantList &args); - virtual QList< QAction* > actions(const KFileItemListProperties& fileItemInfos, QWidget* parentWidget); + virtual QList< QAction* > actions(const KFileItemListProperties& fileItemInfos, QWidget* parentWidget) override; private Q_SLOTS: void sendFile(); diff -Nru kdeconnect-plasma-0.0+git20150810/interfaces/CMakeLists.txt kdeconnect-plasma-0.9+git20160315/interfaces/CMakeLists.txt --- kdeconnect-plasma-0.0+git20150810/interfaces/CMakeLists.txt 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/interfaces/CMakeLists.txt 2016-03-15 09:57:50.000000000 +0000 @@ -38,11 +38,13 @@ geninterface(${CMAKE_SOURCE_DIR}/plugins/battery/batterydbusinterface.h devicebatteryinterface) geninterface(${CMAKE_SOURCE_DIR}/plugins/sftp/sftpplugin.h devicesftpinterface) geninterface(${CMAKE_SOURCE_DIR}/plugins/notifications/notificationsdbusinterface.h devicenotificationsinterface) +geninterface(${CMAKE_SOURCE_DIR}/plugins/findmyphone/findmyphoneplugin.h devicefindmyphoneinterface) geninterface(${CMAKE_SOURCE_DIR}/plugins/notifications/notification.h notificationinterface) geninterface(${CMAKE_SOURCE_DIR}/plugins/mprisremote/mprisremoteplugin.h mprisremoteinterface) geninterface(${CMAKE_SOURCE_DIR}/plugins/remotecontrol/remotecontrolplugin.h remotecontrolinterface) geninterface(${CMAKE_SOURCE_DIR}/plugins/lockdevice/lockdeviceplugin.h lockdeviceinterface) + add_library(kdeconnectinterfaces SHARED ${libkdeconnect_SRC}) set_target_properties(kdeconnectinterfaces PROPERTIES VERSION ${KDECONNECT_VERSION} diff -Nru kdeconnect-plasma-0.0+git20150810/interfaces/dbusinterfaces.cpp kdeconnect-plasma-0.9+git20160315/interfaces/dbusinterfaces.cpp --- kdeconnect-plasma-0.0+git20150810/interfaces/dbusinterfaces.cpp 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/interfaces/dbusinterfaces.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -23,6 +23,9 @@ QString DaemonDbusInterface::activatedService() { static const QString service = "org.kde.kdeconnect"; QDBusConnection::sessionBus().interface()->startService(service); + if (!QDBusConnection::sessionBus().interface()->isValid()) { + qWarning() << "error activating kdeconnectd:" << QDBusConnection::sessionBus().interface()->lastError(); + } return service; } @@ -134,4 +137,15 @@ { } +FindMyPhoneDeviceDbusInterface::FindMyPhoneDeviceDbusInterface(const QString& deviceId, QObject* parent): + OrgKdeKdeconnectDeviceFindmyphoneInterface(DaemonDbusInterface::activatedService(), "/modules/kdeconnect/devices/" + deviceId + "/findmyphone", QDBusConnection::sessionBus(), parent) +{ +} + +FindMyPhoneDeviceDbusInterface::~FindMyPhoneDeviceDbusInterface() +{ +} + + + #include "dbusinterfaces.moc" diff -Nru kdeconnect-plasma-0.0+git20150810/interfaces/dbusinterfaces.h kdeconnect-plasma-0.9+git20160315/interfaces/dbusinterfaces.h --- kdeconnect-plasma-0.0+git20150810/interfaces/dbusinterfaces.h 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/interfaces/dbusinterfaces.h 2016-03-15 09:57:50.000000000 +0000 @@ -27,6 +27,7 @@ #include "interfaces/deviceinterface.h" #include "interfaces/devicebatteryinterface.h" #include "interfaces/devicesftpinterface.h" +#include "interfaces/devicefindmyphoneinterface.h" #include "interfaces/devicenotificationsinterface.h" #include "interfaces/notificationinterface.h" #include "interfaces/mprisremoteinterface.h" @@ -42,10 +43,13 @@ { Q_OBJECT public: - DaemonDbusInterface(QObject* parent = 0); + explicit DaemonDbusInterface(QObject* parent = nullptr); virtual ~DaemonDbusInterface(); static QString activatedService(); + +Q_SIGNALS: + void deviceAdded(const QString &id); }; class KDECONNECTINTERFACES_EXPORT DeviceDbusInterface @@ -57,7 +61,7 @@ Q_PROPERTY(bool isPaired READ isPaired NOTIFY pairingChangedProxy) public: - DeviceDbusInterface(const QString& deviceId, QObject* parent = 0); + explicit DeviceDbusInterface(const QString& deviceId, QObject* parent = nullptr); virtual ~DeviceDbusInterface(); Q_SCRIPTABLE QString id() const; @@ -75,7 +79,7 @@ { Q_OBJECT public: - DeviceBatteryDbusInterface(const QString& deviceId, QObject* parent = 0); + explicit DeviceBatteryDbusInterface(const QString& deviceId, QObject* parent = nullptr); virtual ~DeviceBatteryDbusInterface(); }; @@ -84,7 +88,7 @@ { Q_OBJECT public: - DeviceNotificationsDbusInterface(const QString& deviceId, QObject* parent = 0); + explicit DeviceNotificationsDbusInterface(const QString& deviceId, QObject* parent = nullptr); virtual ~DeviceNotificationsDbusInterface(); }; @@ -93,16 +97,17 @@ { Q_OBJECT public: - NotificationDbusInterface(const QString& deviceId, const QString& notificationId, QObject* parent = 0); + NotificationDbusInterface(const QString& deviceId, const QString& notificationId, QObject* parent = nullptr); virtual ~NotificationDbusInterface(); }; + class KDECONNECTINTERFACES_EXPORT SftpDbusInterface : public OrgKdeKdeconnectDeviceSftpInterface { Q_OBJECT public: - SftpDbusInterface(const QString& deviceId, QObject* parent = 0); + explicit SftpDbusInterface(const QString& deviceId, QObject* parent = nullptr); virtual ~SftpDbusInterface(); }; @@ -119,7 +124,7 @@ Q_PROPERTY(int volume READ volume WRITE setVolume NOTIFY propertiesChangedProxy) Q_PROPERTY(int position READ position WRITE setPosition NOTIFY propertiesChangedProxy) public: - MprisDbusInterface(const QString& deviceId, QObject* parent = 0); + explicit MprisDbusInterface(const QString& deviceId, QObject* parent = nullptr); virtual ~MprisDbusInterface(); Q_SIGNALS: @@ -131,7 +136,7 @@ { Q_OBJECT public: - RemoteControlDbusInterface(const QString& deviceId, QObject* parent = 0); + explicit RemoteControlDbusInterface(const QString& deviceId, QObject* parent = nullptr); ~RemoteControlDbusInterface() override; }; @@ -141,11 +146,20 @@ Q_OBJECT Q_PROPERTY(bool isLocked READ isLocked WRITE setIsLocked NOTIFY lockedChangedProxy) public: - LockDeviceDbusInterface(const QString& deviceId, QObject* parent = 0); + explicit LockDeviceDbusInterface(const QString& deviceId, QObject* parent = nullptr); virtual ~LockDeviceDbusInterface(); Q_SIGNALS: void lockedChangedProxy(bool isLocked); }; +class KDECONNECTINTERFACES_EXPORT FindMyPhoneDeviceDbusInterface + : public OrgKdeKdeconnectDeviceFindmyphoneInterface +{ + Q_OBJECT +public: + explicit FindMyPhoneDeviceDbusInterface(const QString& deviceId, QObject* parent = nullptr); + virtual ~FindMyPhoneDeviceDbusInterface(); +}; + #endif diff -Nru kdeconnect-plasma-0.0+git20150810/interfaces/devicesmodel.cpp kdeconnect-plasma-0.9+git20160315/interfaces/devicesmodel.cpp --- kdeconnect-plasma-0.0+git20150810/interfaces/devicesmodel.cpp 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/interfaces/devicesmodel.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -34,6 +34,10 @@ Q_LOGGING_CATEGORY(KDECONNECT_INTERFACES, "kdeconnect.interfaces"); +static QString createId() { return QCoreApplication::instance()->applicationName()+QString::number(QCoreApplication::applicationPid()); } + +Q_GLOBAL_STATIC_WITH_ARGS(QString, s_keyId, (createId())); + DevicesModel::DevicesModel(QObject *parent) : QAbstractListModel(parent) , m_dbusInterface(new DaemonDbusInterface(this)) @@ -42,9 +46,9 @@ //new ModelTest(this, this); - connect(this, SIGNAL(rowsRemoved(QModelIndex, int, int)), + connect(this, SIGNAL(rowsRemoved(QModelIndex,int,int)), this, SIGNAL(rowsChanged())); - connect(this, SIGNAL(rowsInserted(QModelIndex, int, int)), + connect(this, SIGNAL(rowsInserted(QModelIndex,int,int)), this, SIGNAL(rowsChanged())); connect(m_dbusInterface, SIGNAL(deviceAdded(QString)), @@ -59,7 +63,8 @@ connect(watcher, &QDBusServiceWatcher::serviceRegistered, this, &DevicesModel::refreshDeviceList); connect(watcher, &QDBusServiceWatcher::serviceUnregistered, this, &DevicesModel::clearDevices); - refreshDeviceList(); + //refresh the view, acquireDiscoveryMode if necessary + setDisplayFilter(NoFilter); } QHash< int, QByteArray > DevicesModel::roleNames() const @@ -74,6 +79,7 @@ DevicesModel::~DevicesModel() { + m_dbusInterface->releaseDiscoveryMode(*s_keyId); } int DevicesModel::rowForDevice(const QString& id) const @@ -147,6 +153,13 @@ void DevicesModel::setDisplayFilter(int flags) { m_displayFilter = (StatusFilterFlag)flags; + + const bool onlyReachable = (m_displayFilter & StatusFilterFlag::Reachable); + if (onlyReachable) + m_dbusInterface->releaseDiscoveryMode(*s_keyId); + else + m_dbusInterface->acquireDiscoveryMode(*s_keyId); + refreshDeviceList(); } @@ -267,7 +280,7 @@ DeviceDbusInterface* DevicesModel::getDevice(int row) const { if (row < 0 || row >= m_deviceList.size()) { - return NULL; + return nullptr; } return m_deviceList[row]; diff -Nru kdeconnect-plasma-0.0+git20150810/interfaces/devicesmodel.h kdeconnect-plasma-0.9+git20160315/interfaces/devicesmodel.h --- kdeconnect-plasma-0.0+git20150810/interfaces/devicesmodel.h 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/interfaces/devicesmodel.h 2016-03-15 09:57:50.000000000 +0000 @@ -57,17 +57,17 @@ Q_FLAGS(StatusFilterFlags) Q_ENUMS(StatusFilterFlag) - DevicesModel(QObject *parent = 0); + explicit DevicesModel(QObject *parent = nullptr); virtual ~DevicesModel(); void setDisplayFilter(int flags); int displayFilter() const; - virtual QVariant data(const QModelIndex& index, int role) const; - virtual int rowCount(const QModelIndex& parent = QModelIndex()) const; + virtual QVariant data(const QModelIndex& index, int role) const override; + virtual int rowCount(const QModelIndex& parent = QModelIndex()) const override; Q_SCRIPTABLE DeviceDbusInterface* getDevice(int row) const; - virtual QHash roleNames() const; + virtual QHash roleNames() const override; private Q_SLOTS: void deviceAdded(const QString& id); diff -Nru kdeconnect-plasma-0.0+git20150810/interfaces/devicessortproxymodel.cpp kdeconnect-plasma-0.9+git20160315/interfaces/devicessortproxymodel.cpp --- kdeconnect-plasma-0.0+git20150810/interfaces/devicessortproxymodel.cpp 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/interfaces/devicessortproxymodel.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -34,12 +34,12 @@ QSortFilterProxyModel::setSourceModel(devicesModel); if (devicesModel) { setSortRole(DevicesModel::StatusModelRole); - connect(devicesModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(sourceDataChanged(QModelIndex,QModelIndex))); + connect(devicesModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(sourceDataChanged())); } sort(0); } -void DevicesSortProxyModel::sourceDataChanged(QModelIndex , QModelIndex ) +void DevicesSortProxyModel::sourceDataChanged() { sort(0); } diff -Nru kdeconnect-plasma-0.0+git20150810/interfaces/devicessortproxymodel.h kdeconnect-plasma-0.9+git20160315/interfaces/devicessortproxymodel.h --- kdeconnect-plasma-0.0+git20150810/interfaces/devicessortproxymodel.h 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/interfaces/devicessortproxymodel.h 2016-03-15 09:57:50.000000000 +0000 @@ -30,13 +30,13 @@ { Q_OBJECT public: - DevicesSortProxyModel(DevicesModel* devicesModel = Q_NULLPTR); - virtual bool lessThan(const QModelIndex& left, const QModelIndex& right) const; - virtual bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const; - virtual void setSourceModel(QAbstractItemModel *sourceModel); + explicit DevicesSortProxyModel(DevicesModel* devicesModel = Q_NULLPTR); + virtual bool lessThan(const QModelIndex& left, const QModelIndex& right) const override; + virtual bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const override; + virtual void setSourceModel(QAbstractItemModel *sourceModel) override; public Q_SLOTS: - void sourceDataChanged(QModelIndex,QModelIndex); + void sourceDataChanged(); }; #endif // DEVICESSORTPROXYMODEL_H diff -Nru kdeconnect-plasma-0.0+git20150810/interfaces/interfaces_debug.h kdeconnect-plasma-0.9+git20160315/interfaces/interfaces_debug.h --- kdeconnect-plasma-0.0+git20150810/interfaces/interfaces_debug.h 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/interfaces/interfaces_debug.h 2016-03-15 09:57:50.000000000 +0000 @@ -25,4 +25,4 @@ Q_DECLARE_LOGGING_CATEGORY(KDECONNECT_INTERFACES) -#endif //KDECONNECT_INTERFACE_DEBUG_H \ No newline at end of file +#endif //KDECONNECT_INTERFACE_DEBUG_H diff -Nru kdeconnect-plasma-0.0+git20150810/interfaces/modeltest.cpp kdeconnect-plasma-0.9+git20160315/interfaces/modeltest.cpp --- kdeconnect-plasma-0.0+git20150810/interfaces/modeltest.cpp 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/interfaces/modeltest.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -21,10 +21,10 @@ ** ****************************************************************************/ -#include - #include "modeltest.h" +#include + Q_DECLARE_METATYPE(QModelIndex) /*! @@ -34,28 +34,28 @@ { Q_ASSERT(model); - connect(model, SIGNAL(columnsAboutToBeInserted(const QModelIndex &, int, int)), + connect(model, SIGNAL(columnsAboutToBeInserted(QModelIndex,int,int)), this, SLOT(runAllTests())); - connect(model, SIGNAL(columnsAboutToBeRemoved(const QModelIndex &, int, int)), + connect(model, SIGNAL(columnsAboutToBeRemoved(QModelIndex,int,int)), this, SLOT(runAllTests())); - connect(model, SIGNAL(columnsInserted(const QModelIndex &, int, int)), + connect(model, SIGNAL(columnsInserted(QModelIndex,int,int)), this, SLOT(runAllTests())); - connect(model, SIGNAL(columnsRemoved(const QModelIndex &, int, int)), + connect(model, SIGNAL(columnsRemoved(QModelIndex,int,int)), this, SLOT(runAllTests())); - connect(model, SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &)), + connect(model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(runAllTests())); - connect(model, SIGNAL(headerDataChanged(Qt::Orientation, int, int)), + connect(model, SIGNAL(headerDataChanged(Qt::Orientation,int,int)), this, SLOT(runAllTests())); - connect(model, SIGNAL(layoutAboutToBeChanged ()), this, SLOT(runAllTests())); - connect(model, SIGNAL(layoutChanged ()), this, SLOT(runAllTests())); - connect(model, SIGNAL(modelReset ()), this, SLOT(runAllTests())); - connect(model, SIGNAL(rowsAboutToBeInserted(const QModelIndex &, int, int)), + connect(model, SIGNAL(layoutAboutToBeChanged()), this, SLOT(runAllTests())); + connect(model, SIGNAL(layoutChanged()), this, SLOT(runAllTests())); + connect(model, SIGNAL(modelReset()), this, SLOT(runAllTests())); + connect(model, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)), this, SLOT(runAllTests())); - connect(model, SIGNAL(rowsAboutToBeRemoved(const QModelIndex &, int, int)), + connect(model, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)), this, SLOT(runAllTests())); - connect(model, SIGNAL(rowsInserted(const QModelIndex &, int, int)), + connect(model, SIGNAL(rowsInserted(QModelIndex,int,int)), this, SLOT(runAllTests())); - connect(model, SIGNAL(rowsRemoved(const QModelIndex &, int, int)), + connect(model, SIGNAL(rowsRemoved(QModelIndex,int,int)), this, SLOT(runAllTests())); // Special checks for inserting/removing @@ -64,14 +64,14 @@ connect(model, SIGNAL(layoutChanged()), this, SLOT(layoutChanged())); - connect(model, SIGNAL(rowsAboutToBeInserted(const QModelIndex &, int, int)), - this, SLOT(rowsAboutToBeInserted(const QModelIndex &, int, int))); - connect(model, SIGNAL(rowsAboutToBeRemoved(const QModelIndex &, int, int)), - this, SLOT(rowsAboutToBeRemoved(const QModelIndex &, int, int))); - connect(model, SIGNAL(rowsInserted(const QModelIndex &, int, int)), - this, SLOT(rowsInserted(const QModelIndex &, int, int))); - connect(model, SIGNAL(rowsRemoved(const QModelIndex &, int, int)), - this, SLOT(rowsRemoved(const QModelIndex &, int, int))); + connect(model, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)), + this, SLOT(rowsAboutToBeInserted(QModelIndex,int,int))); + connect(model, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)), + this, SLOT(rowsAboutToBeRemoved(QModelIndex,int,int))); + connect(model, SIGNAL(rowsInserted(QModelIndex,int,int)), + this, SLOT(rowsInserted(QModelIndex,int,int))); + connect(model, SIGNAL(rowsRemoved(QModelIndex,int,int)), + this, SLOT(rowsRemoved(QModelIndex,int,int))); runAllTests(); } diff -Nru kdeconnect-plasma-0.0+git20150810/interfaces/modeltest.h kdeconnect-plasma-0.9+git20160315/interfaces/modeltest.h --- kdeconnect-plasma-0.0+git20150810/interfaces/modeltest.h 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/interfaces/modeltest.h 2016-03-15 09:57:50.000000000 +0000 @@ -33,7 +33,7 @@ Q_OBJECT public: - ModelTest(QAbstractItemModel *model, QObject *parent = 0); + explicit ModelTest(QAbstractItemModel *model, QObject *parent = 0); private Q_SLOTS: void nonDestructiveBasicTest(); diff -Nru kdeconnect-plasma-0.0+git20150810/interfaces/notificationsmodel.cpp kdeconnect-plasma-0.9+git20160315/interfaces/notificationsmodel.cpp --- kdeconnect-plasma-0.0+git20150810/interfaces/notificationsmodel.cpp 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/interfaces/notificationsmodel.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -32,19 +32,20 @@ NotificationsModel::NotificationsModel(QObject* parent) : QAbstractListModel(parent) - , m_dbusInterface(0) + , m_dbusInterface(nullptr) { //new ModelTest(this, this); - connect(this, SIGNAL(rowsInserted(QModelIndex, int, int)), + connect(this, SIGNAL(rowsInserted(QModelIndex,int,int)), this, SIGNAL(rowsChanged())); - connect(this, SIGNAL(rowsRemoved(QModelIndex, int, int)), + connect(this, SIGNAL(rowsRemoved(QModelIndex,int,int)), this, SIGNAL(rowsChanged())); - connect(this, SIGNAL(dataChanged(QModelIndex, QModelIndex)), + connect(this, SIGNAL(dataChanged(QModelIndex,QModelIndex)), + this, SIGNAL(anyDismissableChanged())); + connect(this, SIGNAL(rowsInserted(QModelIndex,int,int)), this, SIGNAL(anyDismissableChanged())); - QDBusServiceWatcher* watcher = new QDBusServiceWatcher(DaemonDbusInterface::activatedService(), QDBusConnection::sessionBus(), QDBusServiceWatcher::WatchForOwnerChange, this); @@ -191,12 +192,12 @@ NotificationDbusInterface* NotificationsModel::getNotification(const QModelIndex& index) const { if (!index.isValid()) { - return NULL; + return nullptr; } int row = index.row(); if (row < 0 || row >= m_notificationList.size()) { - return NULL; + return nullptr; } return m_notificationList[row]; diff -Nru kdeconnect-plasma-0.0+git20150810/interfaces/notificationsmodel.h kdeconnect-plasma-0.9+git20160315/interfaces/notificationsmodel.h --- kdeconnect-plasma-0.0+git20150810/interfaces/notificationsmodel.h 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/interfaces/notificationsmodel.h 2016-03-15 09:57:50.000000000 +0000 @@ -34,7 +34,7 @@ Q_OBJECT Q_PROPERTY(QString deviceId READ deviceId WRITE setDeviceId NOTIFY deviceIdChanged) Q_PROPERTY(int count READ rowCount NOTIFY rowsChanged) - Q_PROPERTY(bool isAnyDimissable READ isAnyDimissable NOTIFY anyDismissableChanged) + Q_PROPERTY(bool isAnyDimissable READ isAnyDimissable NOTIFY anyDismissableChanged STORED false) public: enum ModelRoles { @@ -47,19 +47,19 @@ DbusInterfaceRole, }; - NotificationsModel(QObject* parent = 0); + explicit NotificationsModel(QObject* parent = nullptr); virtual ~NotificationsModel(); QString deviceId() const; void setDeviceId(const QString& deviceId); - virtual QVariant data(const QModelIndex& index, int role) const; - virtual int rowCount(const QModelIndex& parent = QModelIndex()) const; + virtual QVariant data(const QModelIndex& index, int role) const override; + virtual int rowCount(const QModelIndex& parent = QModelIndex()) const override; NotificationDbusInterface* getNotification(const QModelIndex& index) const; Q_INVOKABLE bool isAnyDimissable() const; - virtual QHash roleNames() const; + virtual QHash roleNames() const override; public Q_SLOTS: void dismissAll(); diff -Nru kdeconnect-plasma-0.0+git20150810/kcm/CMakeLists.txt kdeconnect-plasma-0.9+git20160315/kcm/CMakeLists.txt --- kdeconnect-plasma-0.0+git20150810/kcm/CMakeLists.txt 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/kcm/CMakeLists.txt 2016-03-15 09:57:50.000000000 +0000 @@ -25,5 +25,5 @@ install(TARGETS kcm_kdeconnect DESTINATION ${PLUGIN_INSTALL_DIR}) +install(FILES org.kde.kdeconnect.kcm.desktop DESTINATION ${XDG_APPS_INSTALL_DIR}) install(FILES kcm_kdeconnect.desktop DESTINATION ${SERVICES_INSTALL_DIR}) -install(FILES kdeconnect.desktop DESTINATION ${XDG_APPS_INSTALL_DIR}) diff -Nru kdeconnect-plasma-0.0+git20150810/kcm/kcm.cpp kdeconnect-plasma-0.9+git20160315/kcm/kcm.cpp --- kdeconnect-plasma-0.0+git20150810/kcm/kcm.cpp 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/kcm/kcm.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -44,12 +44,14 @@ K_PLUGIN_FACTORY(KdeConnectKcmFactory, registerPlugin();) +static QString createId() { return QStringLiteral("kcm")+QString::number(QCoreApplication::applicationPid()); } + KdeConnectKcm::KdeConnectKcm(QWidget *parent, const QVariantList&) : KCModule(KAboutData::pluginData("kdeconnect-kcm"), parent) , kcmUi(new Ui::KdeConnectKcmUi()) , daemon(new DaemonDbusInterface(this)) , devicesModel(new DevicesModel(this)) - , currentDevice(0) + , currentDevice(nullptr) { KAboutData *about = new KAboutData("kdeconnect-kcm", i18n("KDE Connect Settings"), @@ -83,7 +85,7 @@ kcmUi->rename_edit->setText(daemon->announcedName()); setRenameMode(false); - setButtons(KCModule::NoAdditionalButton); + setButtons(KCModule::Help | KCModule::NoAdditionalButton); connect(devicesModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(resetSelection())); @@ -104,6 +106,7 @@ connect(kcmUi->renameShow_button,SIGNAL(clicked()), this, SLOT(renameShow())); + daemon->acquireDiscoveryMode(createId()); } void KdeConnectKcm::renameShow() @@ -133,11 +136,13 @@ KdeConnectKcm::~KdeConnectKcm() { + daemon->releaseDiscoveryMode(createId()); delete kcmUi; } void KdeConnectKcm::refresh() { + daemon->acquireDiscoveryMode(createId()); daemon->forceOnNetworkChange(); } @@ -151,21 +156,15 @@ void KdeConnectKcm::deviceSelected(const QModelIndex& current) { - - kcmUi->noDevicePlaceholder->setVisible(false); - if (currentDevice) { - disconnect(currentDevice,SIGNAL(pairingChanged(bool)), - this, SLOT(pairingChanged(bool))); - disconnect(currentDevice,SIGNAL(pairingFailed(QString)), - this, SLOT(pairingFailed(QString))); + disconnect(currentDevice, 0, this, 0); } //Store previous device config pluginsConfigChanged(); if (!current.isValid()) { - currentDevice = NULL; + currentDevice = nullptr; kcmUi->deviceInfo->setVisible(false); return; } @@ -173,7 +172,8 @@ currentIndex = sortProxyModel->mapToSource(current); currentDevice = devicesModel->getDevice(currentIndex.row()); - bool valid = (currentDevice != NULL && currentDevice->isValid()); + kcmUi->noDevicePlaceholder->setVisible(false); + bool valid = (currentDevice != nullptr && currentDevice->isValid()); kcmUi->deviceInfo->setVisible(valid); if (!valid) { return; @@ -197,7 +197,24 @@ kcmUi->ping_button->setVisible(false); } } + resetDeviceView(); + + connect(currentDevice, SIGNAL(pluginsChanged()), this, SLOT(resetCurrentDevice())); + connect(currentDevice, SIGNAL(pairingChanged(bool)), this, SLOT(pairingChanged(bool))); + connect(currentDevice, SIGNAL(pairingFailed(QString)), this, SLOT(pairingFailed(QString))); +} + +void KdeConnectKcm::resetCurrentDevice() +{ + const QStringList unsupportedPluginNames = currentDevice->unsupportedPlugins(); + + if (m_oldUnsupportedPluginNames != unsupportedPluginNames) { + resetDeviceView(); + } +} +void KdeConnectKcm::resetDeviceView() +{ //KPluginSelector has no way to remove a list of plugins and load another, so we need to destroy and recreate it each time delete kcmUi->pluginSelector; kcmUi->pluginSelector = new KPluginSelector(this); @@ -208,17 +225,23 @@ kcmUi->name_label->setText(currentDevice->name()); kcmUi->status_label->setText(currentDevice->isPaired()? i18n("(paired)") : i18n("(unpaired)")); - connect(currentDevice,SIGNAL(pairingChanged(bool)), - this, SLOT(pairingChanged(bool))); - connect(currentDevice,SIGNAL(pairingFailed(QString)), - this, SLOT(pairingFailed(QString))); - const QList pluginInfo = KPluginInfo::fromMetaData(KPluginLoader::findPlugins("kdeconnect/")); - KSharedConfigPtr deviceConfig = KSharedConfig::openConfig(currentDevice->pluginsConfigFile()); - kcmUi->pluginSelector->addPlugins(pluginInfo, KPluginSelector::ReadConfigFile, i18n("Plugins"), QString(), deviceConfig); + QList availablePluginInfo; + QList unsupportedPluginInfo; - connect(kcmUi->pluginSelector, SIGNAL(changed(bool)), - this, SLOT(pluginsConfigChanged())); + m_oldUnsupportedPluginNames = currentDevice->unsupportedPlugins(); + for (auto it = pluginInfo.cbegin(), itEnd = pluginInfo.cend(); it!=itEnd; ++it) { + if (m_oldUnsupportedPluginNames.contains(it->pluginName())) { + unsupportedPluginInfo.append(*it); + } else { + availablePluginInfo.append(*it); + } + } + + KSharedConfigPtr deviceConfig = KSharedConfig::openConfig(currentDevice->pluginsConfigFile()); + kcmUi->pluginSelector->addPlugins(availablePluginInfo, KPluginSelector::ReadConfigFile, i18n("Available plugins"), QString(), deviceConfig); + kcmUi->pluginSelector->addPlugins(unsupportedPluginInfo, KPluginSelector::ReadConfigFile, i18n("Plugins unsupported by the device"), QString(), deviceConfig); + connect(kcmUi->pluginSelector, SIGNAL(changed(bool)), this, SLOT(pluginsConfigChanged())); } @@ -274,7 +297,7 @@ if (!currentDevice) return; DeviceDbusInterface* auxCurrentDevice = currentDevice; - currentDevice = 0; //HACK to avoid infinite recursion (for some reason calling save on pluginselector emits changed) + currentDevice = nullptr; //HACK to avoid infinite recursion (for some reason calling save on pluginselector emits changed) kcmUi->pluginSelector->save(); currentDevice = auxCurrentDevice; diff -Nru kdeconnect-plasma-0.0+git20150810/kcm/kcm.h kdeconnect-plasma-0.9+git20160315/kcm/kcm.h --- kdeconnect-plasma-0.0+git20150810/kcm/kcm.h 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/kcm/kcm.h 2016-03-15 09:57:50.000000000 +0000 @@ -59,14 +59,18 @@ void renameShow(); void renameDone(); void setRenameMode(bool b); + void resetCurrentDevice(); private: + void resetDeviceView(); + Ui::KdeConnectKcmUi* kcmUi; DaemonDbusInterface* daemon; DevicesModel* devicesModel; DevicesSortProxyModel* sortProxyModel; DeviceDbusInterface* currentDevice; QModelIndex currentIndex; + QStringList m_oldUnsupportedPluginNames; public Q_SLOTS: void unpair(); diff -Nru kdeconnect-plasma-0.0+git20150810/kcm/kcm_kdeconnect.desktop kdeconnect-plasma-0.9+git20160315/kcm/kcm_kdeconnect.desktop --- kdeconnect-plasma-0.0+git20150810/kcm/kcm_kdeconnect.desktop 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/kcm/kcm_kdeconnect.desktop 2016-03-15 09:57:50.000000000 +0000 @@ -11,12 +11,16 @@ X-KDE-System-Settings-Parent-Category=hardware Name=KDE Connect +Name[ar]=كدي المتّصل +Name[ast]=KDE Connect Name[bg]=KDE Connect Name[bs]=Konekcija KDE Name[ca]=KDE Connect +Name[ca@valencia]=KDE Connect Name[cs]=KDE Connect Name[da]=KDE Connect Name[de]=KDE-Connect +Name[el]=KDE Connect Name[en_GB]=KDE Connect Name[es]=KDE Connect Name[fi]=KDE Connect @@ -26,43 +30,60 @@ Name[it]=KDE Connect Name[ko]=KDE Connect Name[nl]=KDE Connect +Name[nn]=KDE Connect Name[pl]=KDE Connect Name[pt]=KDE Connect Name[pt_BR]=KDE Connect Name[ro]=KDE Connect Name[ru]=KDE Connect Name[sk]=KDE Connect -Name[sv]=KDE anslut +Name[sv]=KDE-anslut Name[tr]=KDE Bağlan Name[uk]=З’єднання KDE Name[x-test]=xxKDE Connectxx Name[zh_CN]=KDE Connect Comment=Connect and sync your devices +Comment[ar]=اتّصل وزامن أجهزتك +Comment[ast]=Coneuta y sincroniza los tos preseos Comment[ca]=Connecta i sincronitza els vostres dispositius +Comment[ca@valencia]=Connecta i sincronitza els vostres dispositius Comment[cs]=Připojte a synchronizujte svá zařízení +Comment[da]=Forbind og synkronisér dine enheder Comment[de]=Verbinden und Abgleichen Ihrer Geräte +Comment[el]=Σύνδεση και συγχρονισμός των συσκευών σας +Comment[en_GB]=Connect and sync your devices Comment[es]=Conectar y sincronizar sus dispositivos Comment[fi]=Yhdistä ja synkronoi laitteitasi +Comment[fr]=Connectez et synchronisez vos périphériques Comment[gl]=Conecte e sincronice os seus dispositivos. +Comment[hu]=Csatlakoztassa és szinkronizálja eszközeit Comment[it]=Connetti e sincronizza i tuoi dispositivi +Comment[ko]=내 장치에 연결하고 동기화 Comment[nl]=Uw apparaten verbinden en synchroniseren +Comment[nn]=Kopla til og synkroniser einingar Comment[pl]=Podłącz i zsynchronizuj swoje urządzenia Comment[pt]=Ligue e sincronize os seus dispositivos Comment[pt_BR]=Conecta e sincroniza seus dispositivos +Comment[ru]=Подключение и синхронизация с мобильными устройствами Comment[sk]=Pripojiť a synchronizovať vaše zariadenia Comment[sv]=Anslut och synkronisera dina apparater Comment[tr]=Aygıtlarınıza bağlanın ve eşitleyin Comment[uk]=З’єднання і синхронізація ваших пристроїв Comment[x-test]=xxConnect and sync your devicesxx +Comment[zh_CN]=连接并同步您的设备 X-KDE-Keywords=Network,Android,Devices +X-KDE-Keywords[ar]=شبكة,أندرويد,اندرويد,جهاز,أجهزة +X-KDE-Keywords[ast]=Rede,Android,Preseos X-KDE-Keywords[bg]=Мрежа,Андроид,Устройства X-KDE-Keywords[bs]=Mreža,Android,Uređaji X-KDE-Keywords[ca]=Xarxa,Android,Dispositius +X-KDE-Keywords[ca@valencia]=Xarxa,Android,Dispositius X-KDE-Keywords[cs]=Síť,Android,Zařízení X-KDE-Keywords[da]=Netværk,Android,Enheder X-KDE-Keywords[de]=Netzwerk,Android,Geräte +X-KDE-Keywords[el]=Δίκτυο,Android,Συσκευές X-KDE-Keywords[en_GB]=Network,Android,Devices X-KDE-Keywords[es]=Red,Android,Dispositivos X-KDE-Keywords[fi]=Verkko,Android,Laitteet @@ -72,10 +93,11 @@ X-KDE-Keywords[it]=Rete,Android,Dispositivi X-KDE-Keywords[ko]=Network,Android,Devices,네트워크,안드로이드,장치 X-KDE-Keywords[nl]=Netwerk,Android,Apparaten +X-KDE-Keywords[nn]=nettverk,Android,einingar X-KDE-Keywords[pl]=Sieć,Android,Urządzenia X-KDE-Keywords[pt]=Rede,Android,Dispositivos X-KDE-Keywords[pt_BR]=Rede,Android,Dispositivos -X-KDE-Keywords[ru]=Network,Android,Devices,сеть,Андроид,устройства +X-KDE-Keywords[ru]=Network,Android,Devices,сеть,Андроид,устройства,мобильные устройства X-KDE-Keywords[sk]=Sieť,Android,Zariadenia X-KDE-Keywords[sv]=Nätverk, Android, apparater X-KDE-Keywords[tr]=Ağ,Android,Cihazlar,Aygıtlar @@ -83,4 +105,6 @@ X-KDE-Keywords[x-test]=xxNetworkxx,xxAndroidxx,xxDevicesxx X-KDE-Keywords[zh_CN]=Network,Android,Devices,网络,安卓,设备 +X-DocPath=kdeconnect/index.html + Categories=Qt;KDE;X-KDE-settings-kdeconnect; diff -Nru kdeconnect-plasma-0.0+git20150810/kcm/kcm.ui kdeconnect-plasma-0.9+git20160315/kcm/kcm.ui --- kdeconnect-plasma-0.0+git20150810/kcm/kcm.ui 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/kcm/kcm.ui 2016-03-15 09:57:50.000000000 +0000 @@ -70,7 +70,9 @@ - + + + @@ -91,7 +93,9 @@ - + + + @@ -295,7 +299,38 @@ - If you have an Android phone, make sure to install the <a href="https://play.google.com/store/apps/details?id=org.kde.kdeconnect_tp"><span style=" text-decoration: underline; color:#0000ff;">KDE Connect Android app</span></a> (also available <a href="https://f-droid.org/repository/browse/?fdid=org.kde.kdeconnect_tp"><span style=" text-decoration: underline; color:#0000ff;">from F-Droid</span></a>). + <html><head/><body><p>If you own an Android device, make sure to install the <a href="https://play.google.com/store/apps/details?id=org.kde.kdeconnect_tp"><span style=" text-decoration: underline; color:#0000ff;">KDE Connect Android app</span></a> (also available <a href="https://f-droid.org/repository/browse/?fdid=org.kde.kdeconnect_tp"><span style=" text-decoration: underline; color:#0000ff;">from F-Droid</span></a>) and it should appear in the list.</p></body></html> + + + Qt::RichText + + + Qt::AlignCenter + + + true + + + 40 + + + true + + + Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse + + + + + + + + 0 + 0 + + + + <html><head/><body><p>If you are having problems, visit the <a href="https://community.kde.org/KDEConnect"><span style=" text-decoration: underline; color:#0000ff;">KDE Connect Community wiki</span></a> for help.</p></body></html> Qt::RichText diff -Nru kdeconnect-plasma-0.0+git20150810/kcm/kdeconnect.desktop kdeconnect-plasma-0.9+git20160315/kcm/kdeconnect.desktop --- kdeconnect-plasma-0.0+git20150810/kcm/kdeconnect.desktop 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/kcm/kdeconnect.desktop 1970-01-01 01:00:00.000000000 +0100 @@ -1,51 +0,0 @@ -[Desktop Entry] -Type=Application -Icon=kdeconnect -Terminal=false -Exec=kcmshell5 kcm_kdeconnect -Name=KDE Connect -Name[bg]=KDE Connect -Name[bs]=Konekcija KDE -Name[ca]=KDE Connect -Name[cs]=KDE Connect -Name[da]=KDE Connect -Name[de]=KDE-Connect -Name[en_GB]=KDE Connect -Name[es]=KDE Connect -Name[fi]=KDE Connect -Name[fr]=KDE Connect -Name[gl]=KDE Connect -Name[hu]=KDE csatlakozás -Name[it]=KDE Connect -Name[ko]=KDE Connect -Name[nl]=KDE Connect -Name[pl]=KDE Connect -Name[pt]=KDE Connect -Name[pt_BR]=KDE Connect -Name[ro]=KDE Connect -Name[ru]=KDE Connect -Name[sk]=KDE Connect -Name[sv]=KDE anslut -Name[tr]=KDE Bağlan -Name[uk]=З’єднання KDE -Name[x-test]=xxKDE Connectxx -Name[zh_CN]=KDE Connect -GenericName=Connect and sync your devices -GenericName[ca]=Connecta i sincronitza els vostres dispositius -GenericName[cs]=Připojte a synchronizujte svá zařízení -GenericName[de]=Verbinden und Abgleichen Ihrer Geräte -GenericName[es]=Conectar y sincronizar sus dispositivos -GenericName[fi]=Yhdistä ja synkronoi laitteitasi -GenericName[gl]=Conecte e sincronice os seus dispositivos -GenericName[it]=Connetti e sincronizza i tuoi dispositivi -GenericName[nl]=Uw apparaten verbinden en synchroniseren -GenericName[pl]=Podłącz i zsynchronizuj swoje urządzenia -GenericName[pt]=Ligue e sincronize os seus dispositivos -GenericName[pt_BR]=Conecta e sincroniza seus dispositivos -GenericName[sk]=Pripojiť a synchronizovať vaše zariadenia -GenericName[sv]=Anslut och synkronisera dina apparater -GenericName[tr]=Aygıtlarınıza bağlanın ve eşitleyin -GenericName[uk]=З’єднання і синхронізація ваших пристроїв -GenericName[x-test]=xxConnect and sync your devicesxx -Categories=Qt;KDE;Settings;HardwareSettings; -NotShowIn=KDE; diff -Nru kdeconnect-plasma-0.0+git20150810/kcm/org.kde.kdeconnect.kcm.desktop kdeconnect-plasma-0.9+git20160315/kcm/org.kde.kdeconnect.kcm.desktop --- kdeconnect-plasma-0.0+git20150810/kcm/org.kde.kdeconnect.kcm.desktop 1970-01-01 01:00:00.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/kcm/org.kde.kdeconnect.kcm.desktop 2016-03-15 09:57:50.000000000 +0000 @@ -0,0 +1,63 @@ +[Desktop Entry] +Type=Application +Icon=kdeconnect +Terminal=false +Exec=kcmshell5 kcm_kdeconnect +Name=KDE Connect Settings +Name[ar]=إعدادات كدي المتّصل +Name[ast]=Axustes KDE Connect +Name[ca]=Arranjament del KDE Connect +Name[ca@valencia]=Arranjament del KDE Connect +Name[cs]=Nastavení KDE Connect +Name[da]=Indstilling af KDE Connect +Name[de]=KDE-Connect-Einstellungen +Name[el]=Ρυθμίσεις KDE Connect +Name[en_GB]=KDE Connect Settings +Name[es]=Ajustes de KDE Connect +Name[fi]=KDE Connectin asetukset +Name[gl]=Configuración de KDE Connect +Name[hu]=A KDE Connect beállításai +Name[it]=Impostazioni di KDE Connect +Name[ko]=KDE Connect 설정 +Name[nl]=Instellingen van KDE Connect +Name[pl]=Ustawienia KDE Connect +Name[pt]=Configuração do KDE Connect +Name[pt_BR]=Configurações do KDE Connect +Name[ru]=Настройка KDE Connect +Name[sk]=Nastavenia KDE Connect +Name[sv]=Inställning av KDE-anslut +Name[tr]=KDE Bağlantı Ayarları +Name[uk]=Параметри KDE Connect +Name[x-test]=xxKDE Connect Settingsxx +Name[zh_CN]=KDE Connect 设置 +GenericName=Connect and sync your devices +GenericName[ar]=اتّصل وزامن أجهزتك +GenericName[ast]=Coneuta y sincroniza los tos preseos +GenericName[ca]=Connecta i sincronitza els vostres dispositius +GenericName[ca@valencia]=Connecta i sincronitza els vostres dispositius +GenericName[cs]=Připojte a synchronizujte svá zařízení +GenericName[da]=Forbind og synkronisér dine enheder +GenericName[de]=Verbinden und Abgleichen Ihrer Geräte +GenericName[el]=Σύνδεση και συγχρονισμός των συσκευών σας +GenericName[en_GB]=Connect and sync your devices +GenericName[es]=Conectar y sincronizar sus dispositivos +GenericName[fi]=Yhdistä ja synkronoi laitteitasi +GenericName[fr]=Connectez et synchronisez vos périphériques +GenericName[gl]=Conecte e sincronice os seus dispositivos +GenericName[hu]=Csatlakoztassa és szinkronizálja eszközeit +GenericName[it]=Connetti e sincronizza i tuoi dispositivi +GenericName[ko]=내 장치에 연결하고 동기화 +GenericName[nl]=Uw apparaten verbinden en synchroniseren +GenericName[nn]=Kopla til og synkroniser einingar +GenericName[pl]=Podłącz i zsynchronizuj swoje urządzenia +GenericName[pt]=Ligue e sincronize os seus dispositivos +GenericName[pt_BR]=Conecta e sincroniza seus dispositivos +GenericName[ru]=Подключение и синхронизация с мобильными устройствами +GenericName[sk]=Pripojiť a synchronizovať vaše zariadenia +GenericName[sv]=Anslut och synkronisera dina apparater +GenericName[tr]=Aygıtlarınıza bağlanın ve eşitleyin +GenericName[uk]=З’єднання і синхронізація ваших пристроїв +GenericName[x-test]=xxConnect and sync your devicesxx +GenericName[zh_CN]=连接并同步您的设备 +Categories=Qt;KDE;Settings;HardwareSettings; +NotShowIn=KDE; diff -Nru kdeconnect-plasma-0.0+git20150810/kcmplugin/CMakeLists.txt kdeconnect-plasma-0.9+git20160315/kcmplugin/CMakeLists.txt --- kdeconnect-plasma-0.0+git20150810/kcmplugin/CMakeLists.txt 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/kcmplugin/CMakeLists.txt 2016-03-15 09:57:50.000000000 +0000 @@ -22,8 +22,7 @@ ) target_include_directories(kdeconnectpluginkcm PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) -generate_export_header(kdeconnectpluginkcm EXPORT_FILE_NAME ${CMAKE_CURRENT_BINARY_DIR}../core/kdeconnectcore_export.h BASE_NAME kdeconnectpluginkcm) +generate_export_header(kdeconnectpluginkcm EXPORT_FILE_NAME kdeconnectpluginkcm_export.h BASE_NAME kdeconnectpluginkcm) -# Remove NAMELINK_SKIP if/when headers are being installed and the library -# becomes public. +# Remove NAMELINK_SKIP if/when headers are being installed and the library becomes public. install(TARGETS kdeconnectpluginkcm EXPORT kdeconnectLibraryTargets ${INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP) diff -Nru kdeconnect-plasma-0.0+git20150810/kcmplugin/kdeconnectpluginkcm.h kdeconnect-plasma-0.9+git20160315/kcmplugin/kdeconnectpluginkcm.h --- kdeconnect-plasma-0.0+git20150810/kcmplugin/kdeconnectpluginkcm.h 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/kcmplugin/kdeconnectpluginkcm.h 2016-03-15 09:57:50.000000000 +0000 @@ -23,8 +23,8 @@ #include -#include "core/kdeconnectcore_export.h" #include "core/kdeconnectpluginconfig.h" +#include "kdeconnectpluginkcm_export.h" struct KdeConnectPluginKcmPrivate; @@ -32,7 +32,7 @@ * Inheriting your plugin's KCM from this class gets you a easy way to share * configuration values between the KCM and the plugin. */ -class KDECONNECTCORE_EXPORT KdeConnectPluginKcm +class KDECONNECTPLUGINKCM_EXPORT KdeConnectPluginKcm : public KCModule { Q_OBJECT diff -Nru kdeconnect-plasma-0.0+git20150810/kdeconnect.appdata.xml kdeconnect-plasma-0.9+git20160315/kdeconnect.appdata.xml --- kdeconnect-plasma-0.0+git20150810/kdeconnect.appdata.xml 1970-01-01 01:00:00.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/kdeconnect.appdata.xml 2016-03-15 09:57:50.000000000 +0000 @@ -0,0 +1,115 @@ + + + org.kde.kdeconnect.desktop + CC0-1.0 + GPL-2.0+ + KDE Connect + كدي المتّصل + KDE Connect + KDE Connect + KDE Connect + KDE Connect + KDE-Connect + KDE Connect + KDE Connect + KDE Connect + KDE Connect + KDE Connect + KDE Connect + KDE Connect + KDE Connect + KDE Connect + KDE Connect + KDE Connect + KDE Connect + KDE Connect + KDE-anslut + KDE Connect + xxKDE Connectxx + KDE Connect + Seamless connection of your devices + اتّصال سلس بين أجهزتك + Conexón de los tos preseos ensin esfuerciu + Connexió transparent amb els vostres dispositius + Connexió transparent amb els vostres dispositius + Snadné propojení vašich zařízení + Nahtlose Verbindung zu Ihren Geräten + Seamless connection of your devices + Conexión sin interrupciones de sus dispositivos + Saumaton yhteys laitteisiisi + Connecter vos périphériques avec facilité + Conexión constante entre dispositivos + Connessione trasparente dei tuoi dispositivi + 장치와 항상 연결하기 + Naadloze verbinding met uw apparaten + Zintegrowane połączenia do twoich urządzeń + Ligação transparente aos seus dispositivos + Conexão transparente com seus dispositivos + Интеграция с мобильными устройствами + Jednoduché prepojenie vašich zariadení + Sömlös anslutning av dina apparater + Безшовне з’єднання для усіх ваших пристроїв + xxSeamless connection of your devicesxx + 无缝连接您的设备 + +

KDE Connect provides integration between your Android phone and your desktop.

+

يوفّر «كدي المتصّل» التّكامل بين هاتف أندرويد وسطح المكتب.

+

KDE Connect forne integración ente'l to preséu Android y el to escritoriu.

+

El KDE Connect proporciona la integració entre el telèfon Android i el vostre escriptori.

+

El KDE Connect proporciona la integració entre el telèfon Android i el vostre escriptori.

+

KDE Connect poskytuje integraci mezi vaším telefonem s Androidem a vaší pracovní plochou.

+

KDE Connect bietet Integrationsdienste zwischen Ihrem Android-Telefon und Ihrem Desktop-Computer.

+

KDE Connect provides integration between your Android phone and your desktop.

+

KDE Connect proporciona integración entre su teléfono Android y su escritorio.

+

KDE Connect tarjoaa integraation Android-puhelimesi ja työpöytäsi välillä.

+

KDE Connect permet d'intégrer votre téléphone Android avec votre bureau.

+

KDE Connect fornece integración entre os seus teléfonos con Android e o seu computador de escritorio.

+

KDE Connect fornisce integrazione tra il tuo telefono Android e il tuo desktop.

+

KDE Connect는 안드로이드 휴대폰과 데스크톱을 연결합니다.

+

KDE Connect biedt integratie tussen uw Android telefoon en uw bureaublad.

+

KDE Connect integruje twój telefon Android z twoim pulpitem.

+

O KDE Connect oferece a integração entre o seu dispositivo Android e o seu ambiente de trabalho.

+

O KDE Connect permite integrar seu telefone Android com seu desktop.

+

KDE Connect обеспечивает интеграцию между телефоном на базе ОС Android и компьютером.

+

KDE Connect poskytuje integráciu medzi vašim Androidovým telefónom a vašim počítačom.

+

KDE-anslut tillhandahåller integrering mellan en Android-telefon och skrivbordet.

+

KDE Connect забезпечує інтеграцію між вашим телефоном під керуванням Android та вашим робочим комп’ютером.

+

xxKDE Connect provides integration between your Android phone and your desktop.xx

+

KDE Connect 提供您的 Android 手机和桌面之间的集成。

+
+ https://community.kde.org/KDEConnect/ + https://bugs.kde.org/enter_bug.cgi?format=guided&product=kdeconnect + + + + + + + KDE Connect + كدي المتّصل + KDE Connect + KDE Connect + KDE Connect + KDE Connect + KDE-Connect + KDE Connect + KDE Connect + KDE Connect + KDE Connect + KDE Connect + KDE Connect + KDE Connect + KDE Connect + KDE Connect + KDE Connect + KDE Connect + KDE Connect + KDE Connect + KDE-anslut + KDE Connect + xxKDE Connectxx + KDE Connect + + kdeconnectd + +
diff -Nru kdeconnect-plasma-0.0+git20150810/kdeconnect-non-plasma.desktop kdeconnect-plasma-0.9+git20160315/kdeconnect-non-plasma.desktop --- kdeconnect-plasma-0.0+git20150810/kdeconnect-non-plasma.desktop 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/kdeconnect-non-plasma.desktop 1970-01-01 01:00:00.000000000 +0100 @@ -1,57 +0,0 @@ -[Desktop Entry] -Name=KDE Connect -Name[bg]=KDE Connect -Name[bs]=Konekcija KDE -Name[ca]=KDE Connect -Name[cs]=KDE Connect -Name[da]=KDE Connect -Name[de]=KDE-Connect -Name[en_GB]=KDE Connect -Name[es]=KDE Connect -Name[fi]=KDE Connect -Name[fr]=KDE Connect -Name[gl]=KDE Connect -Name[hu]=KDE csatlakozás -Name[it]=KDE Connect -Name[ko]=KDE Connect -Name[nl]=KDE Connect -Name[pl]=KDE Connect -Name[pt]=KDE Connect -Name[pt_BR]=KDE Connect -Name[ro]=KDE Connect -Name[ru]=KDE Connect -Name[sk]=KDE Connect -Name[sv]=KDE anslut -Name[tr]=KDE Bağlan -Name[uk]=З’єднання KDE -Name[x-test]=xxKDE Connectxx -Name[zh_CN]=KDE Connect -Comment=Reach out to your devices -Comment[bg]=Достигане до устройствата ви -Comment[ca]=Connecteu amb els vostres dispositius -Comment[cs]=Dosáhněte na svá zařízení -Comment[de]=Zugriff auf Ihre Geräte -Comment[en_GB]=Reach out to your devices -Comment[es]=Contactar con sus dispositivos -Comment[fi]=Tavoitettavuutta laitteillesi -Comment[gl]=Chega aos teus dispositivos. -Comment[hu]=Érje el eszközeit -Comment[it]=Comunica con i tuoi dispositivi -Comment[nl]=maak verbinding met uw apparaten -Comment[pl]=Uzyskaj dostęp do swoich urządzeń -Comment[pt]=Aceda aos seus dispositivos -Comment[pt_BR]=Acesse seus dispositivos -Comment[sk]=Oslovenie vašich zariadení -Comment[sv]=Kontakta dina apparater -Comment[tr]=Aygıtlarınıza erişin -Comment[uk]=З’єднатися з вашими пристроями -Comment[x-test]=xxReach out to your devicesxx -Comment[zh_CN]=连接到您的设备 -Exec=plasmawindowed org.kde.kdeconnect --statusnotifier -Icon=kdeconnect -Type=Application -Terminal=false -Categories=Qt;KDE;Network; - -NotShowIn=KDE;Plasma; - diff -Nru kdeconnect-plasma-0.0+git20150810/kio/kiokdeconnect.cpp kdeconnect-plasma-0.9+git20160315/kio/kiokdeconnect.cpp --- kdeconnect-plasma-0.0+git20150810/kio/kiokdeconnect.cpp 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/kio/kiokdeconnect.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -143,7 +143,7 @@ QVariantMap urls = urlreply.value(); - for (QVariantMap::iterator it = urls.begin(); it != urls.end(); it++) { + for (QVariantMap::iterator it = urls.begin(); it != urls.end(); ++it) { QString path = it.key(); QString name = it.value().toString(); @@ -170,7 +170,7 @@ { qCDebug(KDECONNECT_KIO) << "Listing..." << url; - /// Url is not used here becuase all we could care about the url is the host, and that's already + /// Url is not used here because all we could care about the url is the host, and that's already /// handled in @p setHost Q_UNUSED(url); diff -Nru kdeconnect-plasma-0.0+git20150810/kio/kiokdeconnect.h kdeconnect-plasma-0.9+git20160315/kio/kiokdeconnect.h --- kdeconnect-plasma-0.0+git20150810/kio/kiokdeconnect.h 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/kio/kiokdeconnect.h 2016-03-15 09:57:50.000000000 +0000 @@ -32,16 +32,16 @@ class KioKdeconnect : public QObject, public KIO::SlaveBase { - Q_OBJECT + Q_OBJECT public: KioKdeconnect(const QByteArray &pool, const QByteArray &app); - void get(const QUrl &url); - void listDir(const QUrl &url); - void stat(const QUrl &url); + void get(const QUrl &url) override; + void listDir(const QUrl &url) override; + void stat(const QUrl &url) override; - void setHost(const QString &constHostname, quint16 port, const QString &user, const QString &pass); + void setHost(const QString &constHostname, quint16 port, const QString &user, const QString &pass) override; void listAllDevices(); //List all devices exported by m_dbusInterface void listDevice(); //List m_currentDevice diff -Nru kdeconnect-plasma-0.0+git20150810/org.kde.kdeconnect.nonplasma.desktop kdeconnect-plasma-0.9+git20160315/org.kde.kdeconnect.nonplasma.desktop --- kdeconnect-plasma-0.0+git20150810/org.kde.kdeconnect.nonplasma.desktop 1970-01-01 01:00:00.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/org.kde.kdeconnect.nonplasma.desktop 2016-03-15 09:57:50.000000000 +0000 @@ -0,0 +1,62 @@ +[Desktop Entry] +Name=KDE Connect Monitor +Name[ar]=مرقاب «كدي المتّصل» +Name[ast]=Monitor de KDE Connect +Name[ca]=Controlador del KDE Connect +Name[ca@valencia]=Controlador del KDE Connect +Name[cs]=Monitor KDE Connect +Name[da]=KDE Connect-overvåger +Name[de]=KDE-Connect-Monitor +Name[el]=Εφαρμογή εποπτείας του KDE Connect +Name[en_GB]=KDE Connect Monitor +Name[es]=Monitor de KDE Connect +Name[fi]=KDE Connect -valvonta +Name[gl]=Monitor de KDE Connect +Name[hu]=KDE Connect monitor +Name[it]=Monitor di KDE Connect +Name[ko]=KDE Connect 모니터 +Name[nl]=KDE-Connectmonitor +Name[pl]=Monitor KDE Connect +Name[pt]=Monitor do KDE Connect +Name[pt_BR]=Monitor do KDE Connect +Name[ru]=Индикатор KDE Connect +Name[sk]=Monitor KDE Connect +Name[sv]=KDE-anslut övervakning +Name[tr]=KDE Bağlantı İzleyicisi +Name[uk]=Монітор KDE Connect +Name[x-test]=xxKDE Connect Monitorxx +Name[zh_CN]=KDE Connect 监视器 +Comment=Display information about your devices +Comment[ar]=اعرض معلومات عن أجهزتك +Comment[ast]=Amuesa información tocante a los tos preseos +Comment[ca]=Mostra la informació dels vostres dispositius +Comment[ca@valencia]=Mostra la informació dels vostres dispositius +Comment[cs]=Zobrazit informace o vašich zařízeních +Comment[da]=Vis information om dine enheder +Comment[de]=Anzeige von Informationen über Ihre Geräte +Comment[el]=Προβολή πληροφοριών σχετικά με τις συσκευές σας +Comment[en_GB]=Display information about your devices +Comment[es]=Mostrar información sobre sus dispositivos +Comment[fi]=Näyttää tietoa laitteistasi +Comment[gl]=Mostrar información sobre os dispositivos +Comment[hu]=Információk megjelenítése az eszközeiről +Comment[it]=Visualizza informazioni sui tuoi dispositivi +Comment[ko]=장치 정보 표시 +Comment[nl]=Toon informatie over uw apparaten +Comment[pl]=Wyświetl informacje o twoich urządzeniach +Comment[pt]=Mostrar informações sobre os seus dispositivos +Comment[pt_BR]=Mostra informações sobre seus dispositivos +Comment[ru]=Просмотр информации о мобильных устройствах +Comment[sk]=Zobraziť informácie o vašich zariadeniach +Comment[sv]=Visa information om enheter +Comment[tr]=Aygıtlarınız hakkında bilgi görüntüleyin +Comment[uk]=Показати дані щодо ваших пристроїв +Comment[x-test]=xxDisplay information about your devicesxx +Comment[zh_CN]=显示您设备的信息 +Exec=plasmawindowed org.kde.kdeconnect --statusnotifier +Icon=kdeconnect +Type=Application +Terminal=false +Categories=Qt;KDE;Network; +NotShowIn=KDE; + diff -Nru kdeconnect-plasma-0.0+git20150810/plasmoid/declarativeplugin/kdeconnectdeclarativeplugin.cpp kdeconnect-plasma-0.9+git20160315/plasmoid/declarativeplugin/kdeconnectdeclarativeplugin.cpp --- kdeconnect-plasma-0.0+git20150810/plasmoid/declarativeplugin/kdeconnectdeclarativeplugin.cpp 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plasmoid/declarativeplugin/kdeconnectdeclarativeplugin.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -34,32 +34,37 @@ #include "interfaces/devicesmodel.h" #include "interfaces/notificationsmodel.h" -QObject* createDeviceDbusInterface(QVariant deviceId) +QObject* createDeviceDbusInterface(const QVariant &deviceId) { return new DeviceDbusInterface(deviceId.toString()); } -QObject* createDeviceBatteryDbusInterface(QVariant deviceId) +QObject* createDeviceBatteryDbusInterface(const QVariant &deviceId) { return new DeviceBatteryDbusInterface(deviceId.toString()); } -QObject* createSftpInterface(QVariant deviceId) +QObject* createFindMyPhoneInterface(const QVariant &deviceId) +{ + return new FindMyPhoneDeviceDbusInterface(deviceId.toString()); +} + +QObject* createSftpInterface(const QVariant &deviceId) { return new SftpDbusInterface(deviceId.toString()); } -QObject* createRemoteControlInterface(QVariant deviceId) +QObject* createRemoteControlInterface(const QVariant &deviceId) { return new RemoteControlDbusInterface(deviceId.toString()); } -QObject* createMprisInterface(QVariant deviceId) +QObject* createMprisInterface(const QVariant &deviceId) { return new MprisDbusInterface(deviceId.toString()); } -QObject* createDeviceLockInterface(QVariant deviceId) +QObject* createDeviceLockInterface(const QVariant &deviceId) { Q_ASSERT(!deviceId.toString().isEmpty()); return new LockDeviceDbusInterface(deviceId.toString()); @@ -79,6 +84,7 @@ qmlRegisterType(uri, 1, 0, "DevicesSortProxyModel"); qmlRegisterUncreatableType(uri, 1, 0, "MprisDbusInterface", QStringLiteral("You're not supposed to instantiate interfacess")); qmlRegisterUncreatableType(uri, 1, 0, "LockDeviceDbusInterface", QStringLiteral("You're not supposed to instantiate interfacess")); + qmlRegisterUncreatableType(uri, 1, 0, "FindMyPhoneDbusInterface", QStringLiteral("You're not supposed to instantiate interfacess")); qmlRegisterUncreatableType(uri, 1, 0, "DeviceDbusInterface", QStringLiteral("You're not supposed to instantiate interfacess")); } @@ -92,6 +98,9 @@ engine->rootContext()->setContextProperty("DeviceBatteryDbusInterfaceFactory" , new ObjectFactory(engine, createDeviceBatteryDbusInterface)); + engine->rootContext()->setContextProperty("FindMyPhoneDbusInterfaceFactory" + , new ObjectFactory(engine, createFindMyPhoneInterface)); + engine->rootContext()->setContextProperty("SftpDbusInterfaceFactory" , new ObjectFactory(engine, createSftpInterface)); diff -Nru kdeconnect-plasma-0.0+git20150810/plasmoid/declarativeplugin/kdeconnectdeclarativeplugin.h kdeconnect-plasma-0.9+git20160315/plasmoid/declarativeplugin/kdeconnectdeclarativeplugin.h --- kdeconnect-plasma-0.0+git20150810/plasmoid/declarativeplugin/kdeconnectdeclarativeplugin.h 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plasmoid/declarativeplugin/kdeconnectdeclarativeplugin.h 2016-03-15 09:57:50.000000000 +0000 @@ -29,8 +29,8 @@ Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") - virtual void registerTypes(const char* uri); - virtual void initializeEngine(QQmlEngine *engine, const char *uri); + virtual void registerTypes(const char* uri) override; + virtual void initializeEngine(QQmlEngine *engine, const char *uri) override; }; #endif // KDECONNECTDECLARATIVEPLUGIN_H diff -Nru kdeconnect-plasma-0.0+git20150810/plasmoid/declarativeplugin/objectfactory.h kdeconnect-plasma-0.9+git20160315/plasmoid/declarativeplugin/objectfactory.h --- kdeconnect-plasma-0.0+git20150810/plasmoid/declarativeplugin/objectfactory.h 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plasmoid/declarativeplugin/objectfactory.h 2016-03-15 09:57:50.000000000 +0000 @@ -11,29 +11,29 @@ Q_OBJECT typedef QObject* (*Func0)(); - typedef QObject* (*Func1)(QVariant); - typedef QObject* (*Func2)(QVariant, QVariant); + typedef QObject* (*Func1)(const QVariant&); + typedef QObject* (*Func2)(const QVariant&, const QVariant&); public: - ObjectFactory(QObject* parent, Func0 f0) : QObject(parent), m_f0(f0), m_f1(0), m_f2(0) {} - ObjectFactory(QObject* parent, Func1 f1) : QObject(parent), m_f0(0), m_f1(f1), m_f2(0) {} - ObjectFactory(QObject* parent, Func2 f2) : QObject(parent), m_f0(0), m_f1(0), m_f2(f2) {} + ObjectFactory(QObject* parent, Func0 f0) : QObject(parent), m_f0(f0), m_f1(nullptr), m_f2(nullptr) {} + ObjectFactory(QObject* parent, Func1 f1) : QObject(parent), m_f0(nullptr), m_f1(f1), m_f2(nullptr) {} + ObjectFactory(QObject* parent, Func2 f2) : QObject(parent), m_f0(nullptr), m_f1(nullptr), m_f2(f2) {} virtual ~ObjectFactory() {} Q_INVOKABLE QObject* create() { - if (m_f0) return m_f0(); return 0; + if (m_f0) return m_f0(); return nullptr; } - Q_INVOKABLE QObject* create(QVariant arg1) { + Q_INVOKABLE QObject* create(const QVariant &arg1) { if (m_f1) return m_f1(arg1); - return 0; + return nullptr; } - Q_INVOKABLE QObject* create(QVariant arg1, QVariant arg2) { + Q_INVOKABLE QObject* create(const QVariant &arg1, const QVariant &arg2) { if (m_f2) return m_f2(arg1, arg2); - return 0; + return nullptr; } private: diff -Nru kdeconnect-plasma-0.0+git20150810/plasmoid/declarativeplugin/processrunner.h kdeconnect-plasma-0.9+git20160315/plasmoid/declarativeplugin/processrunner.h --- kdeconnect-plasma-0.0+git20150810/plasmoid/declarativeplugin/processrunner.h 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plasmoid/declarativeplugin/processrunner.h 2016-03-15 09:57:50.000000000 +0000 @@ -27,7 +27,7 @@ Q_OBJECT public: - ProcessRunner(QObject *parent = 0); + explicit ProcessRunner(QObject *parent = nullptr); ~ProcessRunner(); Q_INVOKABLE void runKdeconnectKCM(); diff -Nru kdeconnect-plasma-0.0+git20150810/plasmoid/declarativeplugin/responsewaiter.cpp kdeconnect-plasma-0.9+git20160315/plasmoid/declarativeplugin/responsewaiter.cpp --- kdeconnect-plasma-0.0+git20150810/plasmoid/declarativeplugin/responsewaiter.cpp 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plasmoid/declarativeplugin/responsewaiter.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -1,18 +1,17 @@ +#include "responsewaiter.h" #include #include #include #include -#include "responsewaiter.h" - Q_DECLARE_METATYPE(QDBusPendingReply<>) Q_DECLARE_METATYPE(QDBusPendingReply) Q_DECLARE_METATYPE(QDBusPendingReply) Q_DECLARE_METATYPE(QDBusPendingReply) Q_DECLARE_METATYPE(QDBusPendingReply) -DBusResponseWaiter* DBusResponseWaiter::m_instance = 0; +DBusResponseWaiter* DBusResponseWaiter::m_instance = nullptr; DBusResponseWaiter* DBusResponseWaiter::instance() { @@ -50,7 +49,7 @@ if (reply.arguments().count() > 0) { - return reply.arguments().first(); + return reply.arguments().at(0); } } return QVariant(); @@ -96,7 +95,7 @@ if (reply.arguments().count() > 0) { - Q_EMIT success(reply.arguments().first()); + Q_EMIT success(reply.arguments().at(0)); } else { @@ -125,7 +124,7 @@ } } - return 0; + return nullptr; } diff -Nru kdeconnect-plasma-0.0+git20150810/plasmoid/declarativeplugin/responsewaiter.h kdeconnect-plasma-0.9+git20160315/plasmoid/declarativeplugin/responsewaiter.h --- kdeconnect-plasma-0.0+git20150810/plasmoid/declarativeplugin/responsewaiter.h 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plasmoid/declarativeplugin/responsewaiter.h 2016-03-15 09:57:50.000000000 +0000 @@ -36,7 +36,7 @@ Q_PROPERTY(bool autoDelete READ autodelete WRITE setAutodelete) public: - DBusAsyncResponse(QObject* parent = 0); + explicit DBusAsyncResponse(QObject* parent = nullptr); virtual ~DBusAsyncResponse() {}; Q_INVOKABLE void setPendingCall(QVariant e); @@ -45,8 +45,8 @@ bool autodelete() const {return m_autodelete;} Q_SIGNALS: - void success(QVariant result); - void error(QString message); + void success(const QVariant &result); + void error(const QString &message); private Q_SLOTS: void onCallFinished(QDBusPendingCallWatcher* watcher); diff -Nru kdeconnect-plasma-0.0+git20150810/plasmoid/package/contents/ui/DeviceDelegate.qml kdeconnect-plasma-0.9+git20160315/plasmoid/package/contents/ui/DeviceDelegate.qml --- kdeconnect-plasma-0.0+git20150810/plasmoid/package/contents/ui/DeviceDelegate.qml 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plasmoid/package/contents/ui/DeviceDelegate.qml 2016-03-15 09:57:50.000000000 +0000 @@ -19,6 +19,7 @@ */ import QtQuick 2.1 +import QtQuick.Layouts 1.1 import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.components 2.0 as PlasmaComponents import org.kde.kdeconnect 1.0 @@ -33,12 +34,34 @@ Column { width: parent.width - Row + RowLayout { + Item { + //spacer to make the label centre aligned in a row yet still elide and everything + implicitWidth: ring.width + browse.width + parent.spacing + } + PlasmaComponents.Label { - width: browse.visible? parent.width - browse.width : parent.width horizontalAlignment: Text.AlignHCenter + elide: Text.ElideRight text: display + Layout.fillWidth: true + } + + PlasmaComponents.Button + { + FindMyPhone { + id: findmyphone + deviceId: root.deviceId + } + + id: ring + iconSource: "preferences-desktop-notification" + visible: findmyphone.available + + onClicked: { + findmyphone.ring() + } } PlasmaComponents.Button @@ -57,7 +80,6 @@ } } - height: browse.height width: parent.width } diff -Nru kdeconnect-plasma-0.0+git20150810/plasmoid/package/contents/ui/FindMyPhone.qml kdeconnect-plasma-0.9+git20160315/plasmoid/package/contents/ui/FindMyPhone.qml --- kdeconnect-plasma-0.0+git20150810/plasmoid/package/contents/ui/FindMyPhone.qml 1970-01-01 01:00:00.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plasmoid/package/contents/ui/FindMyPhone.qml 2016-03-15 09:57:50.000000000 +0000 @@ -0,0 +1,61 @@ +/** + * Copyright 2014 Samoilenko Yuri + * + * 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 . + */ + +import QtQuick 2.1 +import org.kde.plasma.core 2.0 as PlasmaCore +import org.kde.plasma.components 2.0 as PlasmaComponents +import org.kde.kdeconnect 1.0 + +QtObject { + + id: root + + property string deviceId: "" + property variant device: DeviceDbusInterfaceFactory.create(deviceId) + property bool available: false + + property variant findMyPhone: null + + function ring() { + if (findMyPhone) { + findMyPhone.ring(); + } + } + + Component.onCompleted: { + device.pluginsChanged.connect(pluginsChanged) + pluginsChanged() + } + + // Note: magically called by qml + onAvailableChanged: { + if (available) { + findMyPhone = FindMyPhoneDbusInterfaceFactory.create(deviceId) + } else { + findMyPhone = null + } + } + + function pluginsChanged() { + var result = DBusResponseWaiter.waitForReply(device.hasPlugin("kdeconnect_findmyphone")) + available = (result && result != "error"); + } + +} diff -Nru kdeconnect-plasma-0.0+git20150810/plasmoid/package/metadata.desktop kdeconnect-plasma-0.9+git20160315/plasmoid/package/metadata.desktop --- kdeconnect-plasma-0.0+git20150810/plasmoid/package/metadata.desktop 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plasmoid/package/metadata.desktop 2016-03-15 09:57:50.000000000 +0000 @@ -1,11 +1,15 @@ [Desktop Entry] Name=KDE Connect +Name[ar]=كدي المتّصل +Name[ast]=KDE Connect Name[bg]=KDE Connect Name[bs]=Konekcija KDE Name[ca]=KDE Connect +Name[ca@valencia]=KDE Connect Name[cs]=KDE Connect Name[da]=KDE Connect Name[de]=KDE-Connect +Name[el]=KDE Connect Name[en_GB]=KDE Connect Name[es]=KDE Connect Name[fi]=KDE Connect @@ -15,24 +19,29 @@ Name[it]=KDE Connect Name[ko]=KDE Connect Name[nl]=KDE Connect +Name[nn]=KDE Connect Name[pl]=KDE Connect Name[pt]=KDE Connect Name[pt_BR]=KDE Connect Name[ro]=KDE Connect Name[ru]=KDE Connect Name[sk]=KDE Connect -Name[sv]=KDE anslut +Name[sv]=KDE-anslut Name[tr]=KDE Bağlan Name[uk]=З’єднання KDE Name[x-test]=xxKDE Connectxx Name[zh_CN]=KDE Connect Comment=Show notifications from your devices using KDE Connect +Comment[ar]=أظهر الإخطارات من أجهزتك باستخدام «كدي المتّصل» +Comment[ast]=Amuesa avisos de los tos preseos usando KDE Connect Comment[bg]=Показване на уведомления от вашите устройства чрез KDE Connect Comment[bs]=Prikaži obavlještenja sa uređaja koji koriste KDE konekciju -Comment[ca]=Mostra les notificacions des dels vostres dispositius usant KDE Connect +Comment[ca]=Mostra les notificacions dels vostres dispositius emprant el KDE Connect +Comment[ca@valencia]=Mostra les notificacions dels vostres dispositius emprant el KDE Connect Comment[cs]=Zobrazit upozornění z vašich zařízení pomocí KDE Connect Comment[da]=Vis bekendtgørelser fra dine enheder med KDE Connect Comment[de]=Zeigt Benachrichtigungen von Ihren Geräten mit KDE-Connect +Comment[el]=Προβολή ειδοποιήσεων από τις συσκευές σας με το KDE Connect Comment[en_GB]=Show notifications from your devices using KDE Connect Comment[es]=Mostrar notificaciones de sus dispositivos usando KDE Connect Comment[fi]=Näytä laitteidesi ilmoitukset KDE Connectilla @@ -42,10 +51,11 @@ Comment[it]=Mostra le notifiche dei tuoi dispositivi tramite KDE Connect Comment[ko]=KDE Connect로 장치에 표시된 알림 보기 Comment[nl]=Meldingen van uw apparaten met KDE Connect tonen -Comment[pl]=Pokaż powiadomienia ze swoich urządzeń przy użyciu KDE Connect +Comment[nn]=Vis varslingar frå einingane dine med KDE Connect +Comment[pl]=Pokazuje powiadomienia z urządzeń z KDE Connect Comment[pt]=Mostrar notificações dos seus dispositivos usando o KDE Connect Comment[pt_BR]=Mostrar notificações dos seus dispositivos usando o KDE Connect -Comment[ru]=Показывать уведомления от устройств с помощью KDE Connect +Comment[ru]=Просмотр уведомлений с мобильных устройств с помощью KDE Connect Comment[sk]=Zobraziť oznámenia z vašich zariadení pomocou KDE Connect Comment[sv]=Visa underrättelser från apparater med KDE anslut Comment[tr]=KDE Bağlan kullanılarak cihazınızdan bildirimleri görüntüleyin diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/battery/batterydbusinterface.cpp kdeconnect-plasma-0.9+git20160315/plugins/battery/batterydbusinterface.cpp --- kdeconnect-plasma-0.0+git20150810/plugins/battery/batterydbusinterface.cpp 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/battery/batterydbusinterface.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -38,7 +38,9 @@ QMap::iterator oldInterfaceIter = s_dbusInterfaces.find(device->id()); if (oldInterfaceIter != s_dbusInterfaces.end()) { qCDebug(KDECONNECT_PLUGIN_BATTERY) << "Deleting stale BattteryDbusInterface for" << device->name(); - oldInterfaceIter.value()->deleteLater(); + //FIXME: This still crashes sometimes even after the workaround made in 38aa970, commented out by now + //oldInterfaceIter.value()->deleteLater(); + s_dbusInterfaces.erase(oldInterfaceIter); } s_dbusInterfaces[device->id()] = this; diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/battery/batteryplugin.cpp kdeconnect-plasma-0.9+git20160315/plugins/battery/batteryplugin.cpp --- kdeconnect-plasma-0.0+git20150810/plugins/battery/batteryplugin.cpp 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/battery/batteryplugin.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -61,8 +61,8 @@ bool BatteryPlugin::receivePackage(const NetworkPackage& np) { - bool isCharging = np.get("isCharging"); - int currentCharge = np.get("currentCharge"); + bool isCharging = np.get("isCharging", false); + int currentCharge = np.get("currentCharge", -1); int thresholdEvent = np.get("thresholdEvent", (int)ThresholdNone); if (batteryDbusInterface->charge() != currentCharge diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/battery/batteryplugin.h kdeconnect-plasma-0.9+git20160315/plugins/battery/batteryplugin.h --- kdeconnect-plasma-0.0+git20150810/plugins/battery/batteryplugin.h 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/battery/batteryplugin.h 2016-03-15 09:57:50.000000000 +0000 @@ -39,8 +39,8 @@ virtual ~BatteryPlugin(); public Q_SLOTS: - virtual bool receivePackage(const NetworkPackage& np); - virtual void connected(); + virtual bool receivePackage(const NetworkPackage& np) override; + virtual void connected() override; private: // Keep these values in sync with THRESHOLD* constants in diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/battery/kdeconnect_battery.json kdeconnect-plasma-0.9+git20160315/plugins/battery/kdeconnect_battery.json --- kdeconnect-plasma-0.0+git20150810/plugins/battery/kdeconnect_battery.json 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/battery/kdeconnect_battery.json 2016-03-15 09:57:50.000000000 +0000 @@ -4,23 +4,28 @@ "Authors": [ { "Email": "albertvaka@gmail.com", - "Name": "Albert Vaca" + "Name": "Albert Vaca", + "Name[x-test]": "xxAlbert Vacaxx" } ], "Description": "Show your phone battery next to your computer battery", + "Description[ast]": "Amuesa la batería del teléfonu cabo la del ordenador", + "Description[ca@valencia]": "Mostra la bateria del telèfon al costat de la bateria de l'ordinador", "Description[ca]": "Mostra la bateria del telèfon al costat de la bateria de l'ordinador", "Description[cs]": "Zobrazit baterii vedle baterie počítače", "Description[de]": "Zeigt den Akku Ihres Telefons neben dem Akku des Rechners", - "Description[en_GB]": "Show your phone battery next to your computer battery", "Description[es]": "Mostrar la batería del teléfono junto a la batería del equipo", "Description[fi]": "Näytä puhelimesi akku tietokoneen akun rinnalla", "Description[gl]": "Mostra o nivel de batería do teléfono canda o nivel de batería do computador.", "Description[hu]": "A telefon akkumulátorának megjelenítése a számítógépé mellett", "Description[it]": "Mostra la batteria del telefono accanto alla batteria del computer", + "Description[ko]": "컴퓨터 배터리와 함께 휴대폰 배터리 표시", "Description[nl]": "Uw telefoonbatterij naast uw computerbatterij tonen", + "Description[nn]": "Vis telefonbatteriet ved sidan av datamaskinbatteriet", "Description[pl]": "Pokaż baterię swojego telefonu obok baterii komputera", "Description[pt]": "Mostrar a bateria do seu telefone ao lado da do seu computador", "Description[pt_BR]": "Mostra a bateria do seu celular ao lado da bateria do computador", + "Description[ru]": "Показ уровня заряда батареи телефона рядом с индикатором батареи компьютера", "Description[sk]": "Zobraziť batériu vášho telefónu pri batérii počítača", "Description[sv]": "Visa telefonens batteri intill datorbatteriet", "Description[tr]": "Bilgisayar pilinizin yanında telefon pil durumunu göster", @@ -32,16 +37,19 @@ "Id": "kdeconnect_battery", "License": "GPL", "Name": "Battery monitor", + "Name[ast]": "Monitor de batería", + "Name[ca@valencia]": "Monitor de la bateria", "Name[ca]": "Monitor de la bateria", "Name[cs]": "Monitor baterie", "Name[de]": "Akkuüberwachung", - "Name[en_GB]": "Battery monitor", "Name[es]": "Monitor de batería", "Name[fi]": "Akkuvalvonta", "Name[gl]": "Vixilante da batería", "Name[hu]": "Akkumulátorfigyelő", "Name[it]": "Monitor della batteria", + "Name[ko]": "배터리 모니터", "Name[nl]": "Batterijmonitor", + "Name[nn]": "Batteriovervaking", "Name[pl]": "Monitor baterii", "Name[pt]": "Monitor da bateria", "Name[pt_BR]": "Monitor de bateria", diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/clipboard/clipboardplugin.h kdeconnect-plasma-0.9+git20160315/plugins/clipboard/clipboardplugin.h --- kdeconnect-plasma-0.0+git20150810/plugins/clipboard/clipboardplugin.h 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/clipboard/clipboardplugin.h 2016-03-15 09:57:50.000000000 +0000 @@ -38,8 +38,8 @@ explicit ClipboardPlugin(QObject *parent, const QVariantList &args); public Q_SLOTS: - virtual bool receivePackage(const NetworkPackage& np); - virtual void connected() { } + virtual bool receivePackage(const NetworkPackage& np) override; + virtual void connected() override { } private Q_SLOTS: void clipboardChanged(QClipboard::Mode mode); diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/clipboard/kdeconnect_clipboard.json kdeconnect-plasma-0.9+git20160315/plugins/clipboard/kdeconnect_clipboard.json --- kdeconnect-plasma-0.0+git20150810/plugins/clipboard/kdeconnect_clipboard.json 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/clipboard/kdeconnect_clipboard.json 2016-03-15 09:57:50.000000000 +0000 @@ -4,23 +4,28 @@ "Authors": [ { "Email": "albertvaka@gmail.com", - "Name": "Albert Vaca" + "Name": "Albert Vaca", + "Name[x-test]": "xxAlbert Vacaxx" } ], "Description": "Share the clipboard between devices", + "Description[ast]": "Comparte'l cartafueyu ente los preseos", + "Description[ca@valencia]": "Comparteix el porta-retalls entre dispositius", "Description[ca]": "Comparteix el porta-retalls entre dispositius", "Description[cs]": "Sdílet obsah schránky mezi zařízeními", "Description[de]": "Die Zwischenablage mit Geräten teilen", - "Description[en_GB]": "Share the clipboard between devices", "Description[es]": "Compartir portapapeles entre dispositivos", "Description[fi]": "Jaa leikepöytä laitteiden välillä", "Description[gl]": "Comparta o portapapeis entre os dispositivos.", "Description[hu]": "A vágólap megosztása az eszközök között", "Description[it]": "Condividi gli appunti tra i dispositivi", + "Description[ko]": "장치간 클립보드 공유", "Description[nl]": "Het klembord tussen apparaten delen", + "Description[nn]": "Del utklippstavla mellom einingar", "Description[pl]": "Współdziel schowek pomiędzy urządzeniami", "Description[pt]": "Partilhar a área de transferência entre dispositivos", - "Description[pt_BR]": "Compartilhar a área de transferência entre dispositivos", + "Description[pt_BR]": "Compartilha a área de transferência entre dispositivos", + "Description[ru]": "Общий буфер обмена между устройствами", "Description[sk]": "Zdieľať schránku medzi zariadeniami", "Description[sv]": "Dela klippbordet mellan apparater", "Description[tr]": "Aygıtlar arasında panoyu paylaştır", @@ -32,16 +37,19 @@ "Id": "kdeconnect_clipboard", "License": "GPL", "Name": "Clipboard", + "Name[ast]": "Cartafueyu", + "Name[ca@valencia]": "Porta-retalls", "Name[ca]": "Porta-retalls", "Name[cs]": "Schránka", "Name[de]": "Zwischenablage", - "Name[en_GB]": "Clipboard", "Name[es]": "Portapapeles", "Name[fi]": "Leikepöytä", "Name[gl]": "Portapapeis", "Name[hu]": "Vágólap", "Name[it]": "Appunti", + "Name[ko]": "클립보드", "Name[nl]": "Klembord", + "Name[nn]": "Utklippstavle", "Name[pl]": "Schowek", "Name[pt]": "Área de Transferência", "Name[pt_BR]": "Área de transferência", diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/CMakeLists.txt kdeconnect-plasma-0.9+git20160315/plugins/CMakeLists.txt --- kdeconnect-plasma-0.0+git20150810/plugins/CMakeLists.txt 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/CMakeLists.txt 2016-03-15 09:57:50.000000000 +0000 @@ -3,16 +3,21 @@ install(FILES kdeconnect_plugin.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR}) add_subdirectory(ping) -add_subdirectory(pausemusic) -add_subdirectory(mpriscontrol) add_subdirectory(clipboard) add_subdirectory(telephony) -add_subdirectory(battery) -add_subdirectory(mousepad) add_subdirectory(share) add_subdirectory(notifications) -add_subdirectory(sftp) -add_subdirectory(screensaver-inhibit) +add_subdirectory(battery) +add_subdirectory(runcommand) +if(NOT WIN32) + add_subdirectory(pausemusic) + add_subdirectory(mpriscontrol) + add_subdirectory(mousepad) + add_subdirectory(screensaver-inhibit) + add_subdirectory(sftp) +endif() + +add_subdirectory(findmyphone) if(EXPERIMENTALAPP_ENABLED) add_subdirectory(mprisremote) diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/findmyphone/CMakeLists.txt kdeconnect-plasma-0.9+git20160315/plugins/findmyphone/CMakeLists.txt --- kdeconnect-plasma-0.0+git20150810/plugins/findmyphone/CMakeLists.txt 1970-01-01 01:00:00.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/findmyphone/CMakeLists.txt 2016-03-15 09:57:50.000000000 +0000 @@ -0,0 +1,9 @@ +set(kdeconnect_findmyphone_SRCS + findmyphoneplugin.cpp +) + +kdeconnect_add_plugin(kdeconnect_findmyphone JSON kdeconnect_findmyphone.json SOURCES ${kdeconnect_findmyphone_SRCS}) + +target_link_libraries(kdeconnect_findmyphone kdeconnectcore kdeconnectcore Qt5::Core Qt5::DBus) + + diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/findmyphone/findmyphoneplugin.cpp kdeconnect-plasma-0.9+git20160315/plugins/findmyphone/findmyphoneplugin.cpp --- kdeconnect-plasma-0.0+git20150810/plugins/findmyphone/findmyphoneplugin.cpp 1970-01-01 01:00:00.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/findmyphone/findmyphoneplugin.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -0,0 +1,63 @@ +/** + * Copyright 2014 Apoorv Parle + * Copyright 2015 David Edmundson + * + * 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 . + */ + +#include "findmyphoneplugin.h" + +#include +#include +#include + +#include + +K_PLUGIN_FACTORY_WITH_JSON( KdeConnectPluginFactory, "kdeconnect_findmyphone.json", registerPlugin< FindMyPhonePlugin >(); ) + +FindMyPhonePlugin::FindMyPhonePlugin(QObject* parent, const QVariantList& args) : KdeConnectPlugin(parent, args) +{ +} + +FindMyPhonePlugin::~FindMyPhonePlugin() +{ +} + +bool FindMyPhonePlugin::receivePackage(const NetworkPackage& np) +{ + Q_UNUSED(np); + return false; +} + +void FindMyPhonePlugin::ring() +{ + NetworkPackage np(PACKAGE_TYPE_FINDMYPHONE); + sendPackage(np); +} + +void FindMyPhonePlugin::connected() +{ + QDBusConnection::sessionBus().registerObject(dbusPath(), this, QDBusConnection::ExportAllContents); +} + +QString FindMyPhonePlugin::dbusPath() const +{ + return "/modules/kdeconnect/devices/" + device()->id() + "/findmyphone"; +} + +#include "findmyphoneplugin.moc" + diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/findmyphone/findmyphoneplugin.h kdeconnect-plasma-0.9+git20160315/plugins/findmyphone/findmyphoneplugin.h --- kdeconnect-plasma-0.0+git20150810/plugins/findmyphone/findmyphoneplugin.h 1970-01-01 01:00:00.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/findmyphone/findmyphoneplugin.h 2016-03-15 09:57:50.000000000 +0000 @@ -0,0 +1,50 @@ +/** + * Copyright 2014 Apoorv Parle + * + * 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 . + */ + +#ifndef PINGPLUGIN_H +#define PINGPLUGIN_H + +#include + +#include + +#define PACKAGE_TYPE_FINDMYPHONE QStringLiteral("kdeconnect.findmyphone") + +class FindMyPhonePlugin + : public KdeConnectPlugin +{ + Q_OBJECT + Q_CLASSINFO("D-Bus Interface", "org.kde.kdeconnect.device.findmyphone") + +public: + explicit FindMyPhonePlugin(QObject *parent, const QVariantList &args); + virtual ~FindMyPhonePlugin(); + + Q_SCRIPTABLE void ring(); + +public Q_SLOTS: + virtual void connected(); + virtual bool receivePackage(const NetworkPackage& np); + +private: + QString dbusPath() const; +}; + +#endif diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/findmyphone/kdeconnect_findmyphone.json kdeconnect-plasma-0.9+git20160315/plugins/findmyphone/kdeconnect_findmyphone.json --- kdeconnect-plasma-0.0+git20150810/plugins/findmyphone/kdeconnect_findmyphone.json 1970-01-01 01:00:00.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/findmyphone/kdeconnect_findmyphone.json 2016-03-15 09:57:50.000000000 +0000 @@ -0,0 +1,71 @@ +{ + "KPlugin": { + "Authors": [ + { + "Email": "apparle@gmail.com", + "Name": "Apoorv Parle", + "Name[x-test]": "xxApoorv Parlexx" + }, + { + "Email": "davidedmundson@kde.org", + "Name": "David Edmundson", + "Name[x-test]": "xxDavid Edmundsonxx" + } + ], + "Description": "Find your lost phone by making it play an alarm sound ", + "Description[ast]": "Alcuentra'l to preséu perdíu faciéndolu sonar ", + "Description[ca@valencia]": "Troba el vostra telèfon perdut fent que reproduïsca un so d'alarma ", + "Description[ca]": "Troba el vostra telèfon perdut fent que reprodueixi un so d'alarma ", + "Description[cs]": "Najděte dsvůj telefon tím, že jej necháte přehrát zvuk upomínky", + "Description[es]": "Encuentre su teléfono perdido haciéndole reproducir un sonido de alarma", + "Description[fi]": "Löydä hukkaamasi puhelin laittamalla se soittamaan hälytysääntä ", + "Description[gl]": "Reproducir un son de alarma nun teléfono móbil perdido para atopalo.", + "Description[it]": "Trova il tuo telefono smarrito facendogli suonare un allarme sonoro ", + "Description[ko]": "알람 소리를 울려서 잃어버린 휴대폰 찾기", + "Description[nl]": "Zoek uw verloren telefoon door het te laten een wekkersignaal te laten spelen ", + "Description[pl]": "Znajdź twój zgubiony telefon odgrywając na nim dźwięk ", + "Description[pt]": "Descobre o seu telefone perdido, fazendo-o tocar um som de alarme", + "Description[pt_BR]": "Encontre seu telefone fazendo ele tocar um som ", + "Description[ru]": "Поиск утерянного телефона при помощи звукового сигнала", + "Description[sk]": "Nájsť váš stratený telefón zahraním zvuku budíka", + "Description[sv]": "Hitta din förlorade telefon genom att få den att spela ett alarmljud ", + "Description[tr]": "Bir alarm sesi çalarak kayıp telefonunuzu bulun ", + "Description[uk]": "Знайти загублений телефон, наказавши йому відтворити дзвінок", + "Description[x-test]": "xxFind your lost phone by making it play an alarm sound xx", + "Description[zh_CN]": "通过播放闹铃声来找到您的手机", + "EnabledByDefault": true, + "Encoding": "UTF-8", + "Icon": "edit-find", + "Id": "kdeconnect_findmyphone", + "License": "GPL", + "Name": "Find My Phone", + "Name[ast]": "Alcontrar el mio teléfonu", + "Name[ca@valencia]": "Troba el meu telèfon", + "Name[ca]": "Troba el meu telèfon", + "Name[cs]": "Najít můj telefon", + "Name[es]": "Encontrar mi teléfono", + "Name[fi]": "Löydä puhelimeni", + "Name[gl]": "Atopar o móbil", + "Name[it]": "Trova il mio telefono", + "Name[ko]": "내 휴대폰 찾기", + "Name[nl]": "Zoek mijn telefoon", + "Name[pl]": "Znajdź mój telefon", + "Name[pt]": "Descobrir o Meu Telefone", + "Name[pt_BR]": "Encontrar meu telefone", + "Name[ru]": "Поиск телефона", + "Name[sk]": "Nájsť môj telefón", + "Name[sv]": "Hitta min telefon", + "Name[tr]": "Telefonumu Bul", + "Name[uk]": "Знайти телефон", + "Name[x-test]": "xxFind My Phonexx", + "Name[zh_CN]": "找到我的手机", + "ServiceTypes": [ + "KdeConnect/Plugin" + ], + "Version": "0.1", + "Website": "http://kde.org" + }, + "X-KdeConnect-OutgoingPackageType": [ + "kdeconnect.findmyphone" + ] +} \ No newline at end of file diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/kdeconnect.notifyrc kdeconnect-plasma-0.9+git20160315/plugins/kdeconnect.notifyrc --- kdeconnect-plasma-0.0+git20150810/plugins/kdeconnect.notifyrc 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/kdeconnect.notifyrc 2016-03-15 09:57:50.000000000 +0000 @@ -1,12 +1,16 @@ [Global] IconName=kdeconnect Name=KDE Connect +Name[ar]=كدي المتّصل +Name[ast]=KDE Connect Name[bg]=KDE Connect Name[bs]=Konekcija KDE Name[ca]=KDE Connect +Name[ca@valencia]=KDE Connect Name[cs]=KDE Connect Name[da]=KDE Connect Name[de]=KDE-Connect +Name[el]=KDE Connect Name[en_GB]=KDE Connect Name[es]=KDE Connect Name[fi]=KDE Connect @@ -16,24 +20,29 @@ Name[it]=KDE Connect Name[ko]=KDE Connect Name[nl]=KDE Connect +Name[nn]=KDE Connect Name[pl]=KDE Connect Name[pt]=KDE Connect Name[pt_BR]=KDE Connect Name[ro]=KDE Connect Name[ru]=KDE Connect Name[sk]=KDE Connect -Name[sv]=KDE anslut +Name[sv]=KDE-anslut Name[tr]=KDE Bağlan Name[uk]=З’єднання KDE Name[x-test]=xxKDE Connectxx Name[zh_CN]=KDE Connect Comment=Notifications from your devices +Comment[ar]=الإخطارات من أجهزتك +Comment[ast]=Avisos de los tos preseos Comment[bg]=Уведомления от устройствата ви Comment[bs]=Notifikacija sa Vašeg uređaja -Comment[ca]=Notificacions des dels vostres dispositius +Comment[ca]=Notificacions dels vostres dispositius +Comment[ca@valencia]=Notificacions dels vostres dispositius Comment[cs]=Oznamování z vašich zařízení Comment[da]=Bekendtgørelser fra dine enheder Comment[de]=Benachrichtigungen von Ihren Geräten +Comment[el]=Ειδοποιήσεις από τις συσκευές σας Comment[en_GB]=Notifications from your devices Comment[es]=Notificaciones de sus dispositivos Comment[fi]=Laitteesi ilmoitukset @@ -43,11 +52,12 @@ Comment[it]=Notifiche dai tuoi dispositivi Comment[ko]=장치에 표시된 알림 Comment[nl]=Meldingen van uw apparaten +Comment[nn]=Varslingar frå einingane dine Comment[pl]=Powiadomienia z urządzeń Comment[pt]=Notificações dos seus dispositivos Comment[pt_BR]=Notificações dos seus dispositivos Comment[ro]=Notificări de pe dispozitivele dumneavoastră -Comment[ru]=Уведомления от устройств +Comment[ru]=Уведомления от мобильных устройств Comment[sk]=Oznámenia z vašich zariadení Comment[sv]=Underrättelser från dina apparater Comment[tr]=Cihazınızdan bildirimler @@ -57,12 +67,16 @@ [Event/pairingRequest] Name=Pairing Request +Name[ar]=طلب اقتران +Name[ast]=Solicitú d'empareyamientu Name[bg]=Заявка за сдвояване Name[bs]=Zahtjev za uparivanje Name[ca]=Sol·licitud d'aparellament +Name[ca@valencia]=Sol·licitud d'aparellament Name[cs]=Požadavek na párování Name[da]=Parringsanmodning Name[de]=Verbindungsanfrage +Name[el]=Αίτημα σύζευξης Name[en_GB]=Pairing Request Name[es]=Petición de vinculación Name[fi]=Paripyyntö @@ -70,60 +84,67 @@ Name[gl]=Solicitude de emparellamento Name[hu]=Párosítási kérés Name[it]=Richiesta di associazione -Name[ko]=페어링 요청 +Name[ko]=연결 요청 Name[nl]=Verzoek om een paar te maken +Name[nn]=Parringsførespurnad Name[pl]=Żądanie parowania Name[pt]=Pedido de Emparelhamento Name[pt_BR]=Solicitação de emparelhamento +Name[ru]=Запрос на сопряжение Name[sk]=Požiadavka na spárovanie Name[sv]=Begäran om ihopparning Name[tr]=Eşleşme İsteği Name[uk]=Запит щодо пов’язування Name[x-test]=xxPairing Requestxx Name[zh_CN]=配对请求 -Comment=Pairing request received from a devices -Comment[bg]=Получена е заявка за сдвояване от устройство -Comment[bs]=Primljen zahtjev za uparivanje od uređaja +Comment=Pairing request received from a device +Comment[ar]=استُلم طلب اقتران من جهاز +Comment[ast]=Solicitú d'empareyamientu recibida d'un preséu Comment[ca]=Les sol·licituds d'aparellament rebudes des d'un dispositiu +Comment[ca@valencia]=Les sol·licituds d'aparellament rebudes des d'un dispositiu Comment[cs]=Požadavek na párování přijat ze zařízení -Comment[da]=Parringsanmodning modtaget fra en enhed Comment[de]=Verbindungsanfrage von einem Gerät erhalten -Comment[en_GB]=Pairing request received from a devices +Comment[el]=Λήφθηκε αίτημα σύζευξης από μια συσκευή +Comment[en_GB]=Pairing request received from a device Comment[es]=Petición de vinculación recibida desde un dispositivo Comment[fi]=Saatiin paripyyntö laitteelta -Comment[fr]=Demande d'appariement provenant d'un périphérique Comment[gl]=Recibiuse unha solicitude de emparellamento dun dispositivo. -Comment[hu]=Párosítási kérés érkezett egy eszköztől Comment[it]=Richiesta di associazione ricevuta da un dispositivo -Comment[ko]=장치에서 페어링 요청을 받음 -Comment[nl]=Verzoek om een paar te maken ontvangen van een apparaat -Comment[pl]=Otrzymano żądanie parowania z urządzeń +Comment[nl]=Verzoek om een paar te maken ontvangen van apparaten +Comment[pl]=Otrzymano żądanie parowania z urządzenia Comment[pt]=Pedido de emparelhamento recebido de um dispositivo Comment[pt_BR]=Solicitação de emparelhamento recebida de um dispositivo Comment[sk]=Požiadavka na spárovanie prijatá zo zariadenia Comment[sv]=Begäran om ihopparning mottagen från en apparat -Comment[tr]=Bir aygıttan eşleşme isteği alındı Comment[uk]=Від пристрою отримано запит щодо пов’язування -Comment[x-test]=xxPairing request received from a devicesxx -Comment[zh_CN]=收到来自一个设备的配对请求 +Comment[x-test]=xxPairing request received from a devicexx Action=Popup [Event/callReceived] Name=Incoming Call +Name[ar]=مكالمة واردة +Name[ast]=Llamada entrante Name[bg]=Входящо обаждане Name[ca]=Trucada entrant +Name[ca@valencia]=Trucada entrant Name[cs]=Příchozí hovor +Name[da]=Indkommende opkald Name[de]=Eingehender Anruf +Name[el]=Εισερχόμενη κλήση Name[en_GB]=Incoming Call Name[es]=Llamada entrante Name[fi]=Saapuva puhelu +Name[fr]=Appel entrant Name[gl]=Chamada entrante Name[hu]=Bejövő hívás Name[it]=Chiamata in ingresso +Name[ko]=수신 전화 Name[nl]=Inkomende oproep +Name[nn]=Innkommande samtale Name[pl]=Rozmowa przychodząca Name[pt]=Chamada Recebida Name[pt_BR]=Chamada recebida +Name[ru]=Входящий звонок Name[sk]=Prichádzajúci hovor Name[sv]=Inkommande samtal Name[tr]=Gelen Çağrı @@ -131,12 +152,16 @@ Name[x-test]=xxIncoming Callxx Name[zh_CN]=收到呼叫 Comment=Someone is calling you +Comment[ar]=ثمّة من يتّصل بك +Comment[ast]=Daquién ta llamándote Comment[bg]=Някой ви се обажда Comment[bs]=Neko Vas zove Comment[ca]=Algú us està trucant +Comment[ca@valencia]=Algú vos està trucant Comment[cs]=Někdo vám volá Comment[da]=Nogen ringer til dig Comment[de]=Sie werden angerufen +Comment[el]=Κάποιος σας καλεί Comment[en_GB]=Someone is calling you Comment[es]=Alguien le está llamando Comment[fi]=Sinulle soitetaan @@ -146,11 +171,12 @@ Comment[it]=Chiamata in arrivo Comment[ko]=누군가가 전화를 걸었음 Comment[nl]=Iemand belt u op +Comment[nn]=Nokon ringjer deg Comment[pl]=Ktoś do ciebie dzwoni Comment[pt]=Alguém está a ligar-lhe Comment[pt_BR]=Alguém está chamando você Comment[ro]=Cineva vă apelează -Comment[ru]=Вас кто-то вызывает +Comment[ru]=Вам кто-то звонит Comment[sk]=Niekto vám volá Comment[sv]=Någon ringer till dig Comment[tr]=Biri sizi arıyor @@ -161,20 +187,29 @@ [Event/missedCall] Name=Missed Call +Name[ar]=مكالمة فائتة +Name[ast]=Llamada perdida Name[bg]=Пропуснато обаждане Name[ca]=Trucada perduda +Name[ca@valencia]=Trucada perduda Name[cs]=Zmeškaný hovor +Name[da]=Ubesvaret opkald Name[de]=Verpasster Anruf +Name[el]=Αναπάντητη κλήση Name[en_GB]=Missed Call Name[es]=Llamada perdida Name[fi]=Vastaamaton puhelu +Name[fr]=Appel manqué Name[gl]=Chamada perdida Name[hu]=Nem fogadott hívás Name[it]=Chiamate perse +Name[ko]=부재 중 전화 Name[nl]=Gemiste oproep +Name[nn]=Tapt oppringing Name[pl]=Połączenie nieodebrane Name[pt]=Chamada Não Atendida Name[pt_BR]=Chamada não atendida +Name[ru]=Пропущенный звонок Name[sk]=Zmeškaný hovor Name[sv]=Missat samtal Name[tr]=Cevapsız Çağrı @@ -182,12 +217,16 @@ Name[x-test]=xxMissed Callxx Name[zh_CN]=未接来电 Comment=You have a missed call +Comment[ar]=لقد فاتتك مكالمة +Comment[ast]=Tienes una llamada perdida Comment[bg]=Имате неприето обаждане Comment[bs]=Imate propušten poziv Comment[ca]=Teniu una trucada perduda +Comment[ca@valencia]=Teniu una trucada perduda Comment[cs]=Máte zmeškaný hovor Comment[da]=Du har et ubesvaret opkald Comment[de]=Sie haben einen Anruf verpasst +Comment[el]=Έχετε μια αναπάντητη κλήση Comment[en_GB]=You have a missed call Comment[es]=Tiene una llamada perdida Comment[fi]=Sinulla on vastaamaton puhelu @@ -197,6 +236,7 @@ Comment[it]=Hai una chiamata persa Comment[ko]=부재 중 전화가 있음 Comment[nl]=U hebt een gemiste oproep +Comment[nn]=Du har ei tapt oppringing Comment[pl]=Nie odebrałeś połączenia Comment[pt]=Tem uma chamada não atendida Comment[pt_BR]=Você tem uma chamada não atendida @@ -212,20 +252,29 @@ [Event/smsReceived] Name=SMS Received +Name[ar]=استُلمت رسالة +Name[ast]=SMS recibíu Name[bg]=Получен SMS Name[ca]=S'ha rebut un SMS +Name[ca@valencia]=S'ha rebut un SMS Name[cs]=SMS přijata +Name[da]=SMS-modtaget Name[de]=SMS empfangen +Name[el]=Λήφθηκε SMS Name[en_GB]=SMS Received Name[es]=SMS recibido Name[fi]=Saatiin tekstiviesti +Name[fr]=SMS reçu Name[gl]=Recibiuse un SMS Name[hu]=SMS érkezett Name[it]=SMS ricevuto +Name[ko]=SMS 받음 Name[nl]=SMS ontvangen +Name[nn]=SMS motteken Name[pl]=Otrzymano SMSa Name[pt]=SMS Recebido Name[pt_BR]=SMS recebido +Name[ru]=Входящее SMS Name[sk]=Prijatá SMS Name[sv]=SMS mottaget Name[tr]=SMS Alındı @@ -233,12 +282,16 @@ Name[x-test]=xxSMS Receivedxx Name[zh_CN]=收到短信 Comment=Someone sent you an SMS +Comment[ar]=ثمّة من أرسل رسالة إليك +Comment[ast]=Daquién unvióte un SMS Comment[bg]=Някой ви изпрати текстово съобщение Comment[bs]=Neko Vam je poslao SMS poruku Comment[ca]=Algú us ha enviat un SMS +Comment[ca@valencia]=Algú vos ha enviat un SMS Comment[cs]=Někdo vám poslal SMS Comment[da]=Nogen sendte dig en SMS Comment[de]=Jemand hat Ihnen eine SMS gesendet +Comment[el]=Κάποιος σας έστειλε SMS Comment[en_GB]=Someone sent you an SMS Comment[es]=Alguien le ha enviado un SMS Comment[fi]=Sinulle lähetettiin tekstiviesti @@ -248,11 +301,12 @@ Comment[it]=Hai ricevuto un SMS Comment[ko]=누군가가 문자 메시지를 보냄 Comment[nl]=Iemand heeft u een SMS gestuurd +Comment[nn]=Noko sende deg ein SMS Comment[pl]=Ktoś do ciebie wysłał SMSa Comment[pt]=Alguém lhe enviou um SMS Comment[pt_BR]=Alguém lhe enviou um SMS Comment[ro]=Cineva v-a trimis un SMS -Comment[ru]=У вас новое SMS сообщение +Comment[ru]=Вы получили SMS-сообщение Comment[sk]=Niekto vám poslal SMS Comment[sv]=Någon skickade ett SMS till dig Comment[tr]=Biri size SMS gönderdi @@ -263,20 +317,29 @@ [Event/batteryLow] Name=Battery Low +Name[ar]=البطّاريّة ضعيفة +Name[ast]=Batería baxa Name[bg]=Изтощена батерия Name[ca]=Bateria baixa +Name[ca@valencia]=Bateria baixa Name[cs]=Baterie je téměř vybitá +Name[da]=Lavt batteri Name[de]=Akku-Ladestand niedrig +Name[el]=Μπαταρία χαμηλή Name[en_GB]=Battery Low Name[es]=Batería baja Name[fi]=Akku vähissä +Name[fr]=Batterie faible Name[gl]=Batería baixa Name[hu]=Alacsony töltöttség Name[it]=Batteria a livello basso +Name[ko]=배터리 부족 Name[nl]=Batterij op laag niveau +Name[nn]=Lågt batterinivå Name[pl]=Bateria na niskim poziomie Name[pt]=Bateria Fraca Name[pt_BR]=Bateria fraca +Name[ru]=Низкий заряд батареи Name[sk]=Batéria je slabá Name[sv]=Låg batteriladdning Name[tr]=Pil Zayıf @@ -284,12 +347,16 @@ Name[x-test]=xxBattery Lowxx Name[zh_CN]=电池电量低 Comment=Your battery is in low state +Comment[ar]=بطّاريّتك في الحالة الضعيفة +Comment[ast]=La to batería ta nun estáu baxu Comment[bg]=Батерията ви е с нисък заряд Comment[bs]=Vaša baterija je gotovo prazna Comment[ca]=La bateria està baixa +Comment[ca@valencia]=La bateria està baixa Comment[cs]=Máte slabou baterii Comment[da]=Dit batteri er på lavt niveau Comment[de]=Der Ladestand Ihres Akkus ist niedrig +Comment[el]=Η μπαταρία σας είναι σε χαμηλό επίπεδο Comment[en_GB]=Your battery is in low state Comment[es]=La batería está en nivel bajo Comment[fi]=Akkusi virta on vähissä @@ -299,11 +366,12 @@ Comment[it]=La tua batteria è al livello basso Comment[ko]=배터리가 부족함 Comment[nl]=Uw batterij is bijna leeg +Comment[nn]=Det er lite batteri att Comment[pl]=Twoja bateria ma niski poziom naładowania Comment[pt]=A sua bateria está fraca Comment[pt_BR]=Sua bateria está com carga baixa Comment[ro]=Acumulatorul are un nivel scăzut -Comment[ru]=Низкий заряд батареи +Comment[ru]=Низкий заряд батареи мобильного устройства Comment[sk]=Vaša batéria je na nízkom stave Comment[sv]=Batteriet är nästan slut Comment[tr]=Pilinizin seviyesi düşük @@ -314,20 +382,29 @@ [Event/pingReceived] Name=Ping Received +Name[ar]=استُلمت وكزة +Name[ast]=Ping recibíu Name[bg]=Пингът е приет Name[ca]=S'ha rebut un ping +Name[ca@valencia]=S'ha rebut un ping Name[cs]=Ping přijat +Name[da]=Ping modtaget Name[de]=Ping empfangen +Name[el]=Λήφθηκε ping Name[en_GB]=Ping Received Name[es]=Ping recibido Name[fi]=Saatiin tiedustelupaketti +Name[fr]=Ping reçu Name[gl]=Recibiuse un ping Name[hu]=Ping érkezett Name[it]=Ping ricevuto +Name[ko]=핑 받음 Name[nl]=Ping ontvangen +Name[nn]=Ping motteke Name[pl]=Otrzymano ping Name[pt]=Contacto Recebido Name[pt_BR]=Ping recebido +Name[ru]=Пинг получен Name[sk]=Prijatý ping Name[sv]=Ping mottaget Name[tr]=Ping Alındı @@ -335,26 +412,31 @@ Name[x-test]=xxPing Receivedxx Name[zh_CN]=收到 Ping Comment=Ping received +Comment[ar]=استُلمت وكزة +Comment[ast]=Recibióse un ping Comment[bg]=Пингът е приет Comment[bs]=Primili ste ping Comment[ca]=S'ha rebut un ping +Comment[ca@valencia]=S'ha rebut un ping Comment[cs]=Ping přijat Comment[da]=Ping modtaget Comment[de]=Ping empfangen +Comment[el]=Λήφθηκε ping Comment[en_GB]=Ping received Comment[es]=Ping recibido Comment[fi]=Saatiin tiedustelupaketti -Comment[fr]=Commande « Ping » reçue +Comment[fr]=Ping reçu Comment[gl]=Recibiuse un “ping”. Comment[hu]=Ping érkezett Comment[it]=Hai ricevuto un ping Comment[ko]=핑 받음 Comment[nl]=Ping ontvangen +Comment[nn]=Ping motteke Comment[pl]=Otrzymano ping Comment[pt]=Pedido de rede recebido Comment[pt_BR]=Ping recebido Comment[ro]=Ping primit -Comment[ru]=Пинг получен +Comment[ru]=Получен тестовый сигнал Comment[sk]=Prijatý ping Comment[sv]=Ping mottaget Comment[tr]=Ping alındı @@ -365,20 +447,29 @@ [Event/notification] Name=Generic Notification +Name[ar]=إخطار عموميّ +Name[ast]=Avisu xenéricu Name[bg]=Общо уведомление Name[ca]=Notificació genèrica +Name[ca@valencia]=Notificació genèrica Name[cs]=Obecná hlášení +Name[da]=Generisk bekendtgørelse Name[de]=Allgemeine Benachrichtigung +Name[el]=Γενική ειδοποίηση Name[en_GB]=Generic Notification Name[es]=Notificación genérica Name[fi]=Yleinen ilmoitus +Name[fr]=Notification Name[gl]=Notificación xenérica Name[hu]=Általános értesítés Name[it]=Notifica generica +Name[ko]=일반 알림 Name[nl]=Algemene melding +Name[nn]=Generell varsling Name[pl]=Zwykłe powiadomienie Name[pt]=Notificação Genérica Name[pt_BR]=Notificação genérica +Name[ru]=Общее уведомление Name[sk]=Všeobecné upozornenie Name[sv]=Generell underrättelse Name[tr]=Genel Bildirim @@ -386,12 +477,16 @@ Name[x-test]=xxGeneric Notificationxx Name[zh_CN]=一般通知 Comment=Notification received +Comment[ar]=استُلم إخطار +Comment[ast]=Avisu recibíu Comment[bg]=Уведомлението е прието Comment[bs]=Primjeno obavještenje Comment[ca]=Notificació rebuda +Comment[ca@valencia]=Notificació rebuda Comment[cs]=Bylo přijato upozornění Comment[da]=Bekendtgørelse modtaget Comment[de]=Benachrichtigung eingegangen +Comment[el]=Λήφθηκε ειδοποίηση Comment[en_GB]=Notification received Comment[es]=Notificación recibida Comment[fi]=Saatiin ilmoitus @@ -401,11 +496,12 @@ Comment[it]=Hai ricevuto una notifica Comment[ko]=알림 받음 Comment[nl]=Melding ontvangen +Comment[nn]=Varsling motteken Comment[pl]=Otrzymano powiadomienie Comment[pt]=Notificação recebida Comment[pt_BR]=Notificação recebida Comment[ro]=Notificare primită -Comment[ru]=Уведомление получено +Comment[ru]=На мобильном устройстве получено уведомление Comment[sk]=Prijaté oznámenie Comment[sv]=Underrättelse mottagen Comment[tr]=Bildirim alındı @@ -416,20 +512,29 @@ [Event/transferReceived] Name=File Transfer +Name[ar]=نقل الملفّات +Name[ast]=Tresferencia de ficheros Name[bg]=Прехвърляне на файл Name[ca]=Transferència de fitxers +Name[ca@valencia]=Transferència de fitxers Name[cs]=Přenos souboru +Name[da]=Filoverførsel Name[de]=Dateiübertragung +Name[el]=Μεταφορά αρχείου Name[en_GB]=File Transfer Name[es]=Transferencia de archivo Name[fi]=Tiedostonsiirto +Name[fr]=Transfert de fichiers Name[gl]=Transferencia dun ficheiro Name[hu]=Fájlátvitel Name[it]=Trasferimento file +Name[ko]=파일 전송 Name[nl]=Bestandsoverdracht +Name[nn]=Filoverføring Name[pl]=Przesył plików Name[pt]=Transferência de Ficheiros Name[pt_BR]=Transferência de arquivo +Name[ru]=Передача файла Name[sk]=Prenos súboru Name[sv]=Filöverföring Name[tr]=Dosya Aktarımı @@ -437,20 +542,29 @@ Name[x-test]=xxFile Transferxx Name[zh_CN]=文件传送 Comment=Incoming file +Comment[ar]=ملفّ قادم +Comment[ast]=Ficheru entrante Comment[bg]=Входящ файл Comment[ca]=Fitxer entrant +Comment[ca@valencia]=Fitxer entrant Comment[cs]=Příchozí soubor +Comment[da]=Indkommende fil Comment[de]=Eingehende Datei +Comment[el]=Εισερχόμενο αρχείο Comment[en_GB]=Incoming file Comment[es]=Archivo entrante Comment[fi]=Saapuva tiedosto +Comment[fr]=Fichier entrant Comment[gl]=Ficheiro entrante Comment[hu]=Bejövő fájl Comment[it]=File in ingresso +Comment[ko]=파일 수신 Comment[nl]=Inkomend bestand +Comment[nn]=Innkommande fil Comment[pl]=Przychodzący plik Comment[pt]=Ficheiro recebido Comment[pt_BR]=Arquivo recebido +Comment[ru]=С мобильного устройства отправлен файл Comment[sk]=Prichádzajúci súbor Comment[sv]=Inkommande fil Comment[tr]=Gelen dosya diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/kdeconnect_plugin.desktop kdeconnect-plasma-0.9+git20160315/plugins/kdeconnect_plugin.desktop --- kdeconnect-plasma-0.0+git20150810/plugins/kdeconnect_plugin.desktop 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/kdeconnect_plugin.desktop 2016-03-15 09:57:50.000000000 +0000 @@ -3,12 +3,16 @@ X-KDE-ServiceType=KdeConnect/Plugin X-KDE-Derived=KPluginInfo Name=KDEConnect Plugin +Name[ar]=ملحقة KDEConnect +Name[ast]=Complementu KDEConnect Name[bg]=Приставка на KDEConnect Name[bs]=Priključak za KDE konekciju Name[ca]=Connector del KDE Connect +Name[ca@valencia]=Connector del KDE Connect Name[cs]=Modul KDEConnect Name[da]=KDEConnect-plugin Name[de]=KDEConnect-Modul +Name[el]=Πρόσθετο του KDEConnect Name[en_GB]=KDEConnect Plugin Name[es]=Complemento de KDEConnect Name[fi]=KDE Connect -liitännäinen @@ -18,11 +22,12 @@ Name[it]=Estensione KDEConnect Name[ko]=KDEConnect 플러그인 Name[nl]=Plug-in van KDEConnect +Name[nn]=KDEConnect-tillegg Name[pl]=Wtyczka KDEConnect Name[pt]='Plugin' do KDEConnect Name[pt_BR]=Plugin do KDEConnect Name[ro]=Extensie KDEConnect -Name[ru]=Модуль KDEConnect +Name[ru]=Модуль KDE Connect Name[sk]=Plugin KDEConnect Name[sv]=KDE anslutningsinsticksprogram Name[tr]=KDEConnect Eklentisi diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/lockdevice/kdeconnect_lockdevice.json kdeconnect-plasma-0.9+git20160315/plugins/lockdevice/kdeconnect_lockdevice.json --- kdeconnect-plasma-0.0+git20150810/plugins/lockdevice/kdeconnect_lockdevice.json 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/lockdevice/kdeconnect_lockdevice.json 2016-03-15 09:57:50.000000000 +0000 @@ -4,43 +4,59 @@ "Authors": [ { "Email": "aleixpol@kde.org", - "Name": "Aleix Pol" + "Name": "Aleix Pol", + "Name[x-test]": "xxAleix Polxx" } ], "Description": "Locks your systems", + "Description[ast]": "Bloquia los tos sistemes", + "Description[ca@valencia]": "Bloqueja els vostres sistemes", "Description[ca]": "Bloqueja els vostres sistemes", + "Description[cs]": "Zamkne vaše systémy", "Description[de]": "Sperrt Ihre Systeme", "Description[es]": "Bloquear sus sistemas", "Description[fi]": "Lukitsee järjestelmäsi", "Description[gl]": "Bloquea os seus sistemas.", "Description[it]": "Blocca i tuoi sistemi", + "Description[ko]": "내 시스템 잠그기", "Description[nl]": "Vergrendeld uw systemen", + "Description[nn]": "Lås systemet", "Description[pl]": "Zablokuj swoje systemy", "Description[pt]": "Bloqueia os seus sistemas", "Description[pt_BR]": "Bloqueia seus sistemas", + "Description[ru]": "Блокировка ваших систем", "Description[sk]": "Zamkne vaše systémy", "Description[sv]": "Låser dina system", + "Description[tr]": "Sistemlerinizi kilitler", "Description[uk]": "Блокує вашу систему", "Description[x-test]": "xxLocks your systemsxx", + "Description[zh_CN]": "锁定您的系统", "EnabledByDefault": true, "Icon": "applications-miscelaneaous", "Id": "kdeconnect_lockdevice", "License": "GPL", "Name": "LockDevice", + "Name[ast]": "Bloquiar preséu", + "Name[ca@valencia]": "Bloqueja el dispositiu", "Name[ca]": "Bloqueja el dispositiu", + "Name[cs]": "Uzamknout zařízení", "Name[de]": "Gerätesperrung", "Name[es]": "Bloquear dispositivo", "Name[fi]": "Lukitse laite", "Name[gl]": "Bloqueo do dispositivo", "Name[it]": "Blocco dispositivo", + "Name[ko]": "장치 잠금", "Name[nl]": "Apparaat vergrendelen", + "Name[nn]": "Lås eining", "Name[pl]": "ZablokujUrządzenie", "Name[pt]": "Bloqueio de Dispositivo", "Name[pt_BR]": "Bloqueio de dispositivo", + "Name[ru]": "Блокировка устройства", "Name[sk]": "Zamknúť zariadenie", "Name[sv]": "Lås enhet", - "Name[uk]": "LockDevice", + "Name[tr]": "AygıtıKilitle", "Name[x-test]": "xxLockDevicexx", + "Name[zh_CN]": "锁定设备", "ServiceTypes": [ "KdeConnect/Plugin" ], diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/mousepad/kdeconnect_mousepad.json kdeconnect-plasma-0.9+git20160315/plugins/mousepad/kdeconnect_mousepad.json --- kdeconnect-plasma-0.0+git20150810/plugins/mousepad/kdeconnect_mousepad.json 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/mousepad/kdeconnect_mousepad.json 2016-03-15 09:57:50.000000000 +0000 @@ -4,23 +4,28 @@ "Authors": [ { "Email": "ahmedibrahimkhali@gmail.com", - "Name": "Ahmed I. Khalil" + "Name": "Ahmed I. Khalil", + "Name[x-test]": "xxAhmed I. Khalilxx" } ], "Description": "Use your phone as a touchpad and keyboard", + "Description[ast]": "Usa'l to preséu como un panel táutil y tecláu", + "Description[ca@valencia]": "Empra el telèfon com un ratolí tàctil i teclat", "Description[ca]": "Empra el telèfon com un ratolí tàctil i teclat", "Description[cs]": "Používejte svůj telefon jako touchpad a klávesnici", "Description[de]": "Verwendet Ihr Handy als Touchpad und Tastatur", - "Description[en_GB]": "Use your phone as a touchpad and keyboard", "Description[es]": "Usar teléfono como panel táctil y teclado", "Description[fi]": "Käytä puhelintasi kosketuslevynä ja näppäimistönä", "Description[gl]": "Usar o teléfono móbil como touchpad e teclado.", "Description[hu]": "A telefon használata érintőtáblaként és billentyűzetként", "Description[it]": "Usa il telefono come touchpad e tastiera", + "Description[ko]": "휴대폰을 터치패드와 키보드로 사용", "Description[nl]": "Uw telefoon gebruiken als een touchpad en toetsenbord", + "Description[nn]": "Bruk telefonen som styreplate og tastatur", "Description[pl]": "Używaj swojego telefonu jako gładzika i klawiatury", "Description[pt]": "Use o seu telefone como um rato e teclado por toque", "Description[pt_BR]": "Use seu telefone como um touchpad e teclado", + "Description[ru]": "Использование телефона в качестве сенсорной панели и клавиатуры", "Description[sk]": "Použite váš telefón ako touchpad a klávesnicu", "Description[sv]": "Använd telefonen som mus och tangentbord", "Description[tr]": "Telefonunuzu dokunmatik yüzey ve klayve olarak kullanın", @@ -32,19 +37,23 @@ "Id": "kdeconnect_mousepad", "License": "GPL", "Name": "Virtual input", + "Name[ast]": "Entrada virtual", + "Name[ca@valencia]": "Entrada virtual", "Name[ca]": "Entrada virtual", "Name[cs]": "Virtuální vstup", "Name[de]": "Virtuelle Eingabe", - "Name[en_GB]": "Virtual input", "Name[es]": "Entrada virtual", "Name[fi]": "Virtuaalinen syöttö", "Name[gl]": "Entrada virtual", "Name[hu]": "Virtuális bevitel", "Name[it]": "Inserimento virtuale", + "Name[ko]": "가상 입력", "Name[nl]": "Virtuele invoer", + "Name[nn]": "Virtuelt tastatur", "Name[pl]": "Wirtualna obsługa", "Name[pt]": "Entrada virtual", "Name[pt_BR]": "Entrada virtual", + "Name[ru]": "Виртуальный ввод", "Name[sk]": "Virtuálny vstup", "Name[sv]": "Virtuell inmatning", "Name[tr]": "Sanal içe aktarma", diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/mousepad/mousepadplugin.cpp kdeconnect-plasma-0.9+git20160315/plugins/mousepad/mousepadplugin.cpp --- kdeconnect-plasma-0.0+git20150810/plugins/mousepad/mousepadplugin.cpp 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/mousepad/mousepadplugin.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -86,7 +86,7 @@ size_t arraySize(T(&arr)[N]) { (void)arr; return N; } MousepadPlugin::MousepadPlugin(QObject* parent, const QVariantList& args) - : KdeConnectPlugin(parent, args), m_fakekey(0), m_x11(QX11Info::isPlatformX11()) + : KdeConnectPlugin(parent, args), m_fakekey(nullptr), m_x11(QX11Info::isPlatformX11()) #if HAVE_WAYLAND , m_waylandInput(nullptr) , m_waylandAuthenticationRequested(false) @@ -101,7 +101,7 @@ { if (m_fakekey) { free(m_fakekey); - m_fakekey = 0; + m_fakekey = nullptr; } } @@ -208,8 +208,11 @@ } //We use fakekey here instead of XTest (above) because it can handle utf characters instead of keycodes. - fakekey_press(m_fakekey, (const unsigned char*)key.toUtf8().constData(), -1, 0); - fakekey_release(m_fakekey); + for (int i=0;iregisteredServiceNames().value(); - Q_FOREACH (const QString& iface, interfaces) { - if (iface.startsWith("org.mpris.MediaPlayer2")) { - addPlayer(iface); - } + QStringList services = QDBusConnection::sessionBus().interface()->registeredServiceNames().value(); + Q_FOREACH (const QString& service, services) { + addService(service); + } +} + +void MprisControlPlugin::addService(const QString& service) +{ + if (service.startsWith(QLatin1String("org.mpris.MediaPlayer2"))) { + addPlayer(service); } +} +void MprisControlPlugin::removeService(const QString& service) +{ + if (service.startsWith(QLatin1String("org.mpris.MediaPlayer2"))) { + removePlayer(service); + } } + void MprisControlPlugin::addPlayer(const QString& service) { QDBusInterface mprisInterface(service, "/org/mpris/MediaPlayer2", "org.mpris.MediaPlayer2"); //FIXME: This call hangs and returns an empty string if KDED is still starting! - const QString identity = mprisInterface.property("Identity").toString(); + QString identity = mprisInterface.property("Identity").toString(); + if (identity.isEmpty()) { + identity = service.mid(sizeof("org.mpris.MediaPlayer2")); + } playerList[identity] = service; qCDebug(KDECONNECT_PLUGIN_MPRIS) << "Mpris addPlayer" << service << "->" << identity; sendPlayerList(); OrgFreedesktopDBusPropertiesInterface* freedesktopInterface = new OrgFreedesktopDBusPropertiesInterface(service, "/org/mpris/MediaPlayer2", QDBusConnection::sessionBus(), this); - connect(freedesktopInterface, SIGNAL(PropertiesChanged(QString, QVariantMap, QStringList)), this, SLOT(propertiesChanged(QString, QVariantMap))); + connect(freedesktopInterface, SIGNAL(PropertiesChanged(QString,QVariantMap,QStringList)), this, SLOT(propertiesChanged(QString,QVariantMap))); OrgMprisMediaPlayer2PlayerInterface* mprisInterface0 = new OrgMprisMediaPlayer2PlayerInterface(service, "/org/mpris/MediaPlayer2", QDBusConnection::sessionBus()); connect(mprisInterface0, SIGNAL(Seeked(qlonglong)), this, SLOT(seeked(qlonglong))); @@ -166,6 +181,7 @@ //Do something to the mpris interface OrgMprisMediaPlayer2PlayerInterface mprisInterface(playerList[player], "/org/mpris/MediaPlayer2", QDBusConnection::sessionBus()); + mprisInterface.setTimeout(500); if (np.has("action")) { const QString& action = np.get("action"); //qCDebug(KDECONNECT_PLUGIN_MPRIS) << "Calling action" << action << "in" << playerList[player]; @@ -199,15 +215,16 @@ QString nowPlaying = nowPlayingMap["xesam:title"].toString(); if (nowPlayingMap.contains("xesam:artist")) { nowPlaying = nowPlayingMap["xesam:artist"].toString() + " - " + nowPlaying; - }if (nowPlayingMap.contains("mpris:length")) { + } + answer.set("nowPlaying",nowPlaying); + + if (nowPlayingMap.contains("mpris:length")) { qlonglong length = nowPlayingMap["mpris:length"].toLongLong(); answer.set("length",length/1000); } qlonglong pos = mprisInterface.position(); answer.set("pos", pos/1000); - answer.set("nowPlaying",nowPlaying); - bool playing = (mprisInterface.playbackStatus() == QLatin1String("Playing")); answer.set("isPlaying", playing); diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/mpriscontrol/mpriscontrolplugin.h kdeconnect-plasma-0.9+git20160315/plugins/mpriscontrol/mpriscontrolplugin.h --- kdeconnect-plasma-0.0+git20150810/plugins/mpriscontrol/mpriscontrolplugin.h 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/mpriscontrol/mpriscontrolplugin.h 2016-03-15 09:57:50.000000000 +0000 @@ -41,14 +41,17 @@ explicit MprisControlPlugin(QObject *parent, const QVariantList &args); public Q_SLOTS: - virtual bool receivePackage(const NetworkPackage& np); - virtual void connected() { } + virtual bool receivePackage(const NetworkPackage& np) override; + virtual void connected() override { } private Q_SLOTS: void propertiesChanged(const QString& propertyInterface, const QVariantMap& properties); void seeked(qlonglong); private: + void addService(const QString& service); + void removeService(const QString& service); + void addPlayer(const QString& ifaceName); void removePlayer(const QString& ifaceName); void sendPlayerList(); diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/mprisremote/kdeconnect_mprisremote.json kdeconnect-plasma-0.9+git20160315/plugins/mprisremote/kdeconnect_mprisremote.json --- kdeconnect-plasma-0.0+git20150810/plugins/mprisremote/kdeconnect_mprisremote.json 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/mprisremote/kdeconnect_mprisremote.json 2016-03-15 09:57:50.000000000 +0000 @@ -4,10 +4,13 @@ "Authors": [ { "Email": "aleixpol@kde.org", - "Name": "Aleix Pol" + "Name": "Aleix Pol", + "Name[x-test]": "xxAleix Polxx" } ], "Description": "Control MPRIS services", + "Description[ast]": "Controla servicios MPRIS", + "Description[ca@valencia]": "Serveis de control del MPRIS", "Description[ca]": "Serveis de control del MPRIS", "Description[cs]": "Ovládejte služby MPRIS", "Description[de]": "Steuerung von MPRIS-Diensten", @@ -15,36 +18,32 @@ "Description[fi]": "Ohjaa MPRIS-palveluita", "Description[gl]": "Controle servizos de MPRIS.", "Description[it]": "Servizi di controllo MPRIS", + "Description[ko]": "MPRIS 서비스 제어", "Description[nl]": "MPRIS-services besturen", + "Description[nn]": "Kontroller MPRIS-tenester", "Description[pl]": "Sterowanie usługami MPRIS", "Description[pt]": "Controlar os serviços MPRIS", "Description[pt_BR]": "Controle dos serviços MPRIS", + "Description[ru]": "Управление службами MPRIS", "Description[sk]": "Ovládať MPRIS služby", "Description[sv]": "Styr MPRIS-tjänster", "Description[tr]": "MPRIS servislerini kontrol et", "Description[uk]": "Керування службами MPRIS", "Description[x-test]": "xxControl MPRIS servicesxx", + "Description[zh_CN]": "控制 MPRIS 服务", "EnabledByDefault": true, "Icon": "applications-multimedia", "Id": "kdeconnect_mprisremote", "License": "GPL", "Name": "MprisRemote", - "Name[ca]": "MprisRemote", - "Name[cs]": "MprisRemote", - "Name[de]": "MprisRemote", - "Name[es]": "MprisRemote", "Name[fi]": "MPRIS-kauko-ohjain", - "Name[gl]": "MprisRemote", - "Name[it]": "MprisRemote", - "Name[nl]": "MprisRemote", + "Name[nn]": "MPRIS-fjernkontroll", "Name[pl]": "PilotMPRIS", "Name[pt]": "Comando MPRIS", - "Name[pt_BR]": "MprisRemote", - "Name[sk]": "MprisRemote", + "Name[ru]": "Удалённое управление MPRIS", "Name[sv]": "MPRIS-fjärrkontroll", - "Name[tr]": "MprisRemote", - "Name[uk]": "MprisRemote", "Name[x-test]": "xxMprisRemotexx", + "Name[zh_CN]": "远程 Mpris", "ServiceTypes": [ "KdeConnect/Plugin" ], diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/notifications/CMakeLists.txt kdeconnect-plasma-0.9+git20160315/plugins/notifications/CMakeLists.txt --- kdeconnect-plasma-0.0+git20150810/plugins/notifications/CMakeLists.txt 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/notifications/CMakeLists.txt 2016-03-15 09:57:50.000000000 +0000 @@ -1,9 +1,11 @@ -find_package(KF5 REQUIRED COMPONENTS Notifications) +find_package(KF5 REQUIRED COMPONENTS Notifications KCMUtils I18n IconThemes) set(kdeconnect_notifications_SRCS notification.cpp notificationsplugin.cpp notificationsdbusinterface.cpp + notificationslistener.cpp + notifyingapplication.cpp ) kdeconnect_add_plugin(kdeconnect_notifications JSON kdeconnect_notifications.json SOURCES ${kdeconnect_notifications_SRCS}) @@ -12,4 +14,27 @@ kdeconnectcore Qt5::DBus KF5::Notifications + KF5::I18n + KF5::IconThemes ) + +####################################### +# Config + +set( kdeconnect_notifications_config_SRCS + notifications_config.cpp + notifyingapplication.cpp + notifyingapplicationmodel.cpp +) +ki18n_wrap_ui( kdeconnect_notifications_config_SRCS notifications_config.ui ) + +add_library(kdeconnect_notifications_config MODULE ${kdeconnect_notifications_config_SRCS} ) +target_link_libraries( kdeconnect_notifications_config + kdeconnectcore + kdeconnectpluginkcm + KF5::I18n + KF5::KCMUtils +) + +install( TARGETS kdeconnect_notifications_config DESTINATION ${PLUGIN_INSTALL_DIR} ) +install( FILES kdeconnect_notifications_config.desktop DESTINATION ${SERVICES_INSTALL_DIR} ) diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/notifications/kdeconnect_notifications_config.desktop kdeconnect-plasma-0.9+git20160315/plugins/notifications/kdeconnect_notifications_config.desktop --- kdeconnect-plasma-0.0+git20150810/plugins/notifications/kdeconnect_notifications_config.desktop 1970-01-01 01:00:00.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/notifications/kdeconnect_notifications_config.desktop 2016-03-15 09:57:50.000000000 +0000 @@ -0,0 +1,30 @@ +[Desktop Entry] +Type=Service +X-KDE-ServiceTypes=KCModule + +X-KDE-Library=kdeconnect_notifications_config +X-KDE-ParentComponents=kdeconnect_notifications + +Name=Notification synchronization plugin settings +Name[ar]=إعدادات ملحقة مزامنة الإخطارات +Name[ast]=Axustes del complementu de sincronización d'avisos +Name[ca]=Ajustament del connector Sincronitza les notificacions +Name[ca@valencia]=Ajustament del connector Sincronitza les notificacions +Name[cs]=Nastavení modulu synchronizace upozornění +Name[de]=Einstellungen für Benachrichtigungsabgleich-Modul +Name[el]=Ρυθμίσεις πρόσθετου συγχρονισμού ειδοποιήσεων +Name[en_GB]=Notification synchronisation plugin settings +Name[es]=Preferencias del complemento de sincronización de notificaciones +Name[fi]=Ilmoitusten synkronointiliitännäisen asetukset +Name[gl]=Configuración do complemento de sincronización de notificacións +Name[it]=Impostazioni dell'estensione di sincronizzazione delle notifiche +Name[nl]=Instellingen van plug-in voor synchronisatie van meldingen +Name[pl]=Ustawienia wtyczki synchronizującej powiadomienia +Name[pt]=Configuração do 'plugin' de sincronização das notificações +Name[pt_BR]=Configuração do plugin de sincronização das notificações +Name[sk]=Nastavenia pluginu notifikácií synchronizácie +Name[sv]=Inställningar av insticksprogram för underrättelsesynkronisering +Name[uk]=Параметри додатка синхронізації сповіщень +Name[x-test]=xxNotification synchronization plugin settingsxx + +Categories=Qt;KDE;X-KDE-settings-kdeconnect; diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/notifications/kdeconnect_notifications.json kdeconnect-plasma-0.9+git20160315/plugins/notifications/kdeconnect_notifications.json --- kdeconnect-plasma-0.0+git20150810/plugins/notifications/kdeconnect_notifications.json 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/notifications/kdeconnect_notifications.json 2016-03-15 09:57:50.000000000 +0000 @@ -4,41 +4,52 @@ "Authors": [ { "Email": "albertvaka@gmail.com", - "Name": "Albert Vaca" + "Name": "Albert Vaca", + "Name[x-test]": "xxAlbert Vacaxx" } ], "Description": "Show phone notifications on your computer and keep them in sync", + "Description[ast]": "Amuesa los avisos del preséu nel to ordenador in caltiénlos sincronizaos", + "Description[ca@valencia]": "Mostra les notificacions del telèfon a l'ordinador i les manté sincronitzades", "Description[ca]": "Mostra les notificacions del telèfon a l'ordinador i les manté sincronitzades", "Description[cs]": "Zobrazit upozornění telefonu v počítači a udržovat je synchronizovaná", "Description[de]": "Benachrichtigungen auf Ihren Rechner anzeigen und abgleichen", "Description[es]": "Mostrar notificaciones del teléfono en su equipo y mantenerlas en sincronía", "Description[fi]": "Näytä puhelimen ilmoitukset tietokoneellasi ja pidä ne ajan tasalla", "Description[gl]": "Mostre notificacións dun teléfono móbil no computador e deixe que as notificacións se sincronicen co teléfono.", + "Description[hu]": "A telefon értesítéseinek megjelenítése a számítógépén és azok szinkronizációja", "Description[it]": "Mostra le notifiche del telefono sul tuo computer e tienile sincronizzate", + "Description[ko]": "휴대폰 알림을 컴퓨터에 표시하기", "Description[nl]": "Telefoonmeldingen op uw computer tonen en ze gesynchroniseerd houden", + "Description[nn]": "Vis telefonvarslingar på datamaskina, og hald dei synkronisert", "Description[pl]": "Pokaż powiadomienia telefonu na swoim komputerze i synchronizuj je", "Description[pt]": "Mostrar as notificações do telefone no seu computador e mantê-las sincronizadas", "Description[pt_BR]": "Mostra as notificações do celular no seu computador e as mantém sincronizadas", + "Description[ru]": "Показ уведомлений с телефона на компьютере и их синхронизация", "Description[sk]": "Zobraziť oznámenia telefónu na vašom počítači a udržať ich synchronizované", "Description[sv]": "Visa telefonunderrättelser på datorn och håll dem synkroniserade", "Description[tr]": "Telefon bildirimlerini bilgisayarınızla eşitler ve eşzamanlı tutar", "Description[uk]": "Показ сповіщень з телефону на вашому комп’ютері та підтримання синхронізації даних сповіщень", "Description[x-test]": "xxShow phone notifications on your computer and keep them in syncxx", + "Description[zh_CN]": "在电脑显示手机通知并保持同步", "EnabledByDefault": true, "Icon": "preferences-desktop-notification", "Id": "kdeconnect_notifications", "License": "GPL", "Name": "Notification sync", + "Name[ast]": "Sincronización d'avisos", + "Name[ca@valencia]": "Sincronització de les notificacions", "Name[ca]": "Sincronització de les notificacions", "Name[cs]": "Synchronizace upozornění", "Name[de]": "Benachrichtigungs-Abgleich", - "Name[en_GB]": "Notification sync", "Name[es]": "Sincronización de notificaciones", "Name[fi]": "Ilmoitusten synkronointi", "Name[gl]": "Sincronización de notificacións", "Name[hu]": "Értesítésszinkronizáció", "Name[it]": "Sincronizzazione notifiche", + "Name[ko]": "알림 동기화", "Name[nl]": "Synchronisatie van meldingen", + "Name[nn]": "Synkronisering av varslingar", "Name[pl]": "Powiadomienia synchronizacji", "Name[pt]": "Sincronização de notificações", "Name[pt_BR]": "Sincronização de notificações", diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/notifications/notification.cpp kdeconnect-plasma-0.9+git20160315/plugins/notifications/notification.cpp --- kdeconnect-plasma-0.0+git20150810/plugins/notifications/notification.cpp 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/notifications/notification.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -25,7 +25,7 @@ Notification::Notification(const NetworkPackage& np, const QString& iconPath, QObject* parent) : QObject(parent) { - mId = np.get("id"); + mInternalId = np.get("id"); mAppName = np.get("appName"); mTicker = np.get("ticker"); mDismissable = np.get("isClearable"); @@ -40,7 +40,7 @@ void Notification::dismiss() { if (mDismissable) { - Q_EMIT dismissRequested(this); + Q_EMIT dismissRequested(mInternalId); } } diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/notifications/notification_debug.h kdeconnect-plasma-0.9+git20160315/plugins/notifications/notification_debug.h --- kdeconnect-plasma-0.0+git20150810/plugins/notifications/notification_debug.h 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/notifications/notification_debug.h 2016-03-15 09:57:50.000000000 +0000 @@ -25,4 +25,4 @@ Q_DECLARE_LOGGING_CATEGORY(KDECONNECT_PLUGIN_NOTIFICATION) -#endif //NOTIFICATION_DEBUG_H \ No newline at end of file +#endif //NOTIFICATION_DEBUG_H diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/notifications/notification.h kdeconnect-plasma-0.9+git20160315/plugins/notifications/notification.h --- kdeconnect-plasma-0.0+git20150810/plugins/notifications/notification.h 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/notifications/notification.h 2016-03-15 09:57:50.000000000 +0000 @@ -41,7 +41,7 @@ Notification(const NetworkPackage& np, const QString& iconPath, QObject* parent); virtual ~Notification(); - QString internalId() const { return mId; } + QString internalId() const { return mInternalId; } QString appName() const { return mAppName; } QString ticker() const { return mTicker; } QString iconPath() const { return mIconPath; } @@ -51,10 +51,10 @@ Q_SCRIPTABLE void dismiss(); Q_SIGNALS: - void dismissRequested(Notification* self); + void dismissRequested(const QString& mInternalId); private: - QString mId; + QString mInternalId; QString mAppName; QString mTicker; QString mIconPath; diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/notifications/notifications_config.cpp kdeconnect-plasma-0.9+git20160315/plugins/notifications/notifications_config.cpp --- kdeconnect-plasma-0.0+git20150810/plugins/notifications/notifications_config.cpp 1970-01-01 01:00:00.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/notifications/notifications_config.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -0,0 +1,119 @@ +/** + * Copyright 2015 Holger Kaelberer + * + * 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 . + */ + +#include "notifications_config.h" +#include "ui_notifications_config.h" +#include "notifyingapplicationmodel.h" + +#include +#include + +K_PLUGIN_FACTORY(NotificationsConfigFactory, registerPlugin();) + +NotificationsConfig::NotificationsConfig(QWidget *parent, const QVariantList& args) + : KdeConnectPluginKcm(parent, args, "kdeconnect_notifications_config") + , m_ui(new Ui::NotificationsConfigUi()) + , appModel(new NotifyingApplicationModel) +{ + qRegisterMetaTypeStreamOperators("NotifyingApplication"); + + m_ui->setupUi(this); + m_ui->appList->setIconSize(QSize(32,32)); + + m_ui->appList->setModel(appModel); + + m_ui->appList->horizontalHeader()->setSectionResizeMode(0, QHeaderView::QHeaderView::Fixed); + m_ui->appList->horizontalHeader()->setSectionResizeMode(1, QHeaderView::QHeaderView::Stretch); + m_ui->appList->horizontalHeader()->setSectionResizeMode(2, QHeaderView::QHeaderView::Stretch); + for (int i = 0; i < 3; i++) + m_ui->appList->resizeColumnToContents(i); + + connect(m_ui->appList->horizontalHeader(), SIGNAL(sortIndicatorChanged(int,Qt::SortOrder)), + m_ui->appList, SLOT(sortByColumn(int))); + + connect(m_ui->check_persistent, SIGNAL(toggled(bool)), this, SLOT(changed())); + connect(m_ui->spin_urgency, SIGNAL(editingFinished()), this, SLOT(changed())); + connect(m_ui->check_body, SIGNAL(toggled(bool)), this, SLOT(changed())); + connect(m_ui->check_icons, SIGNAL(toggled(bool)), this, SLOT(changed())); + + connect(appModel, SIGNAL(applicationsChanged()), this, SLOT(changed())); + + connect(config(), SIGNAL(configChanged()), this, SLOT(loadApplications())); +} + +NotificationsConfig::~NotificationsConfig() +{ + delete m_ui; +} + +void NotificationsConfig::defaults() +{ + KCModule::defaults(); + m_ui->check_persistent->setChecked(false); + m_ui->spin_urgency->setValue(0); + m_ui->check_body->setChecked(true); + m_ui->check_icons->setChecked(true); + Q_EMIT changed(true); +} + +void NotificationsConfig::loadApplications() +{ + appModel->clearApplications(); + QVariantList list = config()->getList("applications"); + for (const auto& a: list) { + NotifyingApplication app = a.value(); + if (!appModel->containsApp(app.name)) { + appModel->appendApp(app); + } + } +} + +void NotificationsConfig::load() +{ + KCModule::load(); + bool persistent = config()->get("generalPersistent", false); + m_ui->check_persistent->setChecked(persistent); + bool body = config()->get("generalIncludeBody", true); + m_ui->check_body->setChecked(body); + bool icons = config()->get("generalSynchronizeIcons", true); + m_ui->check_icons->setChecked(icons); + int urgency = config()->get("generalUrgency", 0); + m_ui->spin_urgency->setValue(urgency); + + loadApplications(); + Q_EMIT changed(false); +} + +void NotificationsConfig::save() +{ + config()->set("generalPersistent", m_ui->check_persistent->isChecked()); + config()->set("generalIncludeBody", m_ui->check_body->isChecked()); + config()->set("generalSynchronizeIcons", m_ui->check_icons->isChecked()); + config()->set("generalUrgency", m_ui->spin_urgency->value()); + + QVariantList list; + for (const auto& a: appModel->apps()) + list << QVariant::fromValue(a); + config()->setList("applications", list); + KCModule::save(); + Q_EMIT changed(false); +} + +#include "notifications_config.moc" diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/notifications/notifications_config.h kdeconnect-plasma-0.9+git20160315/plugins/notifications/notifications_config.h --- kdeconnect-plasma-0.0+git20150810/plugins/notifications/notifications_config.h 1970-01-01 01:00:00.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/notifications/notifications_config.h 2016-03-15 09:57:50.000000000 +0000 @@ -0,0 +1,54 @@ +/** + * Copyright 2015 Holger Kaelberer + * + * 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 . + */ + +#ifndef NOTIFICATIONS_CONFIG_H +#define NOTIFICATIONS_CONFIG_H + +#include "kcmplugin/kdeconnectpluginkcm.h" + +namespace Ui { + class NotificationsConfigUi; +} + +class NotifyingApplicationModel; + +class NotificationsConfig + : public KdeConnectPluginKcm +{ + Q_OBJECT +public: + NotificationsConfig(QWidget *parent, const QVariantList&); + virtual ~NotificationsConfig(); + +public Q_SLOTS: + virtual void save() override; + virtual void load() override; + virtual void defaults() override; + +private Q_SLOTS: + void loadApplications(); + +private: + Ui::NotificationsConfigUi* m_ui; + NotifyingApplicationModel* appModel; + +}; + +#endif diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/notifications/notifications_config.ui kdeconnect-plasma-0.9+git20160315/plugins/notifications/notifications_config.ui --- kdeconnect-plasma-0.0+git20150810/plugins/notifications/notifications_config.ui 1970-01-01 01:00:00.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/notifications/notifications_config.ui 2016-03-15 09:57:50.000000000 +0000 @@ -0,0 +1,226 @@ + + + NotificationsConfigUi + + + Qt::WindowModal + + + + 0 + 0 + 350 + 326 + + + + + 0 + 0 + + + + + 350 + 0 + + + + Pause music plugin + + + + + + + 0 + 0 + + + + + 11 + 75 + true + + + + General + + + + + + + 50 + false + + + + Synchronize only notifications with a timeout value of 0? + + + Persistent notifications only + + + + + + + + 50 + false + + + + Append the notification body to the summary when synchronizing notifications? + + + Include body + + + + + + + + 50 + false + + + + Synchronize icons of notifying applications if possible? + + + Synchronize icons + + + + + + + + 0 + 0 + + + + + + + + 40 + 32 + + + + + 50 + false + + + + <html><head/><body><p>Minimum urgency level of the notifications</p></body></html> + + + 2 + + + + + + + + 50 + false + + + + Synchronize only notifications with the given urgency level. + + + Minimum urgency level + + + + + + + + + + + + + + 0 + 0 + + + + + 75 + true + + + + + + + Applications + + + + + + + 0 + 0 + + + + + 50 + false + + + + true + + + false + + + Qt::NoPen + + + true + + + true + + + 150 + + + 20 + + + true + + + true + + + false + + + + + + + + + + + diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/notifications/notificationsdbusinterface.cpp kdeconnect-plasma-0.9+git20160315/plugins/notifications/notificationsdbusinterface.cpp --- kdeconnect-plasma-0.0+git20150810/plugins/notifications/notificationsdbusinterface.cpp 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/notifications/notificationsdbusinterface.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -41,12 +41,11 @@ , imagesDir(QDir::temp().absoluteFilePath("kdeconnect")) { imagesDir.mkpath(imagesDir.absolutePath()); - } NotificationsDbusInterface::~NotificationsDbusInterface() { - clearNotifications(); + qCDebug(KDECONNECT_PLUGIN_NOTIFICATION) << "Destroying NotificationsDbusInterface"; } void NotificationsDbusInterface::clearNotifications() @@ -62,10 +61,23 @@ void NotificationsDbusInterface::processPackage(const NetworkPackage& np) { if (np.get("isCancel")) { - removeNotification(np.get("id")); + QString id = np.get("id"); + // cut off kdeconnect-android's prefix if there: + if (id.startsWith("org.kde.kdeconnect_tp::")) + id = id.mid(id.indexOf("::") + 2); + removeNotification(id); + } else if (np.get("isRequest")) { + for (const auto& n: mNotifications) { + NetworkPackage np(PACKAGE_TYPE_NOTIFICATION); + np.set("id", n->internalId()); + np.set("appName", n->appName()); + np.set("ticker", n->ticker()); + np.set("isClearable", n->dismissable()); + np.set("requestAnswer", true); + mPlugin->sendPackage(np); + } } else { - //TODO: Uncoment when we are able to display app icon on plasmoid QString destination; /* @@ -101,8 +113,8 @@ removeNotification(internalId); } - connect(noti, SIGNAL(dismissRequested(Notification*)), - this, SLOT(dismissRequested(Notification*))); + connect(noti, &Notification::dismissRequested, + this, &NotificationsDbusInterface::dismissRequested); const QString& publicId = newId(); mNotifications[publicId] = noti; @@ -117,7 +129,7 @@ qCDebug(KDECONNECT_PLUGIN_NOTIFICATION) << "removeNotification" << internalId; if (!mInternalIdToPublicId.contains(internalId)) { - qCDebug(KDECONNECT_PLUGIN_NOTIFICATION) << "Not found"; + qCDebug(KDECONNECT_PLUGIN_NOTIFICATION) << "Not found: " << internalId; return; } @@ -136,10 +148,8 @@ Q_EMIT notificationRemoved(publicId); } -void NotificationsDbusInterface::dismissRequested(Notification* notification) +void NotificationsDbusInterface::dismissRequested(const QString& internalId) { - const QString& internalId = notification->internalId(); - NetworkPackage np(PACKAGE_TYPE_NOTIFICATION); np.set("cancel", internalId); mPlugin->sendPackage(np); diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/notifications/notificationsdbusinterface.h kdeconnect-plasma-0.9+git20160315/plugins/notifications/notificationsdbusinterface.h --- kdeconnect-plasma-0.0+git20150810/plugins/notifications/notificationsdbusinterface.h 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/notifications/notificationsdbusinterface.h 2016-03-15 09:57:50.000000000 +0000 @@ -44,17 +44,17 @@ void processPackage(const NetworkPackage& np); void clearNotifications(); + void dismissRequested(const QString& notification); + void addNotification(Notification* noti); public Q_SLOTS: Q_SCRIPTABLE QStringList activeNotifications(); - void dismissRequested(Notification* notification); Q_SIGNALS: Q_SCRIPTABLE void notificationPosted(const QString& publicId); Q_SCRIPTABLE void notificationRemoved(const QString& publicId); private /*methods*/: - void addNotification(Notification* noti); void removeNotification(const QString& internalId); QString newId(); //Generates successive identifitiers to use as public ids diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/notifications/notificationslistener.cpp kdeconnect-plasma-0.9+git20160315/plugins/notifications/notificationslistener.cpp --- kdeconnect-plasma-0.0+git20150810/plugins/notifications/notificationslistener.cpp 1970-01-01 01:00:00.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/notifications/notificationslistener.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -0,0 +1,183 @@ +/** + * Copyright 2015 Holger Kaelberer + * + * 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 . + */ + +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include "notificationslistener.h" +#include "notificationsplugin.h" +#include "notification_debug.h" +#include "notificationsdbusinterface.h" +#include "notifyingapplication.h" + +NotificationsListener::NotificationsListener(KdeConnectPlugin* aPlugin, + NotificationsDbusInterface* aDbusInterface) + : QDBusAbstractAdaptor(aPlugin), + mPlugin(aPlugin), + dbusInterface(aDbusInterface) +{ + qRegisterMetaTypeStreamOperators("NotifyingApplication"); + + bool ret = QDBusConnection::sessionBus() + .registerObject("/org/freedesktop/Notifications", + this, + QDBusConnection::ExportScriptableContents); + if (!ret) + qCWarning(KDECONNECT_PLUGIN_NOTIFICATION) + << "Error registering notifications listener for device" + << mPlugin->device()->name() << ":" + << QDBusConnection::sessionBus().lastError(); + else + qCDebug(KDECONNECT_PLUGIN_NOTIFICATION) + << "Registered notifications listener for device" + << mPlugin->device()->name(); + + QDBusInterface iface("org.freedesktop.DBus", "/org/freedesktop/DBus", + "org.freedesktop.DBus"); + iface.call("AddMatch", + "interface='org.freedesktop.Notifications',member='Notify',type='method_call',eavesdrop='true'"); + + loadApplications(); + + connect(mPlugin->config(), SIGNAL(configChanged()), this, SLOT(loadApplications())); +} + +NotificationsListener::~NotificationsListener() +{ + qCDebug(KDECONNECT_PLUGIN_NOTIFICATION) << "Destroying NotificationsListener"; + QDBusInterface iface("org.freedesktop.DBus", "/org/freedesktop/DBus", + "org.freedesktop.DBus"); + QDBusMessage res = iface.call("RemoveMatch", + "interface='org.freedesktop.Notifications',member='Notify',type='method_call',eavesdrop='true'"); + QDBusConnection::sessionBus().unregisterObject("/org/freedesktop/Notifications"); +} + +void NotificationsListener::loadApplications() +{ + applications.clear(); + QVariantList list = mPlugin->config()->getList("applications"); + for (const auto& a: list) { + NotifyingApplication app = a.value(); + if (!applications.contains(app.name)) + applications.insert(app.name, app); + } + //qCDebug(KDECONNECT_PLUGIN_NOTIFICATION) << "Loaded" << applications.size() << " applications"; +} + +uint NotificationsListener::Notify(const QString &appName, uint replacesId, + const QString &appIcon, + const QString &summary, const QString &body, + const QStringList &actions, + const QVariantMap &hints, int timeout) +{ + static int id = 0; + Q_UNUSED(actions); + + //qCDebug(KDECONNECT_PLUGIN_NOTIFICATION) << "Got notification appName=" << appName << "replacesId=" << replacesId << "appIcon=" << appIcon << "summary=" << summary << "body=" << body << "actions=" << actions << "hints=" << hints << "timeout=" << timeout; + + // skip our own notifications + if (appName == QLatin1String("KDE Connect")) + return 0; + + NotifyingApplication app; + if (!applications.contains(appName)) { + // new application -> add to config + app.name = appName; + app.icon = appIcon; + app.active = true; + app.blacklistExpression = QRegularExpression(); + applications.insert(app.name, app); + // update config: + QVariantList list; + for (const auto& a: applications.values()) + list << QVariant::fromValue(a); + mPlugin->config()->setList("applications", list); + //qCDebug(KDECONNECT_PLUGIN_NOTIFICATION) << "Added new application to config:" << app; + } else + app = applications.value(appName); + + if (!app.active) + return 0; + + if (timeout > 0 && mPlugin->config()->get("generalPersistent", false)) + return 0; + + int urgency = -1; + if (hints.contains("urgency")) { + bool ok; + urgency = hints["urgency"].toInt(&ok); + if (!ok) + urgency = -1; + } + if (urgency > -1 && urgency < mPlugin->config()->get("generalUrgency", 0)) + return 0; + + QString ticker = summary; + if (!body.isEmpty() && mPlugin->config()->get("generalIncludeBody", true)) + ticker += QLatin1String(": ") + body; + + if (app.blacklistExpression.isValid() && + !app.blacklistExpression.pattern().isEmpty() && + app.blacklistExpression.match(ticker).hasMatch()) + return 0; + + //qCDebug(KDECONNECT_PLUGIN_NOTIFICATION) << "Sending notification from" << appName << ":" < 0 ? replacesId : ++id)); + np.set("appName", appName); + np.set("ticker", ticker); + np.set("isClearable", timeout == 0); // KNotifications are persistent if + // timeout == 0, for other notifications + // clearability is pointless + + if (!appIcon.isEmpty() && mPlugin->config()->get("generalSynchronizeIcons", true)) { + int size = KIconLoader::SizeEnormous; // use big size to allow for good + // quality on High-DPI mobile devices + QString iconPath = KIconLoader::global()->iconPath(appIcon, -size, true); + if (!iconPath.isEmpty()) { + if (!iconPath.endsWith(QLatin1String(".png")) && + KIconLoader::global()->theme()->name() != QLatin1String("hicolor")) { + // try falling back to hicolor theme: + KIconTheme hicolor(QStringLiteral("hicolor")); + if (hicolor.isValid()) { + iconPath = hicolor.iconPath(appIcon + ".png", size, KIconLoader::MatchBest); + //qCDebug(KDECONNECT_PLUGIN_NOTIFICATION) << "Found non-png icon in default theme trying fallback to hicolor:" << iconPath; + } + } + if (iconPath.endsWith(QLatin1String(".png"))) { + //qCDebug(KDECONNECT_PLUGIN_NOTIFICATION) << "Appending icon " << iconPath; + QSharedPointer iconFile(new QFile(iconPath)); + np.setPayload(iconFile, iconFile->size()); + } + } + } + + mPlugin->sendPackage(np); + + return (replacesId > 0 ? replacesId : id); +} diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/notifications/notificationslistener.h kdeconnect-plasma-0.9+git20160315/plugins/notifications/notificationslistener.h --- kdeconnect-plasma-0.0+git20150810/plugins/notifications/notificationslistener.h 1970-01-01 01:00:00.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/notifications/notificationslistener.h 2016-03-15 09:57:50.000000000 +0000 @@ -0,0 +1,52 @@ +/** + * Copyright 2015 Holger Kaelberer + * + * 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 . + */ + +#include +#include + +class KdeConnectPlugin; +class NotificationsDbusInterface; +class Notification; +struct NotifyingApplication; + +class NotificationsListener : public QDBusAbstractAdaptor +{ + Q_OBJECT + Q_CLASSINFO("D-Bus Interface", "org.freedesktop.Notifications") + +public: + explicit NotificationsListener(KdeConnectPlugin* aPlugin, + NotificationsDbusInterface* aDbusInterface); + virtual ~NotificationsListener(); + +protected: + KdeConnectPlugin* mPlugin; + NotificationsDbusInterface* dbusInterface; + QHash applications; + +public Q_SLOTS: + Q_SCRIPTABLE uint Notify(const QString&, uint, const QString&, + const QString&, const QString&, + const QStringList&, const QVariantMap&, int); + +private Q_SLOTS: + void loadApplications(); + +}; diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/notifications/notificationsplugin.cpp kdeconnect-plasma-0.9+git20160315/plugins/notifications/notificationsplugin.cpp --- kdeconnect-plasma-0.0+git20150810/plugins/notifications/notificationsplugin.cpp 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/notifications/notificationsplugin.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -21,6 +21,7 @@ #include "notificationsplugin.h" #include "notificationsdbusinterface.h" +#include "notificationslistener.h" #include "notification_debug.h" #include @@ -33,6 +34,7 @@ : KdeConnectPlugin(parent, args) { notificationsDbusInterface = new NotificationsDbusInterface(this); + notificationsListener = new NotificationsListener(this, notificationsDbusInterface); } void NotificationsPlugin::connected() @@ -44,6 +46,7 @@ NotificationsPlugin::~NotificationsPlugin() { + qCDebug(KDECONNECT_PLUGIN_NOTIFICATION) << "Destroying NotificationsPlugin"; //FIXME: Qt dbus does not allow to remove an adaptor! (it causes a crash in // the next dbus access to its parent). The implication of not deleting this // is that disabling the plugin leaks the interface. As a mitigation we are diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/notifications/notificationsplugin.h kdeconnect-plasma-0.9+git20160315/plugins/notifications/notificationsplugin.h --- kdeconnect-plasma-0.0+git20150810/plugins/notifications/notificationsplugin.h 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/notifications/notificationsplugin.h 2016-03-15 09:57:50.000000000 +0000 @@ -32,6 +32,7 @@ * KdeConnectPlugin at the same time (both are QObject) */ class NotificationsDbusInterface; +class NotificationsListener; class NotificationsPlugin : public KdeConnectPlugin @@ -43,11 +44,12 @@ virtual ~NotificationsPlugin(); public Q_SLOTS: - virtual bool receivePackage(const NetworkPackage& np); - virtual void connected(); + virtual bool receivePackage(const NetworkPackage& np) override; + virtual void connected() override; -private: +protected: NotificationsDbusInterface* notificationsDbusInterface; + NotificationsListener* notificationsListener; }; diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/notifications/notifyingapplication.cpp kdeconnect-plasma-0.9+git20160315/plugins/notifications/notifyingapplication.cpp --- kdeconnect-plasma-0.0+git20150810/plugins/notifications/notifyingapplication.cpp 1970-01-01 01:00:00.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/notifications/notifyingapplication.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -0,0 +1,50 @@ +/** + * Copyright 2015 Holger Kaelberer + * + * 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 . + */ + +#include "notifyingapplication.h" + +#include +#include + +QDataStream &operator<<(QDataStream &out, const NotifyingApplication &app) +{ + out << app.name << app.icon << app.active << app.blacklistExpression.pattern(); + return out; +} + +QDataStream &operator>>(QDataStream &in, NotifyingApplication &app) +{ + QString pattern; + in >> app.name; + in >> app.icon; + in >> app.active; + in >> pattern; + app.blacklistExpression.setPattern(pattern); + return in; +} + +QDebug operator<<(QDebug dbg, const NotifyingApplication& a) { + dbg.nospace() << "{ name=" << a.name + << ", icon=" << a.icon + << ", active=" << a.active + << ", blacklistExpression =" << a.blacklistExpression + << " }"; + return dbg.space(); +} diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/notifications/notifyingapplication.h kdeconnect-plasma-0.9+git20160315/plugins/notifications/notifyingapplication.h --- kdeconnect-plasma-0.0+git20150810/plugins/notifications/notifyingapplication.h 1970-01-01 01:00:00.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/notifications/notifyingapplication.h 2016-03-15 09:57:50.000000000 +0000 @@ -0,0 +1,44 @@ +/** + * Copyright 2015 Holger Kaelberer + * + * 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 . + */ + +#ifndef NOTIFYINGAPPLICATION_H +#define NOTIFYINGAPPLICATION_H + +#include +#include + +struct NotifyingApplication { + QString name; + QString icon; + bool active; + QRegularExpression blacklistExpression; + + bool operator==(const NotifyingApplication& other) const { + return (name == other.name); + } +}; + +Q_DECLARE_METATYPE(NotifyingApplication); + +QDataStream &operator<<(QDataStream &out, const NotifyingApplication &app); +QDataStream &operator>>(QDataStream &in, NotifyingApplication &app); +QDebug operator<<(QDebug dbg, const NotifyingApplication &a); + +#endif //NOTIFYINGAPPLICATION_H diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/notifications/notifyingapplicationmodel.cpp kdeconnect-plasma-0.9+git20160315/plugins/notifications/notifyingapplicationmodel.cpp --- kdeconnect-plasma-0.0+git20150810/plugins/notifications/notifyingapplicationmodel.cpp 1970-01-01 01:00:00.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/notifications/notifyingapplicationmodel.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -0,0 +1,235 @@ +/** + * Copyright 2015 Holger Kaelberer + * + * 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 . + */ + +#include +#include +#include +#include +#include + +#include "notifyingapplicationmodel.h" +//#include "modeltest.h" + +NotifyingApplicationModel::NotifyingApplicationModel(QObject *parent) + : QAbstractTableModel(parent) +{ +} + +NotifyingApplicationModel::~NotifyingApplicationModel() +{ +} + +QVector NotifyingApplicationModel::apps() +{ + return m_apps; +} + +void NotifyingApplicationModel::appendApp(const NotifyingApplication& app) +{ + if (app.name.isEmpty() || apps().contains(app)) + return; + beginInsertRows(QModelIndex(), m_apps.size(), m_apps.size()); + m_apps.append(app); + endInsertRows(); +} + +bool NotifyingApplicationModel::containsApp(const QString& name) const +{ + for (const auto& a: m_apps) + if (a.name == name) + return true; + return false; +} + +Qt::ItemFlags NotifyingApplicationModel::flags(const QModelIndex& index) const +{ + Qt::ItemFlags flags = Qt::ItemIsEnabled; + if (index.isValid() && index.row() >= 0 && index.row() < m_apps.size() && + index.column() < 3) + { + if (index.column() == 0) + flags |= Qt::ItemIsEditable | Qt::ItemIsUserCheckable; + else if (index.column() == 2) { + if (m_apps[index.row()].active) + flags |= Qt::ItemIsEditable; + else + flags ^= Qt::ItemIsEnabled; + } + else if (index.column() == 1) { + if (!m_apps[index.row()].active) + flags ^= Qt::ItemIsEnabled; + } + } + return flags; +} + +void NotifyingApplicationModel::clearApplications() +{ + if (!m_apps.isEmpty()) { + beginRemoveRows(QModelIndex(), 0, m_apps.size() - 1); + m_apps.clear(); + endRemoveRows(); + } +} + +QVariant NotifyingApplicationModel::data(const QModelIndex& index, int role) const +{ + Q_UNUSED(role); + if (!index.isValid() + || index.row() < 0 + || index.row() >= m_apps.size() + || index.column() > 3) + { + return QVariant(); + } + + switch (role) { + case Qt::TextAlignmentRole: { + if (index.column() == 0) + return int(Qt::AlignCenter | Qt::AlignVCenter ); + else + return int(Qt::AlignLeft | Qt::AlignVCenter ); + break; + } + case Qt::DisplayRole: { + if (index.column() == 1) + return m_apps[index.row()].name; + else if (index.column() == 0) + return QVariant();//m_apps[index.row()].active; + else if (index.column() == 2) + return m_apps[index.row()].blacklistExpression.pattern(); + else + return QVariant(); + break; + } + case Qt::DecorationRole: { + if (index.column() == 1) + return QIcon::fromTheme(m_apps[index.row()].icon, QIcon::fromTheme("application-x-executable")); + else + return QVariant(); + break; + } + case Qt::EditRole: { + if (index.column() == 0) + return m_apps[index.row()].active ? Qt::Checked : Qt::Unchecked; + else if (index.column() == 2) + return m_apps[index.row()].blacklistExpression.pattern(); + else + return QVariant(); + break; + } + case Qt::CheckStateRole: { + if (index.column() == 0) + return m_apps[index.row()].active ? Qt::Checked : Qt::Unchecked; + else + return QVariant(); + break; + } + } + return QVariant(); +} + +bool NotifyingApplicationModel::setData(const QModelIndex &index, const QVariant &value, int role) +{ + if (!index.isValid() || + (index.column() != 0 && index.column() != 2) || + index.row() < 0 || index.row() >= m_apps.size()) + return false; + + bool res = false; + QModelIndex bottomRight = createIndex(index.row(), index.column()); + switch (role) { + case Qt::CheckStateRole: { + if (index.column() == 0) { + m_apps[index.row()].active = ((Qt::CheckState)value.toInt() == Qt::Checked); + bottomRight = createIndex(index.row(), index.column() + 1); + res = true; + } + break; + } + case Qt::EditRole: { + if (index.column() == 2) { + m_apps[index.row()].blacklistExpression.setPattern(value.toString()); + res = true; + } + } + } + if (res) { + Q_EMIT dataChanged(index, bottomRight); + Q_EMIT applicationsChanged(); // -> notify config that we need to save + } + return res; +} + +void NotifyingApplicationModel::sort(int column, Qt::SortOrder order) +{ + if (column != 1) + return; + + if (order == Qt::AscendingOrder) + std::sort(m_apps.begin(), m_apps.end(), + [](const NotifyingApplication& a, const NotifyingApplication& b) { + return (a.name.compare(b.name, Qt::CaseInsensitive) < 1); + }); + else + std::sort(m_apps.begin(), m_apps.end(), + [](const NotifyingApplication& a, const NotifyingApplication& b) { + return (b.name.compare(a.name, Qt::CaseInsensitive) < 1); + }); + Q_EMIT dataChanged(createIndex(0, 0), createIndex(m_apps.size(), 2)); +} + +QVariant NotifyingApplicationModel::headerData(int section, Qt::Orientation /*orientation*/, + int role) const +{ + switch (role) { + case Qt::DisplayRole: { + if (section == 1) + return i18n("Name"); + else if (section == 0) + return QVariant(); //i18n("Sync"); + else + return i18n("Blacklisted"); + } + case Qt::ToolTipRole: { + if (section == 1) + return i18n("Name of a notifying application."); + else if (section == 0) + return i18n("Synchronize notifications of an application?"); + else + return i18n("Regular expression defining which notifications should not be sent.\nThis pattern is applied to the summary and, if selected above, the body of notifications."); + } + } + return QVariant(); +} + +int NotifyingApplicationModel::columnCount(const QModelIndex&) const +{ + return 3; +} + +int NotifyingApplicationModel::rowCount(const QModelIndex& parent) const +{ + if(parent.isValid()) { + //Return size 0 if we are a child because this is not a tree + return 0; + } + return m_apps.size(); +} diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/notifications/notifyingapplicationmodel.h kdeconnect-plasma-0.9+git20160315/plugins/notifications/notifyingapplicationmodel.h --- kdeconnect-plasma-0.0+git20150810/plugins/notifications/notifyingapplicationmodel.h 1970-01-01 01:00:00.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/notifications/notifyingapplicationmodel.h 2016-03-15 09:57:50.000000000 +0000 @@ -0,0 +1,56 @@ +/** + * Copyright 2015 Holger Kaelberer + * + * 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 . + */ + +#ifndef NOTIFYINGAPPLICATIONMODEL_H +#define NOTIFYINGAPPLICATIONMODEL_H + +#include + +#include "notifyingapplication.h" + +class NotifyingApplicationModel: public QAbstractTableModel +{ + Q_OBJECT + +public: + explicit NotifyingApplicationModel(QObject *parent = nullptr); + virtual ~NotifyingApplicationModel(); + + virtual QVariant data(const QModelIndex& index, int role) const override; + virtual bool setData(const QModelIndex &index, const QVariant &value, int role) override; + virtual int rowCount(const QModelIndex& parent = QModelIndex()) const override; + virtual int columnCount(const QModelIndex& parent = QModelIndex()) const override; + virtual Qt::ItemFlags flags(const QModelIndex & index) const override; + virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const override; + virtual void sort(int column, Qt::SortOrder order = Qt::AscendingOrder) override; + + QVector apps(); + void clearApplications(); + void appendApp(const NotifyingApplication& app); + bool containsApp(const QString& name) const; + +Q_SIGNALS: + void applicationsChanged(); + +private: + QVector m_apps; +}; + +#endif // NOTIFYINGAPPLICATIONMODEL_H diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/pausemusic/kdeconnect_pausemusic_config.desktop kdeconnect-plasma-0.9+git20160315/plugins/pausemusic/kdeconnect_pausemusic_config.desktop --- kdeconnect-plasma-0.0+git20150810/plugins/pausemusic/kdeconnect_pausemusic_config.desktop 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/pausemusic/kdeconnect_pausemusic_config.desktop 2016-03-15 09:57:50.000000000 +0000 @@ -6,12 +6,16 @@ X-KDE-ParentComponents=kdeconnect_pausemusic Name=Pause Music plugin settings +Name[ar]=إعدادات ملحقة إلباث الموسيقى +Name[ast]=Axustes del complementu de posar música Name[bg]=Настройки на приставката за поставяне на пауза Name[bs]=Zaustavi Muziku postavke dodatka Name[ca]=Ajustaments del connector Pausa la música +Name[ca@valencia]=Ajustaments del connector Pausa la música Name[cs]=Nastavení modulu Pozastavení hudby Name[da]=Indstilling af plugin til at sætte musik på pause Name[de]=Modul-Einstellungen für das Anhalten der Musikwiedergabe +Name[el]=Ρυθμίσεις προσθέτου παύσης μουσικής Name[en_GB]=Pause Music plugin settings Name[es]=Ajustes del complemento PauseMusic Name[fi]=Keskeytä musiikki -liitännäisen asetukset @@ -21,9 +25,11 @@ Name[it]=Impostazioni estensione Sospendi musica Name[ko]=음악 일시 정지 플러그인 설정 Name[nl]=Plug-in-instellingen voor muziek pauzeren +Name[nn]=Innstillingar for tillegg for pausing av musikk Name[pl]=Ustawienia wtyczki wstrzymywania muzyki Name[pt]=Configuração do 'plugin' de Pausa da Música Name[pt_BR]=Pausar as configurações do plugin Músicas +Name[ru]=Настройка модуля приостановки музыки Name[sk]=Nastavenia pluginu pozastavenia hudby Name[sv]=Inställningar av insticksprogram för paus i musik Name[tr]=Müziği Duraklat eklenti ayarları diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/pausemusic/kdeconnect_pausemusic.json kdeconnect-plasma-0.9+git20160315/plugins/pausemusic/kdeconnect_pausemusic.json --- kdeconnect-plasma-0.0+git20150810/plugins/pausemusic/kdeconnect_pausemusic.json 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/pausemusic/kdeconnect_pausemusic.json 2016-03-15 09:57:50.000000000 +0000 @@ -4,23 +4,28 @@ "Authors": [ { "Email": "albertvaka@gmail.com", - "Name": "Albert Vaca" + "Name": "Albert Vaca", + "Name[x-test]": "xxAlbert Vacaxx" } ], "Description": "Pause music/videos during a phone call", + "Description[ast]": "Posa la música/videos nuna llamada telefónica", + "Description[ca@valencia]": "Pausa la música/vídeos durant una trucada telefònica", "Description[ca]": "Pausa la música/vídeos durant una trucada telefònica", "Description[cs]": "Pozastavit hudbu/video během telefonátu", "Description[de]": "Hält Musik oder Videos währen eines Anrufs an", - "Description[en_GB]": "Pause music/videos during a phone call", "Description[es]": "Pausar música/video durante las llamadas telefónicas", "Description[fi]": "Keskeytä musiikki ja videot puhelun aikana", "Description[gl]": "Deter a reprodución de música ou vídeos durante as chamadas.", "Description[hu]": "A médialejátszás szüneteltetése telefonhívások közben", "Description[it]": "Sospendi musica/video durante una chiamata", + "Description[ko]": "휴대폰 통화 중 음악/동영상 일시 정지", "Description[nl]": "Muziek/video's pauzeren tijdens een telefoongesprek", + "Description[nn]": "Set avspeling på pause ved oppringingar", "Description[pl]": "Wstrzymaj muzykę/film przy dzwonieniu", "Description[pt]": "Pausar a música/vídeos durante uma chamada telefónica", "Description[pt_BR]": "Pausa a música/vídeo durante uma chamada", + "Description[ru]": "Приостановка воспроизведения музыки и видео во время телефонного звонка", "Description[sk]": "Pozastaviť hudbu/videá počas telefónneho hovoru", "Description[sv]": "Pausa musik eller videor under ett telefonsamtal", "Description[tr]": "Bir telefon çağrısı sırasında müzik/videoları duraklat", @@ -32,19 +37,23 @@ "Id": "kdeconnect_pausemusic", "License": "GPL", "Name": "Pause media during calls", + "Name[ast]": "Pausa de multimedia nes llamaes", + "Name[ca@valencia]": "Pausa els suports durant les trucades", "Name[ca]": "Pausa els suports durant les trucades", "Name[cs]": "Pozastavit média během telefonátu", "Name[de]": "Medium bei Anrufen anhalten", - "Name[en_GB]": "Pause media during calls", "Name[es]": "Pausar medios durante las llamadas", "Name[fi]": "Keskeytä toisto puhelujen aikana", "Name[gl]": "Deter a reprodución durante as chamadas.", "Name[hu]": "Médialejátszás felfüggesztése", "Name[it]": "Sospendi i lettori multimediali", + "Name[ko]": "통화 중 미디어 일시 정지", "Name[nl]": "Media pauzeren tijdens oproepen", + "Name[nn]": "Set avspeling på pause ved oppringingar", "Name[pl]": "Wstrzymaj multimedia przy dzwonieniu", "Name[pt]": "Pausar a reprodução durante as chamadas", "Name[pt_BR]": "Pausar os conteúdos multimídia durante as chamadas", + "Name[ru]": "Приостановка воспроизведения во время звонка", "Name[sk]": "Pozastaviť médiá počas hovorov", "Name[sv]": "Pausa media under samtal", "Name[tr]": "Çağrılar sırasında ortamı duraklat", diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/pausemusic/pausemusic_config.h kdeconnect-plasma-0.9+git20160315/plugins/pausemusic/pausemusic_config.h --- kdeconnect-plasma-0.0+git20150810/plugins/pausemusic/pausemusic_config.h 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/pausemusic/pausemusic_config.h 2016-03-15 09:57:50.000000000 +0000 @@ -36,9 +36,9 @@ virtual ~PauseMusicConfig(); public Q_SLOTS: - virtual void save(); - virtual void load(); - virtual void defaults(); + virtual void save() override; + virtual void load() override; + virtual void defaults() override; private: Ui::PauseMusicConfigUi* m_ui; diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/pausemusic/pausemusicplugin.h kdeconnect-plasma-0.9+git20160315/plugins/pausemusic/pausemusicplugin.h --- kdeconnect-plasma-0.0+git20150810/plugins/pausemusic/pausemusicplugin.h 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/pausemusic/pausemusicplugin.h 2016-03-15 09:57:50.000000000 +0000 @@ -36,8 +36,8 @@ explicit PauseMusicPlugin(QObject *parent, const QVariantList &args); public Q_SLOTS: - virtual bool receivePackage(const NetworkPackage& np); - virtual void connected() { } + virtual bool receivePackage(const NetworkPackage& np) override; + virtual void connected() override { } /** * @returns 0 if not muted, 1 if muted or -1 if there was an error diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/ping/kdeconnect_ping.json kdeconnect-plasma-0.9+git20160315/plugins/ping/kdeconnect_ping.json --- kdeconnect-plasma-0.0+git20150810/plugins/ping/kdeconnect_ping.json 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/ping/kdeconnect_ping.json 2016-03-15 09:57:50.000000000 +0000 @@ -4,23 +4,28 @@ "Authors": [ { "Email": "albertvaka@gmail.com", - "Name": "Albert Vaca" + "Name": "Albert Vaca", + "Name[x-test]": "xxAlbert Vacaxx" } ], "Description": "Send and receive pings", + "Description[ast]": "Unvia y recibe pings", + "Description[ca@valencia]": "Envia i rep pings", "Description[ca]": "Envia i rep pings", "Description[cs]": "Posílat a přijímat ping", "Description[de]": "Senden und Empfangen von Pings", - "Description[en_GB]": "Send and receive pings", "Description[es]": "Enviar y recibir pings", "Description[fi]": "Lähetä ja vastaanota tiedustelupaketteja", "Description[gl]": "Enviar e recibir pings.", "Description[hu]": "Pingek küldése és fogadása", "Description[it]": "Invia e ricevi ping", + "Description[ko]": "핑 보내고 받기", "Description[nl]": "Pings verzenden en ontvangen", + "Description[nn]": "Send og ta imot ping-signal", "Description[pl]": "Wysyłaj i otrzymuj pingi", "Description[pt]": "Enviar e receber contactos", "Description[pt_BR]": "Envia e recebe pings", + "Description[ru]": "Отправка и получение пингов", "Description[sk]": "Poslať a prijať pingy", "Description[sv]": "Skicka och ta emot ping", "Description[tr]": "Ping gönder ve al", @@ -32,25 +37,13 @@ "Id": "kdeconnect_ping", "License": "GPL", "Name": "Ping", - "Name[ca]": "Ping", - "Name[cs]": "Ping", - "Name[de]": "Ping", - "Name[en_GB]": "Ping", - "Name[es]": "Ping", "Name[fi]": "Tiedustelupaketti", - "Name[gl]": "Ping", - "Name[hu]": "Ping", - "Name[it]": "Ping", - "Name[nl]": "Ping", - "Name[pl]": "Ping", + "Name[ko]": "핑", "Name[pt]": "Contacto", - "Name[pt_BR]": "Ping", - "Name[sk]": "Ping", + "Name[ru]": "Тестовый сигнал", "Name[sv]": "Pinga", - "Name[tr]": "Ping", "Name[uk]": "Луна-імпульс", "Name[x-test]": "xxPingxx", - "Name[zh_CN]": "Ping", "ServiceTypes": [ "KdeConnect/Plugin" ], diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/ping/pingplugin.h kdeconnect-plasma-0.9+git20160315/plugins/ping/pingplugin.h --- kdeconnect-plasma-0.0+git20150810/plugins/ping/pingplugin.h 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/ping/pingplugin.h 2016-03-15 09:57:50.000000000 +0000 @@ -41,8 +41,8 @@ Q_SCRIPTABLE void sendPing(const QString& customMessage); public Q_SLOTS: - virtual bool receivePackage(const NetworkPackage& np); - virtual void connected(); + virtual bool receivePackage(const NetworkPackage& np) override; + virtual void connected() override; private: QString dbusPath() const; diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/remotecontrol/kdeconnect_remotecontrol.json kdeconnect-plasma-0.9+git20160315/plugins/remotecontrol/kdeconnect_remotecontrol.json --- kdeconnect-plasma-0.0+git20150810/plugins/remotecontrol/kdeconnect_remotecontrol.json 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/remotecontrol/kdeconnect_remotecontrol.json 2016-03-15 09:57:50.000000000 +0000 @@ -4,41 +4,59 @@ "Authors": [ { "Email": "aleixpol@kde.org", - "Name": "Aleix Pol" + "Name": "Aleix Pol", + "Name[x-test]": "xxAleix Polxx" } ], "Description": "Control Remote systems", + "Description[ast]": "Controla sistemes remotos", + "Description[ca@valencia]": "Sistemes de control remot", "Description[ca]": "Sistemes de control remot", + "Description[cs]": "Ovládejte vzdálené systémy", + "Description[de]": "Entfernte Systeme steuern", "Description[es]": "Controlar sistemas remotos", "Description[fi]": "Ohjaa järjestelmiä etänä", "Description[gl]": "Controla sistemas remotos.", "Description[it]": "Controlla i sistemi remoti", + "Description[ko]": "원격 시스템 제어", "Description[nl]": "Systemen op afstand bedienen", + "Description[nn]": "Fjernkontroller system", "Description[pl]": "Sterowanie zdalnymi systemami", "Description[pt]": "Comandar sistemas à distância", "Description[pt_BR]": "Controle remoto de sistemas", + "Description[ru]": "Управление удалёнными системами", "Description[sk]": "Ovládať vzdialené systémy", "Description[sv]": "Styr fjärrsystem", + "Description[tr]": "Uzak Sistemleri Kontrol Et", "Description[uk]": "Системи віддаленого керування", "Description[x-test]": "xxControl Remote systemsxx", + "Description[zh_CN]": "控制远程系统", "EnabledByDefault": true, "Icon": "applications-multimedia", "Id": "kdeconnect_remotecontrol", "License": "GPL", "Name": "RemoteControl", + "Name[ast]": "Control remotu", + "Name[ca@valencia]": "Control remot", "Name[ca]": "Control remot", + "Name[cs]": "Dálkové ovládání", + "Name[de]": "Fernsteuerung", "Name[es]": "Control remoto", "Name[fi]": "Kauko-ohjain", "Name[gl]": "Mando a distancia", "Name[it]": "Telecomando", + "Name[ko]": "원격 제어", "Name[nl]": "Afstandsbediening", + "Name[nn]": "Fjernkontroll", "Name[pl]": "ZdalneSterowanie", "Name[pt]": "Comando à Distância", "Name[pt_BR]": "Controle remoto", + "Name[ru]": "Удалённое управление", "Name[sk]": "Diaľkové ovládanie", "Name[sv]": "Fjärrkontroll", - "Name[uk]": "RemoteControl", + "Name[tr]": "UzaktanKumanda", "Name[x-test]": "xxRemoteControlxx", + "Name[zh_CN]": "远程控制", "ServiceTypes": [ "KdeConnect/Plugin" ], diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/runcommand/CMakeLists.txt kdeconnect-plasma-0.9+git20160315/plugins/runcommand/CMakeLists.txt --- kdeconnect-plasma-0.0+git20150810/plugins/runcommand/CMakeLists.txt 1970-01-01 01:00:00.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/runcommand/CMakeLists.txt 2016-03-15 09:57:50.000000000 +0000 @@ -0,0 +1,26 @@ +set(kdeconnect_runcommand_SRCS + runcommandplugin.cpp +) + +kdeconnect_add_plugin(kdeconnect_runcommand JSON kdeconnect_runcommand.json SOURCES ${kdeconnect_runcommand_SRCS}) + +target_link_libraries(kdeconnect_runcommand + kdeconnectcore + Qt5::DBus + KF5::I18n) + +#---------------------- + +set( kdeconnect_runcommand_config_SRCS runcommand_config.cpp ) + +add_library(kdeconnect_runcommand_config MODULE ${kdeconnect_runcommand_config_SRCS} ) +target_link_libraries( kdeconnect_runcommand_config + kdeconnectpluginkcm + KF5::I18n + KF5::CoreAddons + KF5::ConfigWidgets + +) + +install(TARGETS kdeconnect_runcommand_config DESTINATION ${PLUGIN_INSTALL_DIR} ) +install(FILES kdeconnect_runcommand_config.desktop DESTINATION ${SERVICES_INSTALL_DIR} ) diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/runcommand/kdeconnect_runcommand_config.desktop kdeconnect-plasma-0.9+git20160315/plugins/runcommand/kdeconnect_runcommand_config.desktop --- kdeconnect-plasma-0.0+git20150810/plugins/runcommand/kdeconnect_runcommand_config.desktop 1970-01-01 01:00:00.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/runcommand/kdeconnect_runcommand_config.desktop 2016-03-15 09:57:50.000000000 +0000 @@ -0,0 +1,35 @@ +[Desktop Entry] +Type=Service +X-KDE-ServiceTypes=KCModule + +X-KDE-Library=kdeconnect_runcommand_config +X-KDE-ParentComponents=kdeconnect_runcommand + +Name=Run Command plugin settings +Name[ar]=إعدادات ملحقة تشغيل الأوامر +Name[ast]=Axustes del complementu d'executar comandos +Name[ca]=Ajustaments del connector Executa ordres +Name[ca@valencia]=Ajustaments del connector Executa ordes +Name[cs]=Nastavení modulu Spustit příkaz +Name[da]=Indstilling af kør kommando-plugin +Name[de]=Modul-Einstellungen für Befehlsausführung +Name[el]=Ρυθμίσεις προσθέτου εκτέλεσης εντολής +Name[en_GB]=Run Command plugin settings +Name[es]=Ajustes del complemento de ejecución de órdenes +Name[fi]=Suorita komento -liitännäisen asetukset +Name[gl]=Configuración do complemento de orde de executar +Name[it]=Impostazioni estensione Esegui comando +Name[ko]=명령 실행 플러그인 설정 +Name[nl]=Plug-in-instellingen van commando Uitvoeren +Name[pl]=Ustawienia wtyczki wykonywania polecenia +Name[pt]=Configuração do 'plugin' de execução de comandos +Name[pt_BR]=Configurações do plugin de execução de comandos +Name[ru]=Настройка модуля выполнения команд +Name[sk]=Nastavenia pluginu spustenia príkazu +Name[sv]=Inställningar av insticksprogram för kör kommando +Name[tr]=Komut Çalıştır eklenti ayarları +Name[uk]=Параметри додатка запуску команд +Name[x-test]=xxRun Command plugin settingsxx +Name[zh_CN]=执行命令插件设置 + +Categories=Qt;KDE;X-KDE-settings-kdeconnect; diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/runcommand/kdeconnect_runcommand.json kdeconnect-plasma-0.9+git20160315/plugins/runcommand/kdeconnect_runcommand.json --- kdeconnect-plasma-0.0+git20150810/plugins/runcommand/kdeconnect_runcommand.json 1970-01-01 01:00:00.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/runcommand/kdeconnect_runcommand.json 2016-03-15 09:57:50.000000000 +0000 @@ -0,0 +1,75 @@ +{ + "Encoding": "UTF-8", + "KPlugin": { + "Authors": [ + { + "Email": "albertvaka@gmail.com", + "Name": "Albert Vaca", + "Name[x-test]": "xxAlbert Vacaxx" + }, + { + "Email": "david@davidedmundson.co.uk", + "Name": "David Edmundson", + "Name[x-test]": "xxDavid Edmundsonxx" + } + ], + "Description": "Execute console commands remotely", + "Description[ast]": "Executa los comandos de consola de mou remotu", + "Description[ca@valencia]": "Executa ordes de la consola de forma remota", + "Description[ca]": "Executa ordres de la consola de forma remota", + "Description[cs]": "Spouštět konzolové příkazy vzdáleně", + "Description[es]": "Ejecute órdenes de consola remotamente", + "Description[fi]": "Suorita konsolikomentoja etänä", + "Description[gl]": "Executar ordes de consola remotamente.", + "Description[it]": "Esegui da remoto comandi della console", + "Description[ko]": "원격으로 콘솔 명령 실행", + "Description[nl]": "Commando's in de terminal op afstand laten uitvoeren", + "Description[pl]": "Wykonaj polecenie konsoli zdalnie", + "Description[pt]": "Executar de forma remota comandos da consola", + "Description[pt_BR]": "Executa comandos do console remotamente", + "Description[ru]": "Выполнение консольных команд удалённо", + "Description[sk]": "Spustiť priamo príkazy konzoly", + "Description[sv]": "Kör terminalkommandon på distans", + "Description[tr]": "Konsol komutlarını uzaktan çalıştır", + "Description[uk]": "Віддалене виконання консольних команд", + "Description[x-test]": "xxExecute console commands remotelyxx", + "Description[zh_CN]": "远程执行控制台命令", + "EnabledByDefault": true, + "Icon": "system-run", + "Id": "kdeconnect_runcommand", + "License": "GPL", + "Name": "Run commands", + "Name[ast]": "Executar comandos", + "Name[ca@valencia]": "Executa ordes", + "Name[ca]": "Executa ordres", + "Name[cs]": "Spustit příkazy", + "Name[de]": "Befehle ausführen", + "Name[es]": "Ejecutar órdenes", + "Name[fi]": "Suorita komentoja", + "Name[gl]": "Executar ordes", + "Name[it]": "Esegui comandi", + "Name[ko]": "명령 실행", + "Name[nl]": "Commando's uitvoeren", + "Name[pl]": "Wykonywanie polecenie", + "Name[pt]": "Executar comandos", + "Name[pt_BR]": "Executar comandos", + "Name[ru]": "Выполнение команд", + "Name[sk]": "Spustiť príkazy", + "Name[sv]": "Kör kommandon", + "Name[tr]": "Komut çalıştır", + "Name[uk]": "Виконання команд", + "Name[x-test]": "xxRun commandsxx", + "Name[zh_CN]": "执行命令", + "ServiceTypes": [ + "KdeConnect/Plugin" + ], + "Version": "0.1", + "Website": "http://albertvaka.wordpress.com" + }, + "X-KdeConnect-OutgoingPackageType": [ + "kdeconnect.runcommand" + ], + "X-KdeConnect-SupportedPackageType": [ + "kdeconnect.runcommand" + ] +} \ No newline at end of file diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/runcommand/runcommand_config.cpp kdeconnect-plasma-0.9+git20160315/plugins/runcommand/runcommand_config.cpp --- kdeconnect-plasma-0.0+git20150810/plugins/runcommand/runcommand_config.cpp 1970-01-01 01:00:00.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/runcommand/runcommand_config.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -0,0 +1,142 @@ +/** + * Copyright 2015 David Edmundson + * + * 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 . + */ + +#include "runcommand_config.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +K_PLUGIN_FACTORY(ShareConfigFactory, registerPlugin();) + +RunCommandConfig::RunCommandConfig(QWidget *parent, const QVariantList& args) + : KdeConnectPluginKcm(parent, args, "kdeconnect_runcommand_config") +{ + QTableView *table = new QTableView(this); + table->horizontalHeader()->setStretchLastSection(true); + table->verticalHeader()->setVisible(false); + QVBoxLayout *layout = new QVBoxLayout(this); + layout->addWidget(table); + setLayout(layout); + + m_entriesModel = new QStandardItemModel(this); + table->setModel(m_entriesModel); + + m_entriesModel->setHorizontalHeaderLabels(QStringList() << i18n("Name") << i18n("Command")); + +} + +RunCommandConfig::~RunCommandConfig() +{ +} + +void RunCommandConfig::defaults() +{ + KCModule::defaults(); + m_entriesModel->clear(); + + Q_EMIT changed(true); +} + +void RunCommandConfig::load() +{ + KCModule::load(); + + QJsonDocument jsonDocument = QJsonDocument::fromJson(config()->get("commands", "{}")); + QJsonObject jsonConfig = jsonDocument.object(); + foreach(const QString &key, jsonConfig.keys()) { + const QJsonObject entry = jsonConfig[key].toObject(); + const QString name = entry["name"].toString(); + const QString command = entry["command"].toString(); + + QStandardItem *newName = new QStandardItem(name); + newName->setEditable(true); + newName->setData(key); + QStandardItem *newCommand = new QStandardItem(command); + newName->setEditable(true); + + m_entriesModel->appendRow(QList() << newName << newCommand); + } + insertEmptyRow(); + connect(m_entriesModel, &QAbstractItemModel::dataChanged, this, &RunCommandConfig::onDataChanged); + + Q_EMIT changed(false); +} + +void RunCommandConfig::save() +{ + QJsonObject jsonConfig; + for (int i=0;i < m_entriesModel->rowCount(); i++) { + QString key = m_entriesModel->item(i, 0)->data().toString(); + const QString name = m_entriesModel->item(i, 0)->text(); + const QString command = m_entriesModel->item(i, 1)->text(); + + if (name.isEmpty() || command.isEmpty()) { + continue; + } + + if (key.isEmpty()) { + key = QUuid::createUuid().toString(); + } + QJsonObject entry; + entry["name"] = name; + entry["command"] = command; + jsonConfig[key] = entry; + } + QJsonDocument document; + document.setObject(jsonConfig); + config()->set("commands", document.toJson()); + + KCModule::save(); + + Q_EMIT changed(false); +} + +void RunCommandConfig::insertEmptyRow() +{ + QStandardItem *newName = new QStandardItem; + newName->setEditable(true); + QStandardItem *newCommand = new QStandardItem; + newName->setEditable(true); + + m_entriesModel->appendRow(QList() << newName << newCommand); +} + +void RunCommandConfig::onDataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight) +{ + changed(true); + Q_UNUSED(topLeft); + if (bottomRight.row() == m_entriesModel->rowCount() - 1) { + //TODO check both entries are still empty + insertEmptyRow(); + } +} + + +#include "runcommand_config.moc" diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/runcommand/runcommand_config.h kdeconnect-plasma-0.9+git20160315/plugins/runcommand/runcommand_config.h --- kdeconnect-plasma-0.0+git20150810/plugins/runcommand/runcommand_config.h 1970-01-01 01:00:00.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/runcommand/runcommand_config.h 2016-03-15 09:57:50.000000000 +0000 @@ -0,0 +1,50 @@ +/** + * Copyright 2015 David Edmundson + * + * 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 . + */ + +#ifndef SHARE_CONFIG_H +#define SHARE_CONFIG_H + +#include "kcmplugin/kdeconnectpluginkcm.h" + +class QStandardItemModel; + +class RunCommandConfig + : public KdeConnectPluginKcm +{ + Q_OBJECT +public: + RunCommandConfig(QWidget *parent, const QVariantList&); + virtual ~RunCommandConfig(); + +public Q_SLOTS: + virtual void save() Q_DECL_OVERRIDE; + virtual void load() Q_DECL_OVERRIDE; + virtual void defaults() Q_DECL_OVERRIDE; + +private Q_SLOTS: + void onDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight); +private: + void insertEmptyRow(); + + QStandardItemModel *m_entriesModel; + +}; + +#endif diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/runcommand/runcommandplugin.cpp kdeconnect-plasma-0.9+git20160315/plugins/runcommand/runcommandplugin.cpp --- kdeconnect-plasma-0.0+git20150810/plugins/runcommand/runcommandplugin.cpp 1970-01-01 01:00:00.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/runcommand/runcommandplugin.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -0,0 +1,94 @@ +/** + * Copyright 2013 Albert Vaca + * + * 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 . + */ + +#include "runcommandplugin.h" + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#define PACKAGE_TYPE_RUNCOMMAND QLatin1String("kdeconnect.runcommand") + +K_PLUGIN_FACTORY_WITH_JSON( KdeConnectPluginFactory, "kdeconnect_runcommand.json", registerPlugin< RunCommandPlugin >(); ) + +Q_LOGGING_CATEGORY(KDECONNECT_PLUGIN_RUNCOMMAND, "kdeconnect.plugin.runcommand") + +RunCommandPlugin::RunCommandPlugin(QObject* parent, const QVariantList& args) + : KdeConnectPlugin(parent, args) +{ + connect(config(), SIGNAL(configChanged()), this, SLOT(configChanged())); +} + +RunCommandPlugin::~RunCommandPlugin() +{ +} + +bool RunCommandPlugin::receivePackage(const NetworkPackage& np) +{ + if (np.get("requestCommandList", false)) { + sendConfig(); + return true; + } + + if (np.has("key")) { + QJsonDocument commandsDocument = QJsonDocument::fromJson(config()->get("commands", "{}")); + QJsonObject commands = commandsDocument.object(); + QString key = np.get("key"); + QJsonValue value = commands[key]; + if (value == QJsonValue::Undefined) { + qCWarning(KDECONNECT_PLUGIN_RUNCOMMAND) << key << "is not a configured command"; + } + const QJsonObject command = value.toObject(); + QString name = command["name"].toString(); + QStringList commandLine = KShell::splitArgs(command["command"].toString()); + QProcess::startDetached(commandLine.at(0), commandLine.mid(1)); + return true; + } + + return false; +} + +void RunCommandPlugin::connected() +{ + +} + +void RunCommandPlugin::sendConfig() +{ + QString commands = config()->get("commands","{}"); + NetworkPackage np(PACKAGE_TYPE_RUNCOMMAND); + np.set("commandList", commands); + sendPackage(np); +} + +void RunCommandPlugin::configChanged() { + sendConfig(); +} + +#include "runcommandplugin.moc" diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/runcommand/runcommandplugin.h kdeconnect-plasma-0.9+git20160315/plugins/runcommand/runcommandplugin.h --- kdeconnect-plasma-0.0+git20150810/plugins/runcommand/runcommandplugin.h 1970-01-01 01:00:00.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/runcommand/runcommandplugin.h 2016-03-15 09:57:50.000000000 +0000 @@ -0,0 +1,55 @@ +/** + * Copyright 2015 Albert Vaca + * + * 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 . + */ + +#ifndef RUNCOMMANDPLUGIN_H +#define RUNCOMMANDPLUGIN_H + +#include + +#include +#include +#include +#include +#include +#include + +class Q_DECL_EXPORT RunCommandPlugin + : public KdeConnectPlugin +{ + Q_OBJECT + +public: + explicit RunCommandPlugin(QObject *parent, const QVariantList &args); + virtual ~RunCommandPlugin(); + + +public Q_SLOTS: + virtual bool receivePackage(const NetworkPackage& np); + virtual void connected(); + +private Q_SLOTS: + void configChanged(); + +private: + void sendConfig(); + +}; + +#endif diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/screensaver-inhibit/kdeconnect_screensaver_inhibit.json kdeconnect-plasma-0.9+git20160315/plugins/screensaver-inhibit/kdeconnect_screensaver_inhibit.json --- kdeconnect-plasma-0.0+git20150810/plugins/screensaver-inhibit/kdeconnect_screensaver_inhibit.json 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/screensaver-inhibit/kdeconnect_screensaver_inhibit.json 2016-03-15 09:57:50.000000000 +0000 @@ -4,23 +4,28 @@ "Authors": [ { "Email": "pmdematagoda@mykolab.ch", - "Name": "Pramod Dematagoda" + "Name": "Pramod Dematagoda", + "Name[x-test]": "xxPramod Dematagodaxx" } ], "Description": "Inhibit the screensaver when the device is connected", + "Description[ast]": "Inhibe'l curiapantalles cuando ta coneutáu'l preséu", + "Description[ca@valencia]": "Inhibeix l'estalvi de pantalla quan es connecta el dispositiu", "Description[ca]": "Inhibeix l'estalvi de pantalla quan es connecta el dispositiu", "Description[cs]": "Potlačit spořič pokud je zařízení připojeno", "Description[de]": "Bildschirmschoner unterbinden wenn ein Gerät angeschlossen ist", - "Description[en_GB]": "Inhibit the screensaver when the device is connected", "Description[es]": "Inhibir el salvapantallas cuando el dispositivo está conectado", "Description[fi]": "Estä näytönsäästäjän käynnistyminen, kun laite on yhteydessä", "Description[gl]": "Desactivar o salvapantallas mentres o dispositivo estea conectado.", "Description[hu]": "A képernyővédő kikapcsolása, ha az eszköz csatlakoztatva van", "Description[it]": "Impedisci il salvaschermo quando il dispositivo è connesso", + "Description[ko]": "장치가 연결되었을 때 화면 보호기 실행 중지", "Description[nl]": "Houdt de schermbeveiliging tegen wanneer het apparaat is verbonden", + "Description[nn]": "Hindra pauseskjermen i å starta når eininga er kopla til", "Description[pl]": "Powstrzymaj wygaszacz ekrany po podłączeniu urządzenia", "Description[pt]": "Inibir o protector de ecrã quando o dispositivo estiver ligado", - "Description[pt_BR]": "Inibir o protetor de tela quando o dispositivo estiver conectado", + "Description[pt_BR]": "Inibe o protetor de tela quando o dispositivo estiver conectado", + "Description[ru]": "Предотвращение запуска блокировщика экрана, когда устройство подключено", "Description[sk]": "Obmedziť šetrič obrazovky keď je pripojené zariadenie", "Description[sv]": "Stoppa skärmsläckaren när apparaten ansluts", "Description[tr]": "Aygıt bağlandığında ekran koruyucuyu durdur", @@ -32,19 +37,23 @@ "Id": "kdeconnect_screensaver_inhibit", "License": "GPL", "Name": "Inhibit screensaver", + "Name[ast]": "Inhibir curiapantalles", + "Name[ca@valencia]": "Inhibeix l'estalvi de pantalla", "Name[ca]": "Inhibeix l'estalvi de pantalla", "Name[cs]": "Potlačit spořič obrazovky", "Name[de]": "Bildschirmschoner unterbinden", - "Name[en_GB]": "Inhibit screensaver", "Name[es]": "Inhibir salvapantallas", "Name[fi]": "Estä näytönsäästäjän käynnistyminen", "Name[gl]": "Desactivar o salvapantallas", "Name[hu]": "Képernyővédő letiltása", "Name[it]": "Impedisci il salvaschermo", + "Name[ko]": "화면 보호기 중지", "Name[nl]": "Schermbeveiliging tegenhouden", + "Name[nn]": "Hindra pauseskjerm", "Name[pl]": "Powstrzymaj wygaszacz ekranu", "Name[pt]": "Inibir o protector de ecrã", "Name[pt_BR]": "Inibir o protetor de tela", + "Name[ru]": "Запрет блокировки экрана", "Name[sk]": "Obmedziť šetrič obrazovky", "Name[sv]": "Stoppa skärmsläckare", "Name[tr]": "Ekran koruyucuyu durdur", diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/screensaver-inhibit/screensaverinhibitplugin.cpp kdeconnect-plasma-0.9+git20160315/plugins/screensaver-inhibit/screensaverinhibitplugin.cpp --- kdeconnect-plasma-0.0+git20150810/plugins/screensaver-inhibit/screensaverinhibitplugin.cpp 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/screensaver-inhibit/screensaverinhibitplugin.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -46,12 +46,12 @@ QDBusMessage reply = inhibitInterface.call(INHIBIT_METHOD, "kdeconnect", "Phone is connected"); - if (reply.errorMessage() != NULL) { + if (reply.errorMessage() != nullptr) { qCDebug(KDECONNECT_PLUGIN_SCREENSAVERINHIBIT) << "Unable to inhibit the screensaver: " << reply.errorMessage(); inhibitCookie = 0; } else { // Store the cookie we receive, this will be sent back when sending the uninhibit call. - inhibitCookie = reply.arguments().first().toUInt(); + inhibitCookie = reply.arguments().at(0).toUInt(); } } diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/screensaver-inhibit/screensaverinhibitplugin.h kdeconnect-plasma-0.9+git20160315/plugins/screensaver-inhibit/screensaverinhibitplugin.h --- kdeconnect-plasma-0.0+git20150810/plugins/screensaver-inhibit/screensaverinhibitplugin.h 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/screensaver-inhibit/screensaverinhibitplugin.h 2016-03-15 09:57:50.000000000 +0000 @@ -35,8 +35,8 @@ virtual ~ScreensaverInhibitPlugin(); public Q_SLOTS: - virtual bool receivePackage(const NetworkPackage& np); - virtual void connected(); + virtual bool receivePackage(const NetworkPackage& np) override; + virtual void connected() override; private: uint inhibitCookie; diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/sftp/CMakeLists.txt kdeconnect-plasma-0.9+git20160315/plugins/sftp/CMakeLists.txt --- kdeconnect-plasma-0.0+git20150810/plugins/sftp/CMakeLists.txt 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/sftp/CMakeLists.txt 2016-03-15 09:57:50.000000000 +0000 @@ -13,7 +13,6 @@ Qt5::DBus KF5::I18n KF5::KIOFileWidgets - KF5::IconThemes KF5::KIOWidgets KF5::Notifications ) diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/sftp/kdeconnect_sftp.json kdeconnect-plasma-0.9+git20160315/plugins/sftp/kdeconnect_sftp.json --- kdeconnect-plasma-0.0+git20150810/plugins/sftp/kdeconnect_sftp.json 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/sftp/kdeconnect_sftp.json 2016-03-15 09:57:50.000000000 +0000 @@ -4,23 +4,29 @@ "Authors": [ { "Email": "kinnalru@gmail.com", - "Name": "Samoilenko Yuri" + "Name": "Samoilenko Yuri", + "Name[uk]": "Юрій Самойленко", + "Name[x-test]": "xxSamoilenko Yurixx" } ], "Description": "Browse the remote device filesystem using SFTP", + "Description[ast]": "Restola'l sistema de ficheros del preséu remotu usando SFTP", + "Description[ca@valencia]": "Navega pel sistema de fitxers del dispositiu remot emprant SFTP", "Description[ca]": "Navega pel sistema de fitxers del dispositiu remot emprant SFTP", "Description[cs]": "Prohlížejte souborový systém zařízení pomocí SFTP", "Description[de]": "Browsen im Dateisystem des entfernten Geräts mit SFTP", - "Description[en_GB]": "Browse the remote device filesystem using SFTP", "Description[es]": "Navegar por el sistema de archivos del dispositivo remoto usando SFTP", "Description[fi]": "Selaa etälaitteiden tiedostojärjestelmiä SFTP:llä", "Description[gl]": "Explore o sistema de ficheiros do dispositivo remoto mediante SFTP.", "Description[hu]": "Távoli fájlrendszerek böngészése SFTP-n keresztül", "Description[it]": "Sfoglia il filesystem del dispositivo remoto utilizzando SFTP", + "Description[ko]": "SFTP로 원격 장치 파일 시스템 탐색", "Description[nl]": "Blader door het bestandssysteem met SFTP op het apparaat op afstand", + "Description[nn]": "Bla gjennom filsystemet på eininga med SFTP", "Description[pl]": "Przeglądaj zdalny system plików przy użyciu SFTP", "Description[pt]": "Navegar pelo sistema de ficheiros de um dispositivo remoto por SFTP", "Description[pt_BR]": "Navegue pelo sistema de arquivos do dispositivo usando SFTP", + "Description[ru]": "Просмотр файловой системы удалённого устройства с помощью SFTP", "Description[sk]": "Prehliadať súborový systém vzdialeného zariadenia pomocou SFTP", "Description[sv]": "Bläddra i fjärrenhetens filsystem med SFTP", "Description[tr]": "Uzak aygıt dosya sistemine SFTP kullanarak göz atın", @@ -32,19 +38,23 @@ "Id": "kdeconnect_sftp", "License": "GPL", "Name": "Remote filesystem browser", + "Name[ast]": "Restolador de sistema de ficheros remotu", + "Name[ca@valencia]": "Navegador del sistema de fitxers remot", "Name[ca]": "Navegador del sistema de fitxers remot", "Name[cs]": "Vzdálený prohlížeč souborového systému", "Name[de]": "Datei-Browser für entferne Systeme", - "Name[en_GB]": "Remote filesystem browser", "Name[es]": "Navegador de sistema de archivos remoto", "Name[fi]": "Etätiedostojärjestelmäselain", "Name[gl]": "Navegador do sistema de ficheiros remoto.", "Name[hu]": "Távoli fájlrendszer-böngésző", "Name[it]": "Navigazione del filesystem remoto", + "Name[ko]": "원격 파일 시스템 탐색기", "Name[nl]": "Bestandssysteembrowser op afstand", + "Name[nn]": "Bla gjennom eksternt filsystem", "Name[pl]": "Przeglądarka zdalnego systemu plików", "Name[pt]": "Navegador de sistemas de ficheiros remotos", "Name[pt_BR]": "Navegador do sistema de arquivos remoto", + "Name[ru]": "Удалённый просмотр файловой системы", "Name[sk]": "Prehliadač vzdialeného súborového systému", "Name[sv]": "Fjärrfilsystembläddrare", "Name[tr]": "Uzak dosya sistemi tarayıcısı", diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/sftp/mounter.cpp kdeconnect-plasma-0.9+git20160315/plugins/sftp/mounter.cpp --- kdeconnect-plasma-0.0+git20150810/plugins/sftp/mounter.cpp 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/sftp/mounter.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -32,7 +32,7 @@ Mounter::Mounter(SftpPlugin* sftp) : QObject(sftp) , m_sftp(sftp) - , m_proc(0) + , m_proc(nullptr) , m_mountPoint(sftp->mountPoint()) , m_started(false) { @@ -48,13 +48,13 @@ m_connectTimer.setSingleShot(true); QTimer::singleShot(0, this, SLOT(start())); - qCDebug(KDECONNECT_PLUGIN_SFTP) << "Created"; + qCDebug(KDECONNECT_PLUGIN_SFTP) << "Created mounter"; } Mounter::~Mounter() { + qCDebug(KDECONNECT_PLUGIN_SFTP) << "Destroy mounter"; unmount(); - qCDebug(KDECONNECT_PLUGIN_SFTP) << "Destroyed"; } bool Mounter::wait() @@ -95,19 +95,21 @@ * Q_EMIT mounted(); */ - m_proc.reset(new KProcess(this)); + unmount(); + + m_proc = new KProcess(this); m_proc->setOutputChannelMode(KProcess::MergedChannels); - connect(m_proc.data(), SIGNAL(started()), SLOT(onStarted())); - connect(m_proc.data(), SIGNAL(error(QProcess::ProcessError)), SLOT(onError(QProcess::ProcessError))); - connect(m_proc.data(), SIGNAL(finished(int,QProcess::ExitStatus)), SLOT(onFinished(int,QProcess::ExitStatus))); + connect(m_proc, SIGNAL(started()), SLOT(onStarted())); + connect(m_proc, SIGNAL(error(QProcess::ProcessError)), SLOT(onError(QProcess::ProcessError))); + connect(m_proc, SIGNAL(finished(int,QProcess::ExitStatus)), SLOT(onFinished(int,QProcess::ExitStatus))); QDir().mkpath(m_mountPoint); const QString program = "sshfs"; QString path; - if (np.has("multiPaths")) path = "/"; + if (np.has("multiPaths")) path = '/'; else path = np.get("path"); const QStringList arguments = QStringList() @@ -120,17 +122,12 @@ << "-f" << "-o" << "IdentityFile=" + KdeConnectConfig::instance()->privateKeyPath() << "-o" << "StrictHostKeyChecking=no" //Do not ask for confirmation because it is not a known host - << "-o" << "UserKnownHostsFile=/dev/null"; //Prevent storing as a known host - - m_proc->setProgram(program, arguments); + << "-o" << "UserKnownHostsFile=/dev/null" //Prevent storing as a known host + << "-o" << "HostKeyAlgorithms=ssh-dss"; //https://bugs.kde.org/show_bug.cgi?id=351725 - //To debug - //m_proc->setStandardOutputFile("/tmp/kdeconnect-sftp.out"); - //m_proc->setStandardErrorFile("/tmp/kdeconnect-sftp.err"); + m_proc->setProgram(program, arguments); - cleanMountPoint(); - - qCDebug(KDECONNECT_PLUGIN_SFTP) << "Staring process: " << m_proc->program().join(" "); + qCDebug(KDECONNECT_PLUGIN_SFTP) << "Starting process: " << m_proc->program().join(" "); m_proc->start(); } @@ -139,11 +136,13 @@ qCDebug(KDECONNECT_PLUGIN_SFTP) << "Process started"; m_started = true; Q_EMIT mounted(); - - connect(m_proc.data(), &KProcess::readyReadStandardError, [this]() { + + //m_proc->setStandardOutputFile("/tmp/kdeconnect-sftp.out"); + //m_proc->setStandardErrorFile("/tmp/kdeconnect-sftp.err"); + connect(m_proc, &KProcess::readyReadStandardError, [this]() { qCDebug(KDECONNECT_PLUGIN_SFTP) << "stderr: " << m_proc->readAll(); }); - connect(m_proc.data(), &KProcess::readyReadStandardOutput, [this]() { + connect(m_proc, &KProcess::readyReadStandardOutput, [this]() { qCDebug(KDECONNECT_PLUGIN_SFTP) << "stdout:" << m_proc->readAll(); }); } @@ -171,9 +170,7 @@ Q_EMIT failed(i18n("Error when accessing to filesystem")); } - cleanMountPoint(); - m_proc.reset(); - m_started = false; + unmount(); } void Mounter::onMountTimeout() @@ -191,25 +188,18 @@ m_connectTimer.start(); } -void Mounter::cleanMountPoint() -{ - qCDebug(KDECONNECT_PLUGIN_SFTP()) << "cleanMountPoint"; - KProcess::execute(QStringList() << "fusermount" << "-u" << m_mountPoint, 10000); -} - void Mounter::unmount() { + qCDebug(KDECONNECT_PLUGIN_SFTP) << "Unmount" << m_proc; if (m_proc) { - cleanMountPoint(); - if (m_proc) - { - m_proc->terminate(); - QTimer::singleShot(5000, m_proc.data(), SLOT(kill())); - m_proc->waitForFinished(); - } + auto toDestroy = m_proc; + m_proc = nullptr; //So we don't reenter this code path when onFinished gets called + toDestroy->kill(); + delete toDestroy; + //Free mount point (won't always succeed if the path is in use) + KProcess::execute(QStringList() << "fusermount" << "-u" << m_mountPoint, 10000); } - - m_started = false; + m_started = false; } diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/sftp/mounter.h kdeconnect-plasma-0.9+git20160315/plugins/sftp/mounter.h --- kdeconnect-plasma-0.0+git20150810/plugins/sftp/mounter.h 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/sftp/mounter.h 2016-03-15 09:57:50.000000000 +0000 @@ -51,13 +51,12 @@ void onMountTimeout(); void start(); -private: - void cleanMountPoint(); +private: void unmount(); private: SftpPlugin* m_sftp; - QScopedPointer m_proc; + KProcess* m_proc; QTimer m_connectTimer; QString m_mountPoint; bool m_started; diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/sftp/sftp_debug.h kdeconnect-plasma-0.9+git20160315/plugins/sftp/sftp_debug.h --- kdeconnect-plasma-0.0+git20150810/plugins/sftp/sftp_debug.h 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/sftp/sftp_debug.h 2016-03-15 09:57:50.000000000 +0000 @@ -25,4 +25,4 @@ Q_DECLARE_LOGGING_CATEGORY(KDECONNECT_PLUGIN_SFTP) -#endif //SFTP_DEBUG_H \ No newline at end of file +#endif //SFTP_DEBUG_H diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/sftp/sftpplugin.cpp kdeconnect-plasma-0.9+git20160315/plugins/sftp/sftpplugin.cpp --- kdeconnect-plasma-0.0+git20150810/plugins/sftp/sftpplugin.cpp 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/sftp/sftpplugin.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -41,7 +41,7 @@ struct SftpPlugin::Pimpl { - Pimpl() : mounter(0) {} + Pimpl() : mounter(nullptr) {} //Add KIO entry to Dolphin's Places KFilePlacesModel placesModel; @@ -105,7 +105,7 @@ if (m_d->mounter) { m_d->mounter->deleteLater(); - m_d->mounter = 0; + m_d->mounter = nullptr; } } @@ -124,7 +124,7 @@ { if (mountAndWait()) { //return new KRun(QUrl::fromLocalFile(mountPoint()), 0); - return new KRun(QUrl("kdeconnect://"+deviceId), 0); + return new KRun(QUrl("kdeconnect://"+deviceId), nullptr); } return false; } diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/sftp/sftpplugin.h kdeconnect-plasma-0.9+git20160315/plugins/sftp/sftpplugin.h --- kdeconnect-plasma-0.0+git20150810/plugins/sftp/sftpplugin.h 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/sftp/sftpplugin.h 2016-03-15 09:57:50.000000000 +0000 @@ -44,8 +44,8 @@ Q_SCRIPTABLE void unmounted(); public Q_SLOTS: - virtual bool receivePackage(const NetworkPackage& np); - virtual void connected(); + virtual bool receivePackage(const NetworkPackage& np) override; + virtual void connected() override; Q_SCRIPTABLE void mount(); Q_SCRIPTABLE void unmount(); diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/share/autoclosingqfile.h kdeconnect-plasma-0.9+git20160315/plugins/share/autoclosingqfile.h --- kdeconnect-plasma-0.0+git20150810/plugins/share/autoclosingqfile.h 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/share/autoclosingqfile.h 2016-03-15 09:57:50.000000000 +0000 @@ -28,7 +28,7 @@ Q_OBJECT public: - AutoClosingQFile(const QString &name); + explicit AutoClosingQFile(const QString &name); qint64 readData(char* data, qint64 maxlen) Q_DECL_OVERRIDE { qint64 read = QFile::readData(data, maxlen); if (read == -1 || read == bytesAvailable()) { diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/share/kdeconnect_share_config.desktop kdeconnect-plasma-0.9+git20160315/plugins/share/kdeconnect_share_config.desktop --- kdeconnect-plasma-0.0+git20150810/plugins/share/kdeconnect_share_config.desktop 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/share/kdeconnect_share_config.desktop 2016-03-15 09:57:50.000000000 +0000 @@ -6,12 +6,16 @@ X-KDE-ParentComponents=kdeconnect_share Name=Share plugin settings +Name[ar]=إعدادات ملحقة المشاركة +Name[ast]=Axustes del complementu de compartir Name[bg]=Настройки на приставката за споделяне Name[bs]=Podijeli postavke dodatka Name[ca]=Ajustaments del connector Compartició +Name[ca@valencia]=Ajustaments del connector Compartició Name[cs]=Nastavení modulu sdílení Name[da]=Indstilling af deling-plugin Name[de]=Modul-Einstellungen für Veröffentlichung +Name[el]=Ρυθμίσεις προσθέτου κοινής χρήσης Name[en_GB]=Share plugin settings Name[es]=Ajustes del complemento para compartir Name[fi]=Jakoliitännäisen asetukset @@ -21,9 +25,11 @@ Name[it]=Impostazioni estensione Condivisione Name[ko]=공유 플러그인 설정 Name[nl]=Plug-in-instellingen van delen +Name[nn]=Innstillingar for tillegg for deling Name[pl]=Ustawienia wtyczki udostępniania Name[pt]=Configuração do 'plugin' de partilha Name[pt_BR]=Compartilhar as configurações do plugin +Name[ru]=Настройка модуля обмена файлами Name[sk]=Nastavenia pluginu zdieľania Name[sv]=Inställningar av delningsinsticksprogram Name[tr]=Paylaşma eklentisi ayarları diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/share/kdeconnect_share.json kdeconnect-plasma-0.9+git20160315/plugins/share/kdeconnect_share.json --- kdeconnect-plasma-0.0+git20150810/plugins/share/kdeconnect_share.json 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/share/kdeconnect_share.json 2016-03-15 09:57:50.000000000 +0000 @@ -4,23 +4,28 @@ "Authors": [ { "Email": "albertvaka@gmail.com", - "Name": "Albert Vaca" + "Name": "Albert Vaca", + "Name[x-test]": "xxAlbert Vacaxx" } ], "Description": "Receive and send files, URLs or plain text easily", + "Description[ast]": "Recibi y unvia ficheros, URLs o testu planu cenciellamente", + "Description[ca@valencia]": "Rep i envia fitxers, URL o text pla amb facilitat", "Description[ca]": "Rep i envia fitxers, URL o text pla amb facilitat", "Description[cs]": "Snadno přijímejte a posílejte soubory, URL nebo čistý text", "Description[de]": "Empfang und Senden von Dateien, URLs oder einfachem Text", - "Description[en_GB]": "Receive and send files, URLs or plain text easily", "Description[es]": "Recibir y enviar archivos, URL o texto sin formato fácilmente", "Description[fi]": "Vastaanota ja lähetä tiedostoja, verkko-osoitteita tai tekstiä helposti", "Description[gl]": "Comparta e reciba con facilidade ficheiros, enderezos URL ou texto simple.", "Description[hu]": "Fájlok, URL-ek és szöveg fogadása és küldése", "Description[it]": "Ricevi e invia facilmente file, URL o testo semplice", + "Description[ko]": "파일, URL, 일반 텍스트 공유하고 받기", "Description[nl]": "Bestanden, URL's of platte tekst gemakkelijk ontvangen en verzenden", + "Description[nn]": "Ta imot og send filer, nettadresser og tekst på ein enkel måte", "Description[pl]": "Udostępniaj i otrzymuj pliki, adresy URL lub zwykły tekst z łatwością", "Description[pt]": "Receber e enviar ficheiros, URL's ou texto normal de forma simples", "Description[pt_BR]": "Recebe e envia facilmente arquivos, URLs ou texto simples", + "Description[ru]": "Получение и отправка файлов, URL адресов или простого текста", "Description[sk]": "Prijať a poslať súbory, URL alebo čisté texty jednoducho", "Description[sv]": "Ta emot och skicka filer, webbadresser eller vanlig text enkelt", "Description[tr]": "Dosyaları, adres ve düz metinleri kolayca alın ve gönderin", @@ -32,19 +37,23 @@ "Id": "kdeconnect_share", "License": "GPL", "Name": "Share and receive", + "Name[ast]": "Compartir y recibir", + "Name[ca@valencia]": "Comparteix i rep", "Name[ca]": "Comparteix i rep", "Name[cs]": "Sdílet a přijímat", "Name[de]": "Senden und Empfangen", - "Name[en_GB]": "Share and receive", "Name[es]": "Compartir y recibir", "Name[fi]": "Jaa ja vastaanota", "Name[gl]": "Compartir e recibir.", "Name[hu]": "Megosztás és fogadás", "Name[it]": "Condividi e ricevi", + "Name[ko]": "공유하고 받기", "Name[nl]": "Delen en ontvangen", + "Name[nn]": "Del og ta imot", "Name[pl]": "Udostępniaj i otrzymuj", "Name[pt]": "Partilhar e receber", "Name[pt_BR]": "Compartilhar e receber", + "Name[ru]": "Общий доступ и получение", "Name[sk]": "Zdieľať a prijať", "Name[sv]": "Dela och ta emot", "Name[tr]": "Paylaş ve al", diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/share/share_config.cpp kdeconnect-plasma-0.9+git20160315/plugins/share/share_config.cpp --- kdeconnect-plasma-0.0+git20150810/plugins/share/share_config.cpp 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/share/share_config.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -34,7 +34,8 @@ { m_ui->setupUi(this); // xgettext:no-c-format - m_ui->commentLabel->setText(i18n("%1 in the path will be replaced with the specific device name.")); + m_ui->commentLabel->setTextFormat(Qt::RichText); + m_ui->commentLabel->setText(i18n("%1 in the path will be replaced with the specific device name.")); connect(m_ui->kurlrequester, SIGNAL(textChanged(QString)), this, SLOT(changed())); } diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/share/share_config.h kdeconnect-plasma-0.9+git20160315/plugins/share/share_config.h --- kdeconnect-plasma-0.0+git20150810/plugins/share/share_config.h 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/share/share_config.h 2016-03-15 09:57:50.000000000 +0000 @@ -36,9 +36,9 @@ virtual ~ShareConfig(); public Q_SLOTS: - virtual void save(); - virtual void load(); - virtual void defaults(); + virtual void save() override; + virtual void load() override; + virtual void defaults() override; private: Ui::ShareConfigUi* m_ui; diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/share/share_debug.h kdeconnect-plasma-0.9+git20160315/plugins/share/share_debug.h --- kdeconnect-plasma-0.0+git20150810/plugins/share/share_debug.h 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/share/share_debug.h 2016-03-15 09:57:50.000000000 +0000 @@ -25,4 +25,4 @@ Q_DECLARE_LOGGING_CATEGORY(KDECONNECT_PLUGIN_SHARE) -#endif //SHARE_DEBUG_H \ No newline at end of file +#endif //SHARE_DEBUG_H diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/share/shareplugin.cpp kdeconnect-plasma-0.9+git20160315/plugins/share/shareplugin.cpp --- kdeconnect-plasma-0.0+git20150810/plugins/share/shareplugin.cpp 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/share/shareplugin.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -96,7 +96,7 @@ } FileTransferJob* job = np.createPayloadTransferJob(destination); - job->setDeviceName(device()->name()); + job->setOriginName(device()->name() + ": " + filename); connect(job, SIGNAL(result(KJob*)), this, SLOT(finished(KJob*))); KIO::getJobTracker()->registerJob(job); job->start(); @@ -114,11 +114,15 @@ 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("url")); QDesktopServices::openUrl(url); + Q_EMIT shareReceived(url); } else { qCDebug(KDECONNECT_PLUGIN_SHARE) << "Error: Nothing attached!"; } @@ -129,7 +133,11 @@ void SharePlugin::finished(KJob* job) { - qCDebug(KDECONNECT_PLUGIN_SHARE) << "File transfer finished. Success:" << (!job->error()); + FileTransferJob* ftjob = qobject_cast(job); + if (ftjob) + Q_EMIT shareReceived(ftjob->destination()); + + qCDebug(KDECONNECT_PLUGIN_SHARE) << "File transfer finished. Success:" << (!job->error()) << (ftjob ? ftjob->destination() : QUrl()); } void SharePlugin::openDestinationFolder() @@ -152,7 +160,7 @@ void SharePlugin::connected() { - QDBusConnection::sessionBus().registerObject(dbusPath(), this, QDBusConnection::ExportAllContents); + QDBusConnection::sessionBus().registerObject(dbusPath(), this, QDBusConnection::ExportScriptableContents); } QString SharePlugin::dbusPath() const diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/share/shareplugin.h kdeconnect-plasma-0.9+git20160315/plugins/share/shareplugin.h --- kdeconnect-plasma-0.0+git20150810/plugins/share/shareplugin.h 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/share/shareplugin.h 2016-03-15 09:57:50.000000000 +0000 @@ -40,13 +40,16 @@ ///Helper method, QDBus won't recognize QUrl Q_SCRIPTABLE void shareUrl(const QString& url) { shareUrl(QUrl(url)); } public Q_SLOTS: - virtual bool receivePackage(const NetworkPackage& np); - virtual void connected(); + virtual bool receivePackage(const NetworkPackage& np) override; + virtual void connected() override; private Q_SLOTS: void finished(KJob*); void openDestinationFolder(); +Q_SIGNALS: + void shareReceived(const QUrl& url); + private: void shareUrl(const QUrl& url); diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/telephony/CMakeLists.txt kdeconnect-plasma-0.9+git20160315/plugins/telephony/CMakeLists.txt --- kdeconnect-plasma-0.0+git20150810/plugins/telephony/CMakeLists.txt 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/telephony/CMakeLists.txt 2016-03-15 09:57:50.000000000 +0000 @@ -2,6 +2,7 @@ set(kdeconnect_telephony_SRCS telephonyplugin.cpp + sendsmsdialog.cpp ) kdeconnect_add_plugin(kdeconnect_telephony JSON kdeconnect_telephony.json SOURCES ${kdeconnect_telephony_SRCS}) @@ -11,3 +12,9 @@ KF5::I18n KF5::Notifications ) + +if (TelepathyQt5_FOUND AND TelepathyQt5Service_FOUND) +target_link_libraries(kdeconnect_telephony + connectcm +) +endif() \ No newline at end of file diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/telephony/kdeconnect_telephony.json kdeconnect-plasma-0.9+git20160315/plugins/telephony/kdeconnect_telephony.json --- kdeconnect-plasma-0.0+git20150810/plugins/telephony/kdeconnect_telephony.json 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/telephony/kdeconnect_telephony.json 2016-03-15 09:57:50.000000000 +0000 @@ -4,23 +4,28 @@ "Authors": [ { "Email": "albertvaka@gmail.com", - "Name": "Albert Vaca" + "Name": "Albert Vaca", + "Name[x-test]": "xxAlbert Vacaxx" } ], "Description": "Show notifications for calls and SMS (answering coming soon)", + "Description[ast]": "Amuesa avisos pa llamaes y SMS (la rempuesta vendrá sero)", + "Description[ca@valencia]": "Mostra les notificacions de les trucades i SMS (properament es respondrà)", "Description[ca]": "Mostra les notificacions de les trucades i SMS (properament es respondrà)", "Description[cs]": "Zobrazit upozornění pro telefonáty a SMS (na odpovídání se pracuje)", "Description[de]": "Zeigt Benachrichtigungen für Anrufe und SMS", - "Description[en_GB]": "Show notifications for calls and SMS (answering coming soon)", "Description[es]": "Mostrar notificaciones para llamadas y SMS (el soporte para las contestaciones es inminente)", "Description[fi]": "Näytä puhelujen ja tekstiviestien ilmoitukset (vastaaminen tulossa pian)", "Description[gl]": "Mostrar notificacións de chamadas e mensaxes SMS (no futuro tamén poderá contestar chamadas).", "Description[hu]": "Értesítések megjelenítése hívásokról és SMS-ekről", "Description[it]": "Mostra notifiche per le chiamate e per gli SMS (la risposta arriverà)", + "Description[ko]": "통화와 SMS 알림 표시(응답 지원 구현 중)", "Description[nl]": "Meldingen tonen van oproepen en SMSjes (beantwoorden komt spoedig)", + "Description[nn]": "Vis varslingar for oppringingar og SMS (det vert òg mogleg å svara på desse i ein framtidig versjon)", "Description[pl]": "Pokaż powiadomienia dla dzwonienia i SMS (odpowiadanie wkrótce)", "Description[pt]": "Mostrar notificações para as chamadas e SMS (atendimento em breve)", "Description[pt_BR]": "Mostra notificações para chamadas e SMS (resposta em breve)", + "Description[ru]": "Показ уведомлений для звонков и SMS (скоро будет добавлена возможность ответа на SMS)", "Description[sk]": "Zobraziť oznámenia pre hovory a SMS (čoskoro aj odpovede)", "Description[sv]": "Visa underrättelser om samtal och SMS (att svara kommer snart)", "Description[tr]": "Çağrı ve SMS'ler için bildirim göster (yanıtlama yakında geliyor)", @@ -32,19 +37,23 @@ "Id": "kdeconnect_telephony", "License": "GPL", "Name": "Telephony integration", + "Name[ast]": "Integración telefónica", + "Name[ca@valencia]": "Integració amb la telefonia", "Name[ca]": "Integració amb la telefonia", "Name[cs]": "Integrace telefonu", "Name[de]": "Telefon-Integration", - "Name[en_GB]": "Telephony integration", "Name[es]": "Integración con el teléfono", "Name[fi]": "Puhelinintegrointi", "Name[gl]": "Integración telefónica", "Name[hu]": "Telefonintegráció", "Name[it]": "Integrazione telefonica", + "Name[ko]": "전화 통합", "Name[nl]": "Telefoonintegratie", + "Name[nn]": "Telefonintegrering", "Name[pl]": "Integracja z telefonem", "Name[pt]": "Integração telefónica", "Name[pt_BR]": "Integração telefônica", + "Name[ru]": "Интеграция телефонии", "Name[sk]": "Integrácia telefónie", "Name[sv]": "Integrering av telefoni", "Name[tr]": "Telefon tümleştirmesi", diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/telephony/sendsmsdialog.cpp kdeconnect-plasma-0.9+git20160315/plugins/telephony/sendsmsdialog.cpp --- kdeconnect-plasma-0.0+git20150810/plugins/telephony/sendsmsdialog.cpp 1970-01-01 01:00:00.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/telephony/sendsmsdialog.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -0,0 +1,64 @@ +/** + * Copyright 2015 Albert Vaca + * + * 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 . + */ + +#include "sendsmsdialog.h" + +#include +#include +#include +#include + +#include + +SendSmsDialog::SendSmsDialog(const QString& originalMessage, const QString& phoneNumber, const QString& contactName, QWidget* parent) + : QDialog(parent) + , mPhoneNumber(phoneNumber) +{ + QVBoxLayout* layout = new QVBoxLayout; + + QTextEdit* textView = new QTextEdit(this); + textView->setReadOnly(true); + textView->setText(contactName + ": \n" + originalMessage); + layout->addWidget(textView); + + mTextEdit = new QTextEdit(this); + layout->addWidget(mTextEdit); + + QPushButton* sendButton = new QPushButton(i18n("Send"), this); + connect(sendButton, SIGNAL(clicked(bool)), SLOT(sendButtonClicked())); + layout->addWidget(sendButton); + + setLayout(layout); + setWindowTitle(contactName); + setWindowIcon(QIcon::fromTheme("kdeconnect")); + setAttribute(Qt::WA_DeleteOnClose); +} + + +void SendSmsDialog::sendButtonClicked() +{ + emit sendSms(mPhoneNumber, mTextEdit->toPlainText()); + close(); +} + +QSize SendSmsDialog::sizeHint() const +{ + return QSize(512, 64); +} diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/telephony/sendsmsdialog.h kdeconnect-plasma-0.9+git20160315/plugins/telephony/sendsmsdialog.h --- kdeconnect-plasma-0.0+git20150810/plugins/telephony/sendsmsdialog.h 1970-01-01 01:00:00.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/telephony/sendsmsdialog.h 2016-03-15 09:57:50.000000000 +0000 @@ -0,0 +1,50 @@ +/** + * Copyright 2015 Albert Vaca + * + * 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 . + */ + +#ifndef SENDSMSDIALOG_H +#define SENDSMSDIALOG_H + +#include +#include + +class QTextEdit; +class QLineEdit; +class QPushButton; + +class SendSmsDialog : public QDialog +{ + Q_OBJECT + +public: + explicit SendSmsDialog(const QString& originalMessage, const QString& phoneNumber, const QString& contactName, QWidget *parent = nullptr); + virtual QSize sizeHint() const override; + +private Q_SLOTS: + void sendButtonClicked(); + +Q_SIGNALS: + void sendSms(const QString& phoneNumber, const QString& messageBody); + +private: + QString mPhoneNumber; + QTextEdit *mTextEdit; +}; + +#endif diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/telephony/telephonyplugin.cpp kdeconnect-plasma-0.9+git20160315/plugins/telephony/telephonyplugin.cpp --- kdeconnect-plasma-0.0+git20150810/plugins/telephony/telephonyplugin.cpp 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/telephony/telephonyplugin.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -20,13 +20,14 @@ #include "telephonyplugin.h" +#include "sendsmsdialog.h" + #include #include #include #include - K_PLUGIN_FACTORY_WITH_JSON( KdeConnectPluginFactory, "kdeconnect_telephony.json", registerPlugin< TelephonyPlugin >(); ) Q_LOGGING_CATEGORY(KDECONNECT_PLUGIN_TELEPHONY, "kdeconnect.plugin.telephony") @@ -34,40 +35,45 @@ TelephonyPlugin::TelephonyPlugin(QObject *parent, const QVariantList &args) : KdeConnectPlugin(parent, args) { - +#ifdef HAVE_TELEPATHY + //keep a reference to the KTP CM so that we can register on DBus + m_telepathyInterface = KDEConnectTelepathyProtocolFactory::interface(); + connect(m_telepathyInterface.constData(), SIGNAL(messageReceived(QString,QString)), SLOT(sendSms(QString,QString))); +#endif } KNotification* TelephonyPlugin::createNotification(const NetworkPackage& np) { - const QString event = np.get("event"); const QString phoneNumber = np.get("phoneNumber", i18n("unknown number")); + const QString contactName = np.get("contactName", phoneNumber); + const QByteArray phoneThumbnail = QByteArray::fromBase64(np.get("phoneThumbnail", "")); QString content, type, icon; - KNotification::NotificationFlags flags = KNotification::CloseOnTimeout; + KNotification::NotificationFlags flags = KNotification::CloseOnTimeout | KNotification::CloseWhenWidgetActivated; const QString title = device()->name(); if (event == "ringing") { type = QStringLiteral("callReceived"); icon = QStringLiteral("call-start"); - content = i18n("Incoming call from %1", phoneNumber); + content = i18n("Incoming call from %1", contactName); } else if (event == "missedCall") { type = QStringLiteral("missedCall"); icon = QStringLiteral("call-start"); - content = i18n("Missed call from %1", phoneNumber); - flags = KNotification::Persistent; + content = i18n("Missed call from %1", contactName); + flags |= KNotification::Persistent; } else if (event == "sms") { type = QStringLiteral("smsReceived"); icon = QStringLiteral("mail-receive"); QString messageBody = np.get("messageBody",""); - content = i18n("SMS from %1
%2", phoneNumber, messageBody); - flags = KNotification::Persistent; + content = i18n("SMS from %1
%2", contactName, messageBody); + flags |= KNotification::Persistent; } else if (event == "talking") { - return NULL; + return nullptr; } else { #ifndef NDEBUG - return NULL; + return nullptr; #else type = QStringLiteral("callReceived"); icon = QStringLiteral("phone"); @@ -78,7 +84,13 @@ qCDebug(KDECONNECT_PLUGIN_TELEPHONY) << "Creating notification with type:" << type; KNotification* notification = new KNotification(type, flags, this); - notification->setIconName(icon); + if (!phoneThumbnail.isEmpty()) { + QPixmap photo; + photo.loadFromData(phoneThumbnail, "JPEG"); + notification->setPixmap(photo); + } else { + notification->setIconName(icon); + } notification->setComponentName("kdeconnect"); notification->setTitle(title); notification->setText(content); @@ -86,6 +98,13 @@ if (event == QLatin1String("ringing")) { notification->setActions( QStringList(i18n("Mute Call")) ); connect(notification, &KNotification::action1Activated, this, &TelephonyPlugin::sendMutePackage); + } else if (event == QLatin1String("sms")) { + const QString messageBody = np.get("messageBody",""); + notification->setActions( QStringList(i18n("Reply")) ); + notification->setProperty("phoneNumber", phoneNumber); + notification->setProperty("contactName", contactName); + notification->setProperty("originalMessage", messageBody); + connect(notification, &KNotification::action1Activated, this, &TelephonyPlugin::showSendSmsDialog); } return notification; @@ -96,19 +115,24 @@ { if (np.get("isCancel")) { - //It would be awesome to remove the old notification from the system tray here, but there is no way to do it :( - //Now I realize why at the end of the day I have hundreds of notifications from facebook messages that I HAVE ALREADY READ, - //...it's just because the telepathy client has no way to remove them! even when it knows that I have read those messages! - - } else { - - KNotification* n = createNotification(np); - if (n != NULL) n->sendEvent(); - + //TODO: Clear the old notification + return true; + } +#ifdef HAVE_TELEPATHY + if (np.get("event") == QLatin1String("sms")) { + const QString messageBody = np.get("messageBody",""); + const QString phoneNumber = np.get("phoneNumber", i18n("unknown number")); + const QString contactName = np.get("contactName", phoneNumber); + if (m_telepathyInterface->sendMessage(contactName, messageBody)) { + return true; + } } +#endif + + KNotification* n = createNotification(np); + if (n != nullptr) n->sendEvent(); return true; - } void TelephonyPlugin::sendMutePackage() @@ -118,4 +142,23 @@ sendPackage(package); } +void TelephonyPlugin::sendSms(const QString& phoneNumber, const QString& messageBody) +{ + NetworkPackage np(PACKAGE_TYPE_TELEPHONY); + np.set("sendSms", true); + np.set("phoneNumber", phoneNumber); + np.set("messageBody", messageBody); + sendPackage(np); +} + +void TelephonyPlugin::showSendSmsDialog() +{ + QString phoneNumber = sender()->property("phoneNumber").toString(); + QString contactName = sender()->property("contactName").toString(); + QString originalMessage = sender()->property("originalMessage").toString(); + SendSmsDialog* dialog = new SendSmsDialog(originalMessage, phoneNumber, contactName); + connect(dialog, SIGNAL(sendSms(QString,QString)), this, SLOT(sendSms(QString,QString))); + dialog->show(); +} + #include "telephonyplugin.moc" diff -Nru kdeconnect-plasma-0.0+git20150810/plugins/telephony/telephonyplugin.h kdeconnect-plasma-0.9+git20160315/plugins/telephony/telephonyplugin.h --- kdeconnect-plasma-0.0+git20150810/plugins/telephony/telephonyplugin.h 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/plugins/telephony/telephonyplugin.h 2016-03-15 09:57:50.000000000 +0000 @@ -27,6 +27,10 @@ #include +#ifdef HAVE_TELEPATHY +#include "kdeconnecttelepathyprotocolfactory.h" +#endif + #define PACKAGE_TYPE_TELEPHONY QLatin1String("kdeconnect.telephony") Q_DECLARE_LOGGING_CATEGORY(KDECONNECT_PLUGIN_TELEPHONY) @@ -40,12 +44,21 @@ explicit TelephonyPlugin(QObject *parent, const QVariantList &args); public Q_SLOTS: - virtual bool receivePackage(const NetworkPackage& np); - virtual void connected() { } + 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); + +#ifdef HAVE_TELEPATHY + ConnectProtocolPtr m_telepathyInterface; +#endif + }; diff -Nru kdeconnect-plasma-0.0+git20150810/README.md kdeconnect-plasma-0.9+git20160315/README.md --- kdeconnect-plasma-0.0+git20150810/README.md 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/README.md 2016-03-15 09:57:50.000000000 +0000 @@ -23,7 +23,7 @@ ### On Linux Look in your distribution repo for a package called `kdeconnect-kde`, `kdeconnect-plasma`, or just `kdeconnect`. If it's not there and you know how to build software from sources, you just found the repo :) -If you are not using Plasma 5 or KDE4, you will also need to install [indicator-kdeconnect](https://github.com/vikoadi/indicator-kdeconnect) (available as an [Ubuntu PPA](https://code.launchpad.net/~vikoadi/+archive/ubuntu/ppa/])) for integration with other desktops using appindicator. +If you are not using Plasma 5 or KDE4, you will also need to install [indicator-kdeconnect](https://github.com/vikoadi/indicator-kdeconnect) (available as an [Ubuntu PPA](https://code.launchpad.net/~vikoadi/+archive/ubuntu/ppa/)) for integration with other desktops using appindicator. ### On Mac or Windows There is no support for Mac or Windows yet. The last time I checked it was compiling on Windows, so it's only lacking a user interface. Same for Mac. Contributions welcome! @@ -60,6 +60,6 @@ ## License [GNU GPL v2](https://www.gnu.org/licenses/gpl-2.0.html) and [GNU GPL v3](https://www.gnu.org/licenses/gpl-3.0.html) -If you are reading this from Github, you should know that this is just a mirror of the [KDE Project repo](https://projects.kde.org/projects/playground/base/kdeconnect-kde/repository/). +If you are reading this from Github, you should know that this is just a mirror of the [KDE Project repo](https://projects.kde.org/projects/extragear/network/kdeconnect-kde/repository/). [![Build Status](https://build.kde.org/buildStatus/icon?job=kdeconnect-kde master kf5-qt5)](https://build.kde.org/job/kdeconnect-kde%20master%20kf5-qt5/) diff -Nru kdeconnect-plasma-0.0+git20150810/telepathy-cm/CMakeLists.txt kdeconnect-plasma-0.9+git20160315/telepathy-cm/CMakeLists.txt --- kdeconnect-plasma-0.0+git20150810/telepathy-cm/CMakeLists.txt 1970-01-01 01:00:00.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/telepathy-cm/CMakeLists.txt 2016-03-15 09:57:50.000000000 +0000 @@ -0,0 +1,24 @@ +project(connectcm) + +add_definitions(-DCONNECTCM_LIBRARY) + +set(connectcm_SOURCES + connection.cpp + protocol.cpp + textchannel.cpp + kdeconnecttelepathyprotocolfactory.cpp +) + +add_library(connectcm SHARED ${connectcm_SOURCES}) + +target_link_libraries(connectcm +PUBLIC + Qt5::Core + ${TELEPATHY_QT5_LIBRARIES} + ${TELEPATHY_QT5_SERVICE_LIBRARIES} +) + +install (TARGETS connectcm + ${INSTALL_TARGETS_DEFAULT_ARGS} +) + diff -Nru kdeconnect-plasma-0.0+git20150810/telepathy-cm/connectcm_export.h kdeconnect-plasma-0.9+git20160315/telepathy-cm/connectcm_export.h --- kdeconnect-plasma-0.0+git20150810/telepathy-cm/connectcm_export.h 1970-01-01 01:00:00.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/telepathy-cm/connectcm_export.h 2016-03-15 09:57:50.000000000 +0000 @@ -0,0 +1,12 @@ +#ifndef CONNECTCM_EXPORT_H +#define CONNECTCM_EXPORT_H + +#include + +#if defined(CONNECTCM_LIBRARY) +#define CONNECTCM_EXPORT Q_DECL_EXPORT +#else +#define CONNECTCM_EXPORT Q_DECL_IMPORT +#endif + +#endif diff -Nru kdeconnect-plasma-0.0+git20150810/telepathy-cm/connection.cpp kdeconnect-plasma-0.9+git20160315/telepathy-cm/connection.cpp --- kdeconnect-plasma-0.0+git20150810/telepathy-cm/connection.cpp 1970-01-01 01:00:00.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/telepathy-cm/connection.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -0,0 +1,344 @@ +/* + Copyright (C) 2014 Alexandr Akulich + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ + +#include "connection.h" + +#include "textchannel.h" + +#include +#include +#include + +#include + +#include + +Tp::SimpleStatusSpecMap ConnectConnection::getSimpleStatusSpecMap() +{ + //Presence + Tp::SimpleStatusSpec spAvailable; + spAvailable.type = Tp::ConnectionPresenceTypeAvailable; + spAvailable.maySetOnSelf = false; + spAvailable.canHaveMessage = true; + + Tp::SimpleStatusSpec spOffline; + spOffline.type = Tp::ConnectionPresenceTypeOffline; + spOffline.maySetOnSelf = false; + spOffline.canHaveMessage = false; + + Tp::SimpleStatusSpecMap specs; + specs.insert(QLatin1String("available"), spAvailable); + specs.insert(QLatin1String("offline"), spOffline); + return specs; +} + +ConnectConnection::ConnectConnection(const QDBusConnection &dbusConnection, const QString &cmName, const QString &protocolName, const QVariantMap ¶meters) : + Tp::BaseConnection(dbusConnection, cmName, protocolName, parameters) +{ + /* Connection.Interface.Contacts */ + contactsIface = Tp::BaseConnectionContactsInterface::create(); + contactsIface->setGetContactAttributesCallback(Tp::memFun(this, &ConnectConnection::getContactAttributes)); + contactsIface->setContactAttributeInterfaces(QStringList() + << TP_QT_IFACE_CONNECTION + << TP_QT_IFACE_CONNECTION_INTERFACE_CONTACT_LIST + << TP_QT_IFACE_CONNECTION_INTERFACE_SIMPLE_PRESENCE); + plugInterface(Tp::AbstractConnectionInterfacePtr::dynamicCast(contactsIface)); + + /* Connection.Interface.SimplePresence */ + simplePresenceIface = Tp::BaseConnectionSimplePresenceInterface::create(); + simplePresenceIface->setSetPresenceCallback(Tp::memFun(this,&ConnectConnection::setPresence)); + plugInterface(Tp::AbstractConnectionInterfacePtr::dynamicCast(simplePresenceIface)); + + /* Connection.Interface.ContactList */ + contactListIface = Tp::BaseConnectionContactListInterface::create(); + contactListIface->setGetContactListAttributesCallback(Tp::memFun(this, &ConnectConnection::getContactListAttributes)); +// contactListIface->setRequestSubscriptionCallback(Tp::memFun(this, &ConnectConnection::requestSubscription)); + plugInterface(Tp::AbstractConnectionInterfacePtr::dynamicCast(contactListIface)); + + /* Connection.Interface.Requests */ + requestsIface = Tp::BaseConnectionRequestsInterface::create(this); + /* Fill requestableChannelClasses */ + Tp::RequestableChannelClass text; + text.fixedProperties[TP_QT_IFACE_CHANNEL+".ChannelType"] = TP_QT_IFACE_CHANNEL_TYPE_TEXT; + text.fixedProperties[TP_QT_IFACE_CHANNEL+".TargetHandleType"] = Tp::HandleTypeContact; + text.allowedProperties.append(TP_QT_IFACE_CHANNEL+".TargetHandle"); + text.allowedProperties.append(TP_QT_IFACE_CHANNEL+".TargetID"); + requestsIface->requestableChannelClasses << text; + plugInterface(Tp::AbstractConnectionInterfacePtr::dynamicCast(requestsIface)); + + QString selfName = QLatin1String("SelfContact"); + + if (parameters.contains("self_name")) { + selfName = parameters.value("self_name").toString(); + } + + if (parameters.contains("device_id")) { + m_deviceId = parameters.value("device_id").toString(); + } + + setSelfHandle(addContact(selfName + "@kdeconnect_" + m_deviceId)); + + setConnectCallback(Tp::memFun(this, &ConnectConnection::connect)); + setInspectHandlesCallback(Tp::memFun(this, &ConnectConnection::inspectHandles)); + setCreateChannelCallback(Tp::memFun(this, &ConnectConnection::createChannelCB)); + setRequestHandlesCallback(Tp::memFun(this, &ConnectConnection::requestHandles)); +} + +ConnectConnection::~ConnectConnection() +{ +} + +void ConnectConnection::connect(Tp::DBusError *error) +{ + setStatus(Tp::ConnectionStatusConnecting, Tp::ConnectionStatusReasonRequested); + + simplePresenceIface->setStatuses(getSimpleStatusSpecMap()); + + Tp::SimpleContactPresences presences; + Tp::SimplePresence presence; + presence.status = "available"; + presence.statusMessage = ""; + presence.type = Tp::ConnectionPresenceTypeAvailable; + presences[selfHandle()] = presence; + simplePresenceIface->setPresences(presences); + + setStatus(Tp::ConnectionStatusConnected, Tp::ConnectionStatusReasonRequested); + + /* Set ContactList status */ + contactListIface->setContactListState(Tp::ContactListStateSuccess); +} + +QStringList ConnectConnection::inspectHandles(uint handleType, const Tp::UIntList &handles, Tp::DBusError *error) +{ + if (handleType != Tp::HandleTypeContact) { + error->set(TP_QT_ERROR_INVALID_ARGUMENT, "Unsupported handle type"); + return QStringList(); + } + + QStringList result; + + foreach (uint handle, handles) { + if (!m_handles.contains(handle)) { + return QStringList(); + } + + result.append(m_handles.value(handle)); + } + + return result; +} + +Tp::BaseChannelPtr ConnectConnection::createChannelCB(const QVariantMap &request, Tp::DBusError *error) +{ + const uint targetHandleType = request.value(TP_QT_IFACE_CHANNEL + QLatin1String(".TargetHandleType")).toUInt(); + const QString channelType = request.value(TP_QT_IFACE_CHANNEL + QLatin1String(".ChannelType")).toString(); + + //note if we ever have this invoked from external clients we need to look for TargetID too and look it up + const uint targetHandle = request.value(TP_QT_IFACE_CHANNEL + QLatin1String(".TargetHandle")).toUInt(); + + if ((targetHandleType != Tp::HandleTypeContact) || (targetHandle == 0)) { + error->set(TP_QT_ERROR_INVALID_HANDLE, "createChannel error"); + return Tp::BaseChannelPtr(); + } + + Tp::BaseChannelPtr baseChannel = Tp::BaseChannel::create(this, channelType, Tp::HandleType(targetHandleType), targetHandle); + + QString identifier = m_handles.value(targetHandle); + + if (channelType == TP_QT_IFACE_CHANNEL_TYPE_TEXT) { + ConnectTextChannelPtr textType = ConnectTextChannel::create(this, baseChannel.data(), targetHandle, identifier); + baseChannel->plugInterface(Tp::AbstractChannelInterfacePtr::dynamicCast(textType)); + } + + return baseChannel; +} + +Tp::UIntList ConnectConnection::requestHandles(uint handleType, const QStringList &identifiers, Tp::DBusError *error) +{ + Tp::UIntList result; + + if (handleType != Tp::HandleTypeContact) { + error->set(TP_QT_ERROR_INVALID_ARGUMENT, "ConnectConnection::requestHandles - Handle Type unknown"); + return result; + } + + foreach(const QString &identify, identifiers) { + uint handle = m_handles.key(identify, 0); + if (handle) { + result.append(handle); + } else { + result.append(addContact(identify)); + } + } + + return result; +} + +Tp::ContactAttributesMap ConnectConnection::getContactListAttributes(const QStringList &interfaces, bool hold, Tp::DBusError *error) +{ + Tp::ContactAttributesMap contactAttributes; + + foreach (const uint handle, m_handles.keys()) { + if (handle == selfHandle()) { + continue; + } + QVariantMap attributes; + attributes["org.freedesktop.Telepathy.Connection/contact-id"] = m_handles.value(handle); + attributes["org.freedesktop.Telepathy.Connection.Interface.ContactList/subscribe"] = Tp::SubscriptionStateYes; + attributes["org.freedesktop.Telepathy.Connection.Interface.ContactList/publish"] = Tp::SubscriptionStateYes; + attributes["org.freedesktop.Telepathy.Connection.Interface.ConnectPresence/presence"] = QVariant::fromValue(getPresence(handle)); + contactAttributes[handle] = attributes; + } + return contactAttributes; +} + +Tp::ContactAttributesMap ConnectConnection::getContactAttributes(const Tp::UIntList &handles, const QStringList &interfaces, Tp::DBusError *error) +{ +// Connection.Interface.Contacts +// http://telepathy.freedesktop.org/spec/Connection_Interface_Contacts.html#Method:GetContactAttributes + + Tp::ContactAttributesMap contactAttributes; + + foreach (const uint handle, handles) { + if (m_handles.contains(handle)){ + QVariantMap attributes; + attributes["org.freedesktop.Telepathy.Connection/contact-id"] = m_handles.value(handle); + + if (handle != selfHandle() && interfaces.contains("org.freedesktop.Telepathy.Connection.Interface.ContactList")) { + attributes["org.freedesktop.Telepathy.Connection.Interface.ContactList/subscribe"] = Tp::SubscriptionStateYes; + attributes["org.freedesktop.Telepathy.Connection.Interface.ContactList/publish"] = Tp::SubscriptionStateYes; + attributes["org.freedesktop.Telepathy.Connection.Interface.SimplePresence/presence"] = QVariant::fromValue(getPresence(handle)); + } + contactAttributes[handle] = attributes; + } + } + return contactAttributes; +} + +Tp::SimplePresence ConnectConnection::getPresence(uint handle) +{ + return Tp::Presence::offline().barePresence(); +} + +uint ConnectConnection::setPresence(const QString &status, const QString &message, Tp::DBusError *error) +{ + return 0; +} + +uint ConnectConnection::ensureContact(const QString &identifier) +{ + uint handle = getHandle(identifier); + if (!handle) { + handle = addContact(identifier); + } + return handle; +} + +uint ConnectConnection::addContacts(const QStringList &identifiers) +{ + uint handle = 0; + + if (!m_handles.isEmpty()) { + handle = m_handles.keys().last(); + } + + QList newHandles; + foreach(const QString &identifier, identifiers) { + ++handle; + m_handles.insert(handle, identifier); + newHandles << handle; + } + + return handle; +} + +uint ConnectConnection::addContact(const QString &identifier) +{ + return addContacts(QStringList() << identifier); +} + +/* Receive message from someone to ourself */ +bool ConnectConnection::receiveMessage(const QString &sender, const QString &message) +{ + uint senderHandle, targetHandle; + + Tp::HandleType handleType = Tp::HandleTypeContact; + senderHandle = targetHandle = ensureContact(sender); + + Tp::DBusError error; + bool yours; + + QVariantMap request; + request[TP_QT_IFACE_CHANNEL + QLatin1String(".ChannelType")] = TP_QT_IFACE_CHANNEL_TYPE_TEXT; + request[TP_QT_IFACE_CHANNEL + QLatin1String(".TargetHandle")] = targetHandle; + request[TP_QT_IFACE_CHANNEL + QLatin1String(".TargetHandleType")] = Tp::HandleTypeContact; + request[TP_QT_IFACE_CHANNEL + QLatin1String(".InitiatorHandle")] = targetHandle; //they texted you, so they started it + Tp::BaseChannelPtr channel = ensureChannel(request, yours, false, &error); + if (error.isValid()) { + qWarning() << "ensureChannel failed:" << error.name() << " " << error.message(); + return false; + } + + Tp::BaseChannelTextTypePtr textChannel = Tp::BaseChannelTextTypePtr::dynamicCast(channel->interface(TP_QT_IFACE_CHANNEL_TYPE_TEXT)); + if (!textChannel) { + qDebug() << "Error, channel is not a textChannel??"; + return false; + } + + uint timestamp = QDateTime::currentMSecsSinceEpoch() / 1000; + + Tp::MessagePartList body; + Tp::MessagePart text; + text["content-type"] = QDBusVariant("text/plain"); + text["content"] = QDBusVariant(message); + body << text; + + Tp::MessagePartList partList; + Tp::MessagePart header; + header["message-received"] = QDBusVariant(timestamp); + header["message-sender"] = QDBusVariant(senderHandle); + header["message-sender-id"] = QDBusVariant(sender); + //header["sender-nickname"] = QDBusVariant(pushName); + header["message-type"] = QDBusVariant(Tp::ChannelTextMessageTypeNormal); + + partList << header << body; + textChannel->addReceivedMessage(partList); + return true; +} + +void ConnectConnection::setContactList(const QStringList &identifiers) +{ + // Actually it don't clear previous list (not implemented yet) + addContacts(identifiers); + +// Tp::ContactSubscriptionMap changes; +// Tp::HandleIdentifierMap identifiers; +// Tp::HandleIdentifierMap removals; + + QList handles; + + for (int i = 0; i < identifiers.count(); ++i) { + handles.append(ensureContact(identifiers.at(i))); + } +} + +uint ConnectConnection::getHandle(const QString &identifier) const +{ + foreach (uint key, m_handles.keys()) { + if (m_handles.value(key) == identifier) { + return key; + } + } + + return 0; +} diff -Nru kdeconnect-plasma-0.0+git20150810/telepathy-cm/connection.h kdeconnect-plasma-0.9+git20160315/telepathy-cm/connection.h --- kdeconnect-plasma-0.0+git20150810/telepathy-cm/connection.h 1970-01-01 01:00:00.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/telepathy-cm/connection.h 2016-03-15 09:57:50.000000000 +0000 @@ -0,0 +1,71 @@ +/* + Copyright (C) 2014 Alexandr Akulich + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ + +#ifndef CONNECTCM_CONNECTION_H +#define CONNECTCM_CONNECTION_H + +#include "connectcm_export.h" + +#include +#include + +class CONNECTCM_EXPORT ConnectConnection : public Tp::BaseConnection +{ + Q_OBJECT +public: + ConnectConnection(const QDBusConnection &dbusConnection, + const QString &cmName, const QString &protocolName, + const QVariantMap ¶meters); + ~ConnectConnection(); + + static Tp::SimpleStatusSpecMap getSimpleStatusSpecMap(); + + void connect(Tp::DBusError *error); + QStringList inspectHandles(uint handleType, const Tp::UIntList &handles, Tp::DBusError *error); + Tp::BaseChannelPtr createChannelCB(const QVariantMap &request, Tp::DBusError *error); + + Tp::UIntList requestHandles(uint handleType, const QStringList &identifiers, Tp::DBusError *error); + + Tp::ContactAttributesMap getContactListAttributes(const QStringList &interfaces, bool hold, Tp::DBusError *error); + Tp::ContactAttributesMap getContactAttributes(const Tp::UIntList &handles, const QStringList &interfaces, Tp::DBusError *error); + + Tp::SimplePresence getPresence(uint handle); + uint setPresence(const QString &status, const QString &message, Tp::DBusError *error); + + uint ensureContact(const QString &identifier); + +public slots: + bool receiveMessage(const QString &sender, const QString &message); + void setContactList(const QStringList &identifiers); + +signals: + void messageReceived(const QString &sender, const QString &message); + +private: + uint getHandle(const QString &identifier) const; + uint addContact(const QString &identifier); + uint addContacts(const QStringList &identifiers); + + Tp::BaseConnectionContactsInterfacePtr contactsIface; + Tp::BaseConnectionSimplePresenceInterfacePtr simplePresenceIface; + Tp::BaseConnectionContactListInterfacePtr contactListIface; + Tp::BaseConnectionAddressingInterfacePtr addressingIface; + Tp::BaseConnectionRequestsInterfacePtr requestsIface; + + QMap m_handles; + /* Maps a contact handle to its subscription state */ + + QString m_deviceId; +}; + +#endif // CONNECTCM_CONNECTION_H diff -Nru kdeconnect-plasma-0.0+git20150810/telepathy-cm/kdeconnect.manager kdeconnect-plasma-0.9+git20160315/telepathy-cm/kdeconnect.manager --- kdeconnect-plasma-0.0+git20150810/telepathy-cm/kdeconnect.manager 1970-01-01 01:00:00.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/telepathy-cm/kdeconnect.manager 2016-03-15 09:57:50.000000000 +0000 @@ -0,0 +1,6 @@ +[ConnectionManager] +BusName=org.freedesktop.Telepathy.ConnectionManager.kdeconnect +ObjectPath=/org/freedesktop/Telepathy/ConnectionManager/kdeconnect +Interfaces= + +[Protocol kdeconnect] \ No newline at end of file diff -Nru kdeconnect-plasma-0.0+git20150810/telepathy-cm/kdeconnecttelepathyprotocolfactory.cpp kdeconnect-plasma-0.9+git20160315/telepathy-cm/kdeconnecttelepathyprotocolfactory.cpp --- kdeconnect-plasma-0.0+git20150810/telepathy-cm/kdeconnecttelepathyprotocolfactory.cpp 1970-01-01 01:00:00.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/telepathy-cm/kdeconnecttelepathyprotocolfactory.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -0,0 +1,71 @@ +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include "protocol.h" + +#include "kdeconnecttelepathyprotocolfactory.h" + +Tp::WeakPtr KDEConnectTelepathyProtocolFactory::s_interface; + +ConnectProtocolPtr KDEConnectTelepathyProtocolFactory::interface() { + if (s_interface.isNull()) { + Tp::registerTypes(); + Tp::enableWarnings(true); + + ConnectProtocolPtr protocol = Tp::BaseProtocol::create( + QDBusConnection::sessionBus(), + QLatin1String("kdeconnect")); + s_interface = protocol; + + static Tp::BaseConnectionManagerPtr cm = Tp::BaseConnectionManager::create( + QDBusConnection::sessionBus(), QLatin1String("kdeconnect")); + + protocol->setConnectionManagerName(cm->name()); + protocol->setEnglishName(QLatin1String("KDE Connect")); + protocol->setIconName(QLatin1String("kdeconnect")); + protocol->setVCardField(QLatin1String("phone_number")); + + cm->addProtocol(protocol); + cm->registerObject(); + + //fake being a client and create an account to use this connection + //maybe this should be per device.. with a device ID as a parameter, but lets keep it connect for now + + Tp::AccountManagerPtr am = Tp::AccountManager::create(QDBusConnection::sessionBus()); + Tp::PendingReady *pr = am->becomeReady(); + QObject::connect(pr, &Tp::PendingOperation::finished, [pr,am]() { + if (pr->isError()) { + return; + } + Tp::AccountSetPtr accounts = am->accountsByProtocol("kdeconnect"); + if (!accounts) { + return; + } + if (accounts->accounts().isEmpty()) { + Tp::PendingAccount* pa = am->createAccount("kdeconnect", "kdeconnect", "kdeconnect", QVariantMap(), QVariantMap()); + QObject::connect(pa, &Tp::PendingOperation::finished, pa, [pa](){ + if (pa->isError() || !pa->account()) { + return; + } + pa->account()->setEnabled(true); + pa->account()->setRequestedPresence(Tp::Presence::available()); + }); + } else { + Tp::AccountPtr account = accounts->accounts().first(); + account->setRequestedPresence(Tp::Presence::available()); + } + }); + } + return s_interface.toStrongRef(); +} diff -Nru kdeconnect-plasma-0.0+git20150810/telepathy-cm/kdeconnecttelepathyprotocolfactory.h kdeconnect-plasma-0.9+git20160315/telepathy-cm/kdeconnecttelepathyprotocolfactory.h --- kdeconnect-plasma-0.0+git20150810/telepathy-cm/kdeconnecttelepathyprotocolfactory.h 1970-01-01 01:00:00.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/telepathy-cm/kdeconnecttelepathyprotocolfactory.h 2016-03-15 09:57:50.000000000 +0000 @@ -0,0 +1,18 @@ +#include "protocol.h" + +#include "connectcm_export.h" + +typedef Tp::SharedPtr ConnectProtocolPtr; + +/* + * SingletonFactory for plugins to get access to the Telepathy connection manager + * Whilst the main process also holds a reference. + * + */ +class CONNECTCM_EXPORT KDEConnectTelepathyProtocolFactory +{ +public: + static ConnectProtocolPtr interface(); +private: + static Tp::WeakPtr s_interface; +}; diff -Nru kdeconnect-plasma-0.0+git20150810/telepathy-cm/protocol.cpp kdeconnect-plasma-0.9+git20160315/telepathy-cm/protocol.cpp --- kdeconnect-plasma-0.0+git20150810/telepathy-cm/protocol.cpp 1970-01-01 01:00:00.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/telepathy-cm/protocol.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -0,0 +1,116 @@ +/* + Copyright (C) 2014 Alexandr Akulich + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ + +#include "protocol.h" +#include "connection.h" + +#include +#include +#include +#include +#include + +#include +#include + +KDEConnectTelepathyProtocol::KDEConnectTelepathyProtocol(const QDBusConnection &dbusConnection, const QString &name) + : BaseProtocol(dbusConnection, name) +{ +// setParameters(Tp::ProtocolParameterList() +// << Tp::ProtocolParameter(QLatin1String("device_id"), QLatin1String("s"), Tp::ConnMgrParamFlagRequired) +// << Tp::ProtocolParameter(QLatin1String("self_name"), QLatin1String("s"), 0)); + + setRequestableChannelClasses(Tp::RequestableChannelClassSpecList() << Tp::RequestableChannelClassSpec::textChat()); + + // callbacks + setCreateConnectionCallback(memFun(this, &KDEConnectTelepathyProtocol::createConnection)); + setIdentifyAccountCallback(memFun(this, &KDEConnectTelepathyProtocol::identifyAccount)); + setNormalizeContactCallback(memFun(this, &KDEConnectTelepathyProtocol::normalizeContact)); + + addrIface = Tp::BaseProtocolAddressingInterface::create(); + addrIface->setAddressableVCardFields(QStringList() << QLatin1String("x-example-vcard-field")); + addrIface->setAddressableUriSchemes(QStringList() << QLatin1String("example-uri-scheme")); + addrIface->setNormalizeVCardAddressCallback(memFun(this, &KDEConnectTelepathyProtocol::normalizeVCardAddress)); + addrIface->setNormalizeContactUriCallback(memFun(this, &KDEConnectTelepathyProtocol::normalizeContactUri)); + plugInterface(Tp::AbstractProtocolInterfacePtr::dynamicCast(addrIface)); +/* + presenceIface = Tp::BaseProtocolPresenceInterface::create(); + presenceIface->setStatuses(Tp::PresenceSpecList(ConnectConnection::getConnectStatusSpecMap())); + plugInterface(Tp::AbstractProtocolInterfacePtr::dynamicCast(presenceIface));*/ + + Tp::DBusError err; +} + +KDEConnectTelepathyProtocol::~KDEConnectTelepathyProtocol() +{ +} + +void KDEConnectTelepathyProtocol::setConnectionManagerName(const QString &newName) +{ + m_connectionManagerName = newName; +} + +bool KDEConnectTelepathyProtocol::sendMessage(QString sender, QString message) +{ + if (m_connection) { + return m_connection->receiveMessage(sender, message); + } + return false; +} + +void KDEConnectTelepathyProtocol::setContactList(QStringList list) +{ + if (m_connection) { + m_connection->setContactList(list); + } +} + +Tp::BaseConnectionPtr KDEConnectTelepathyProtocol::createConnection(const QVariantMap ¶meters, Tp::DBusError *error) +{ + Q_UNUSED(error) + + auto newConnection = Tp::BaseConnection::create(m_connectionManagerName, this->name(), parameters); + connect(newConnection.constData(), SIGNAL(messageReceived(QString,QString)), SIGNAL(messageReceived(QString,QString))); + m_connection = newConnection; + + return newConnection; +} + +QString KDEConnectTelepathyProtocol::identifyAccount(const QVariantMap ¶meters, Tp::DBusError *error) +{ + qDebug() << Q_FUNC_INFO << parameters; + error->set(QLatin1String("IdentifyAccount.Error.NotImplemented"), QLatin1String("")); + return QString(); +} + +QString KDEConnectTelepathyProtocol::normalizeContact(const QString &contactId, Tp::DBusError *error) +{ + qDebug() << Q_FUNC_INFO << contactId; + error->set(QLatin1String("NormalizeContact.Error.NotImplemented"), QLatin1String("")); + return QString(); +} + +QString KDEConnectTelepathyProtocol::normalizeVCardAddress(const QString &vcardField, const QString vcardAddress, + Tp::DBusError *error) +{ + qDebug() << Q_FUNC_INFO << vcardField << vcardAddress; + error->set(QLatin1String("NormalizeVCardAddress.Error.NotImplemented"), QLatin1String("")); + return QString(); +} + +QString KDEConnectTelepathyProtocol::normalizeContactUri(const QString &uri, Tp::DBusError *error) +{ + qDebug() << Q_FUNC_INFO << uri; + error->set(QLatin1String("NormalizeContactUri.Error.NotImplemented"), QLatin1String("")); + return QString(); +} diff -Nru kdeconnect-plasma-0.0+git20150810/telepathy-cm/protocol.h kdeconnect-plasma-0.9+git20160315/telepathy-cm/protocol.h --- kdeconnect-plasma-0.0+git20150810/telepathy-cm/protocol.h 1970-01-01 01:00:00.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/telepathy-cm/protocol.h 2016-03-15 09:57:50.000000000 +0000 @@ -0,0 +1,68 @@ +/* + Copyright (C) 2014 Alexandr Akulich + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ + +#ifndef CONNECTCM_PROTOCOL_H +#define CONNECTCM_PROTOCOL_H + +#include "connectcm_export.h" + +#include + +class ConnectConnection; + +class CONNECTCM_EXPORT KDEConnectTelepathyProtocol : public Tp::BaseProtocol +{ + Q_OBJECT + Q_DISABLE_COPY(KDEConnectTelepathyProtocol) + +public: + KDEConnectTelepathyProtocol(const QDBusConnection &dbusConnection, const QString &name); + virtual ~KDEConnectTelepathyProtocol(); + + QString connectionManagerName() const; + void setConnectionManagerName(const QString &newName); + +public slots: + bool sendMessage(QString sender, QString message); + void setContactList(QStringList list); + +signals: + void contactsListChanged(QStringList); + void messageReceived(QString sender, QString message); + +private: + Tp::BaseConnectionPtr createConnection(const QVariantMap ¶meters, Tp::DBusError *error); + QString identifyAccount(const QVariantMap ¶meters, Tp::DBusError *error); + QString normalizeContact(const QString &contactId, Tp::DBusError *error); + + // Proto.I.Addressing + QString normalizeVCardAddress(const QString &vCardField, const QString vCardAddress, + Tp::DBusError *error); + QString normalizeContactUri(const QString &uri, Tp::DBusError *error); + + Tp::BaseProtocolAddressingInterfacePtr addrIface; + Tp::BaseProtocolAvatarsInterfacePtr avatarsIface; + + QString m_connectionManagerName; + + //normally keeping the connection in the protocol would be really weird + //however we want to proxy the messages to the active connection and want a single entry point + Tp::SharedPtr m_connection; +}; + +inline QString KDEConnectTelepathyProtocol::connectionManagerName() const +{ + return m_connectionManagerName; +} + +#endif // CONNECTCM_PROTOCOL_H diff -Nru kdeconnect-plasma-0.0+git20150810/telepathy-cm/README kdeconnect-plasma-0.9+git20160315/telepathy-cm/README --- kdeconnect-plasma-0.0+git20150810/telepathy-cm/README 1970-01-01 01:00:00.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/telepathy-cm/README 2016-03-15 09:57:50.000000000 +0000 @@ -0,0 +1 @@ +Connect TelepathyQt-based Connection Manager. diff -Nru kdeconnect-plasma-0.0+git20150810/telepathy-cm/textchannel.cpp kdeconnect-plasma-0.9+git20160315/telepathy-cm/textchannel.cpp --- kdeconnect-plasma-0.0+git20150810/telepathy-cm/textchannel.cpp 1970-01-01 01:00:00.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/telepathy-cm/textchannel.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -0,0 +1,73 @@ +/* + Copyright (C) 2014 Alexandr Akulich + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ + +#include "textchannel.h" + +#include +#include +#include +#include + +#include +#include + +#include + +ConnectTextChannel::ConnectTextChannel(QObject *connection, Tp::BaseChannel *baseChannel, uint targetHandle, const QString &identifier) + : Tp::BaseChannelTextType(baseChannel), + m_connection(connection), + m_identifier(identifier) +{ + QStringList supportedContentTypes = QStringList() << "text/plain"; + Tp::UIntList messageTypes = Tp::UIntList() << Tp::ChannelTextMessageTypeNormal; + + uint messagePartSupportFlags = 0; + uint deliveryReportingSupport = 0; + + m_messagesIface = Tp::BaseChannelMessagesInterface::create(this, + supportedContentTypes, + messageTypes, + messagePartSupportFlags, + deliveryReportingSupport); + + baseChannel->plugInterface(Tp::AbstractChannelInterfacePtr::dynamicCast(m_messagesIface)); + + m_messagesIface->setSendMessageCallback(Tp::memFun(this, &ConnectTextChannel::sendMessageCallback)); +} + +ConnectTextChannelPtr ConnectTextChannel::create(QObject *connection, Tp::BaseChannel *baseChannel, uint targetHandle, const QString &identifier) +{ + return ConnectTextChannelPtr(new ConnectTextChannel(connection, baseChannel, targetHandle, identifier)); +} + +ConnectTextChannel::~ConnectTextChannel() +{ +} + +QString ConnectTextChannel::sendMessageCallback(const Tp::MessagePartList &messageParts, uint flags, Tp::DBusError *error) +{ + QString content; + for (Tp::MessagePartList::const_iterator i = messageParts.begin()+1; i != messageParts.end(); ++i) { + if(i->count(QLatin1String("content-type")) + && i->value(QLatin1String("content-type")).variant().toString() == QLatin1String("text/plain") + && i->count(QLatin1String("content"))) + { + content = i->value(QLatin1String("content")).variant().toString(); + break; + } + } + + QMetaObject::invokeMethod(m_connection, "messageReceived", Q_ARG(QString, m_identifier), Q_ARG(QString, content)); + + return QString(); +} diff -Nru kdeconnect-plasma-0.0+git20150810/telepathy-cm/textchannel.h kdeconnect-plasma-0.9+git20160315/telepathy-cm/textchannel.h --- kdeconnect-plasma-0.0+git20150810/telepathy-cm/textchannel.h 1970-01-01 01:00:00.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/telepathy-cm/textchannel.h 2016-03-15 09:57:50.000000000 +0000 @@ -0,0 +1,46 @@ +/* + Copyright (C) 2014 Alexandr Akulich + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ + +#ifndef CONNECTCM_TEXTCHANNEL_H +#define CONNECTCM_TEXTCHANNEL_H + +#include "connectcm_export.h" + +#include + +class ConnectTextChannel; + +typedef Tp::SharedPtr ConnectTextChannelPtr; + +class CONNECTCM_EXPORT ConnectTextChannel : public Tp::BaseChannelTextType +{ + Q_OBJECT +public: + static ConnectTextChannelPtr create(QObject *connection, Tp::BaseChannel *baseChannel, uint targetHandle, const QString &identifier); + virtual ~ConnectTextChannel(); + + QString sendMessageCallback(const Tp::MessagePartList &messageParts, uint flags, Tp::DBusError *error); + +private: + ConnectTextChannel(QObject *connection, Tp::BaseChannel *baseChannel, uint targetHandle, const QString &identifier); + + QObject *m_connection; + + QString m_identifier; + + Tp::BaseChannelTextTypePtr m_channelTextType; + Tp::BaseChannelMessagesInterfacePtr m_messagesIface; + +}; + +#endif // CONNECTCM_TEXTCHANNEL_H diff -Nru kdeconnect-plasma-0.0+git20150810/tests/CMakeLists.txt kdeconnect-plasma-0.9+git20160315/tests/CMakeLists.txt --- kdeconnect-plasma-0.0+git20150810/tests/CMakeLists.txt 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/tests/CMakeLists.txt 2016-03-15 09:57:50.000000000 +0000 @@ -1,4 +1,5 @@ -find_package(KF5 REQUIRED COMPONENTS KIO) +find_package(Qt5 REQUIRED COMPONENTS Test) +find_package(KF5 REQUIRED COMPONENTS KIO Notifications IconThemes) include_directories( ${KDEConnectCore_BINARY_DIR} @@ -13,5 +14,16 @@ qca-qt5 ) +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(testnotificationlistener.cpp + ../plugins/notifications/notificationslistener.cpp + ../plugins/notifications/notificationsplugin.cpp + ../plugins/notifications/notification.cpp + ../plugins/notifications/notifyingapplication.cpp + ../plugins/notifications/notificationsdbusinterface.cpp + TEST_NAME testnotificationlistener + LINK_LIBRARIES ${kdeconnect_libraries} Qt5::DBus KF5::Notifications KF5::IconThemes) diff -Nru kdeconnect-plasma-0.0+git20150810/tests/downloadjobtest.cpp kdeconnect-plasma-0.9+git20160315/tests/downloadjobtest.cpp --- kdeconnect-plasma-0.0+git20150810/tests/downloadjobtest.cpp 1970-01-01 01:00:00.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/tests/downloadjobtest.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -0,0 +1,107 @@ +/************************************************************************************* + * Copyright (C) 2014 by Albert Vaca Cintora * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Lesser General Public * + * License as published by the Free Software Foundation; either * + * version 2.1 of the License, or (at your option) any later version. * + * * + * This library 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 * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * + *************************************************************************************/ + +#include "../core/backends/lan/downloadjob.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +class DownloadJobTest : public QObject +{ + Q_OBJECT + +private Q_SLOTS: + void failToConnectShouldDestroyTheJob(); + void closingTheConnectionShouldDestroyTheJob(); +private: + + void initServer(); + void initDownloadJob(); + void awaitToBeDestroyedOrTimeOut(); + void stopServer(); + + QTimer mTimer; + QEventLoop mLoop; + DownloadJob* test; + QTcpServer *mServer; +}; + +void DownloadJobTest::initServer() +{ + mServer = new QTcpServer(this); + QVERIFY2(mServer->listen(QHostAddress::LocalHost, 8694), "Failed to create local tcp server"); +} + +void DownloadJobTest::stopServer() +{ + mServer->close(); +} + +void DownloadJobTest::initDownloadJob() +{ + QVariantMap transferInfo; + transferInfo["port"]= 8694; + test = new DownloadJob(QHostAddress::LocalHost, transferInfo); + test->start(); +} + +void DownloadJobTest::awaitToBeDestroyedOrTimeOut() +{ + //Either the job is destroyed + connect(test, &QObject::destroyed, &mLoop, &QEventLoop::quit); + + //Or we time out + mTimer.setInterval(2000); + mTimer.setSingleShot(true); + connect(&mTimer, &QTimer::timeout, [this]() { + mLoop.quit(); + QFAIL("Test timed out"); + }); + mTimer.start(); + + //We wait + mLoop.exec(); + + mTimer.stop(); +} + +void DownloadJobTest::failToConnectShouldDestroyTheJob() +{ + initDownloadJob(); + awaitToBeDestroyedOrTimeOut(); +} + +void DownloadJobTest::closingTheConnectionShouldDestroyTheJob() +{ + initServer(); + initDownloadJob(); + stopServer(); + awaitToBeDestroyedOrTimeOut(); +} + +QTEST_GUILESS_MAIN(DownloadJobTest) + +#include "downloadjobtest.moc" diff -Nru kdeconnect-plasma-0.0+git20150810/tests/networkpackagetests.cpp kdeconnect-plasma-0.9+git20160315/tests/networkpackagetests.cpp --- kdeconnect-plasma-0.0+git20150810/tests/networkpackagetests.cpp 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/tests/networkpackagetests.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -84,7 +84,7 @@ NetworkPackage np(""); NetworkPackage::createIdentityPackage(&np); - QCOMPARE( np.get("protocolVersion") , NetworkPackage::ProtocolVersion ); + QCOMPARE( np.get("protocolVersion", -1) , NetworkPackage::ProtocolVersion ); QCOMPARE( np.type() , PACKAGE_TYPE_IDENTITY ); } diff -Nru kdeconnect-plasma-0.0+git20150810/tests/pluginloadtest.cpp kdeconnect-plasma-0.9+git20160315/tests/pluginloadtest.cpp --- kdeconnect-plasma-0.0+git20150810/tests/pluginloadtest.cpp 1970-01-01 01:00:00.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/tests/pluginloadtest.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -0,0 +1,109 @@ +/** + * Copyright 2015 Aleix Pol Gonzalez + * + * 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 . + */ + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "core/daemon.h" +#include "core/device.h" +#include "core/kdeconnectplugin.h" +#include "kdeconnect-version.h" + +class TestDaemon : public Daemon +{ +Q_OBJECT +public: + TestDaemon(QObject* parent = Q_NULLPTR) + : Daemon(parent, true) + , m_nam(Q_NULLPTR) + { + } + + void requestPairing(Device* d) Q_DECL_OVERRIDE + { + d->acceptPairing(); + } + + void reportError(const QString & title, const QString & description) Q_DECL_OVERRIDE + { + qWarning() << "error:" << title << description; + } + + QNetworkAccessManager* networkAccessManager() Q_DECL_OVERRIDE + { + if (!m_nam) { + m_nam = new KIO::AccessManager(this); + } + return m_nam; + } + +private: + QNetworkAccessManager* m_nam; +}; + +class PluginLoadTest : public QObject +{ + Q_OBJECT + public: + PluginLoadTest() : mDaemon(new TestDaemon) { + QStandardPaths::setTestModeEnabled(true); + } + + private Q_SLOTS: + void testPlugins() { + Device* d = nullptr; + foreach(Device* id, mDaemon->devicesList()) { + if (id->isReachable()) { + id->requestPair(); + d = id; + } + } + + if (!d->loadedPlugins().contains("kdeconnect_remotecontrol")) { + QSKIP("kdeconnect_remotecontrol is required for this test"); + } + + QVERIFY(d); + QVERIFY(d->isPaired()); + QVERIFY(d->isReachable()); + + d->setPluginEnabled("kdeconnect_mousepad", false); + QCOMPARE(d->isPluginEnabled("kdeconnect_mousepad"), false); + QVERIFY(d->unsupportedPlugins().contains("kdeconnect_remotecontrol")); + + d->setPluginEnabled("kdeconnect_mousepad", true); + QCOMPARE(d->isPluginEnabled("kdeconnect_mousepad"), true); + QVERIFY(!d->unsupportedPlugins().contains("kdeconnect_remotecontrol")); + } + + private: + TestDaemon* mDaemon; +}; + +QTEST_MAIN(PluginLoadTest); + +#include "pluginloadtest.moc" diff -Nru kdeconnect-plasma-0.0+git20150810/tests/sendfiletest.cpp kdeconnect-plasma-0.9+git20160315/tests/sendfiletest.cpp --- kdeconnect-plasma-0.0+git20150810/tests/sendfiletest.cpp 1970-01-01 01:00:00.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/tests/sendfiletest.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -0,0 +1,118 @@ +/** + * Copyright 2015 Aleix Pol Gonzalez + * + * 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 . + */ + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "core/daemon.h" +#include "core/device.h" +#include "core/kdeconnectplugin.h" +#include "kdeconnect-version.h" + +class TestDaemon : public Daemon +{ +Q_OBJECT +public: + TestDaemon(QObject* parent = Q_NULLPTR) + : Daemon(parent, true) + , m_nam(Q_NULLPTR) + { + } + + void requestPairing(Device* d) Q_DECL_OVERRIDE + { + d->acceptPairing(); + } + + void reportError(const QString & title, const QString & description) Q_DECL_OVERRIDE + { + qWarning() << "error:" << title << description; + } + + QNetworkAccessManager* networkAccessManager() Q_DECL_OVERRIDE + { + if (!m_nam) { + m_nam = new KIO::AccessManager(this); + } + return m_nam; + } + +private: + QNetworkAccessManager* m_nam; +}; + +class TestSendFile : public QObject +{ + Q_OBJECT + public: + TestSendFile() : mDaemon(new TestDaemon) { + QStandardPaths::setTestModeEnabled(true); + } + + private Q_SLOTS: + void testSend() { + Device* d = nullptr; + foreach(Device* id, mDaemon->devicesList()) { + if (id->isReachable()) { + id->requestPair(); + d = id; + } + } + QVERIFY(d); + QCOMPARE(d->isReachable(), true); + QCOMPARE(d->isPaired(), true); + + QByteArray content("12312312312313213123213123"); + + QTemporaryFile temp; + temp.open(); + temp.write(content); + temp.close(); + + KdeConnectPlugin* plugin = d->plugin("kdeconnect_share"); + QVERIFY(plugin); + plugin->metaObject()->invokeMethod(plugin, "shareUrl", Q_ARG(QString, QUrl::fromLocalFile(temp.fileName()).toString())); + + QSignalSpy spy(plugin, SIGNAL(shareReceived(QUrl))); + QVERIFY(spy.wait(2000)); + + QVariantList args = spy.takeFirst(); + QUrl sentFile(args.first().toUrl()); + + QFile file(sentFile.toLocalFile()); + QCOMPARE(file.size(), content.size()); + QVERIFY(file.open(QIODevice::ReadOnly)); + QCOMPARE(file.readAll(), content); + } + + private: + TestDaemon* mDaemon; +}; + +QTEST_MAIN(TestSendFile); + +#include "sendfiletest.moc" diff -Nru kdeconnect-plasma-0.0+git20150810/tests/testnotificationlistener.cpp kdeconnect-plasma-0.9+git20160315/tests/testnotificationlistener.cpp --- kdeconnect-plasma-0.0+git20150810/tests/testnotificationlistener.cpp 1970-01-01 01:00:00.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/tests/testnotificationlistener.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -0,0 +1,366 @@ +/** + * Copyright 2015 Holger Kaelberer + * + * 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 . + */ + +#include +#include +#include +#include +#include +#include + +#include + +#include "core/daemon.h" +#include "core/device.h" +#include "core/kdeconnectplugin.h" +#include "kdeconnect-version.h" +#include "plugins/notifications/notificationsplugin.h" +#include "plugins/notifications/notificationslistener.h" +#include "plugins/notifications/notificationsdbusinterface.h" +#include "plugins/notifications/notifyingapplication.h" + +// Tweaked NotificationsPlugin for testing +class TestNotificationsPlugin : public NotificationsPlugin +{ + Q_OBJECT +public: + explicit TestNotificationsPlugin(QObject *parent, const QVariantList &args) + : NotificationsPlugin(parent, args) + { + } + + virtual ~TestNotificationsPlugin() {}; + + // allow to access notificationsListener for testing: + NotificationsListener* getNotificationsListener() const + { + return notificationsListener; + } + + void setNotificationsListener(NotificationsListener* value) + { + notificationsListener = value; + } + + NotificationsDbusInterface* getNotificationsDbusInterface() const + { + return notificationsDbusInterface; + } +}; + +// Tweaked Device for testing: +class TestDevice: public Device +{ + Q_OBJECT +private: + int sentPackages; + NetworkPackage *lastPackage; + +public: + explicit TestDevice(QObject* parent, const QString& id) + : Device (parent, id) + , sentPackages(0) + , lastPackage(nullptr) + {} + + virtual ~TestDevice() + { + delete lastPackage; + } + + int getSentPackages() const + { + return sentPackages; + } + + const NetworkPackage* getLastPackage() const + { + return lastPackage; + } + +public Q_SLOTS: + virtual bool sendPackage(NetworkPackage& np) override + { + ++sentPackages; + // copy package manually to allow for inspection (can't use copy-constructor) + delete lastPackage; + lastPackage = new NetworkPackage(np.type()); + Q_ASSERT(lastPackage); + for (QVariantMap::ConstIterator iter = np.body().constBegin(); + iter != np.body().constEnd(); iter++) + lastPackage->set(iter.key(), iter.value()); + lastPackage->setPayload(np.payload(), np.payloadSize()); + return true; + } +}; + +// Tweaked NotificationsListener for testing: +class TestedNotificationsListener: public NotificationsListener +{ + +public: + explicit TestedNotificationsListener(KdeConnectPlugin* aPlugin, + NotificationsDbusInterface* aDbusInterface) + : NotificationsListener(aPlugin, aDbusInterface) + {} + + virtual ~TestedNotificationsListener() + {} + + QHash& getApplications() + { + return applications; + } + + void setApplications(const QHash& value) + { + applications = value; + } + +}; + +class TestNotificationListener : public QObject +{ + Q_OBJECT + public: + TestNotificationListener() + : plugin(nullptr) + { + QStandardPaths::setTestModeEnabled(true); + } + + private Q_SLOTS: + void testNotify(); + + private: + TestNotificationsPlugin* plugin; +}; + +void TestNotificationListener::testNotify() +{ + // + // set things up: + // + + QString dId("testid"); + TestDevice *d = new TestDevice(nullptr, dId); // not setting any parent or we will double free the dbusInterface + + int proxiedNotifications = 0; + QCOMPARE(proxiedNotifications, d->getSentPackages()); + plugin = new TestNotificationsPlugin(this, + QVariantList({ QVariant::fromValue(d), + "notifications_plugin", + {"kdeconnect.notification"}})); + QVERIFY(plugin->getNotificationsListener()); + delete plugin->getNotificationsListener(); + + // inject our tweaked NotificationsListener: + TestedNotificationsListener* listener = new TestedNotificationsListener(plugin, plugin->getNotificationsDbusInterface()); + QVERIFY(listener); + plugin->setNotificationsListener(listener); + QCOMPARE(listener, plugin->getNotificationsListener()); + + // make sure config is default: + plugin->config()->set("generalPersistent", false); + plugin->config()->set("generalIncludeBody", true); + plugin->config()->set("generalUrgency", 0); + QCOMPARE(plugin->config()->get("generalPersistent"), false); + QCOMPARE(plugin->config()->get("generalIncludeBody"), true); + QCOMPARE(plugin->config()->get("generalUrgency"), false); + + // applications are modified directly: + listener->getApplications().clear(); + QCOMPARE(listener->getApplications().count(), 0); + + // + // Go !!! + // + + uint replacesId = 99; + uint retId; + QString appName("some-appName"); + QString body("some-body"); + QString icon("some-icon"); + QString summary("some-summary"); + + // regular Notify call that is synchronized ... + retId = listener->Notify(appName, replacesId, icon, summary, body, {}, {{}}, 0); + // ... should return replacesId, + QCOMPARE(retId, replacesId); + // ... have triggered sending a package + QCOMPARE(++proxiedNotifications, d->getSentPackages()); + // ... with our properties, + QCOMPARE(d->getLastPackage()->get("id"), replacesId); + QCOMPARE(d->getLastPackage()->get("appName"), appName); + QCOMPARE(d->getLastPackage()->get("ticker"), summary + ": " + body); + QCOMPARE(d->getLastPackage()->get("isClearable"), true); + QCOMPARE(d->getLastPackage()->hasPayload(), false); + + // ... and create a new application internally that is initialized correctly: + QCOMPARE(listener->getApplications().count(), 1); + QVERIFY(listener->getApplications().contains(appName)); + QVERIFY(listener->getApplications()[appName].active); + QCOMPARE(listener->getApplications()[appName].name, appName); + QVERIFY(listener->getApplications()[appName].blacklistExpression.pattern().isEmpty()); + QCOMPARE(listener->getApplications()[appName].name, appName); + QCOMPARE(listener->getApplications()[appName].icon, icon); + + // another one, with other timeout and urgency values: + QString appName2("some-appName2"); + QString body2("some-body2"); + QString icon2("some-icon2"); + QString summary2("some-summary2"); + + retId = listener->Notify(appName2, replacesId+1, icon2, summary2, body2, {}, {{"urgency", 2}}, 10); + QCOMPARE(retId, replacesId+1); + QCOMPARE(++proxiedNotifications, d->getSentPackages()); + QCOMPARE(d->getLastPackage()->get("id"), replacesId+1); + QCOMPARE(d->getLastPackage()->get("appName"), appName2); + QCOMPARE(d->getLastPackage()->get("ticker"), summary2 + ": " + body2); + QCOMPARE(d->getLastPackage()->get("isClearable"), false); // timeout != 0 + QCOMPARE(d->getLastPackage()->hasPayload(), false); + QCOMPARE(listener->getApplications().count(), 2); + QVERIFY(listener->getApplications().contains(appName2)); + QVERIFY(listener->getApplications().contains(appName)); + + // if persistent-only is set, timeouts > 0 are not synced: + plugin->config()->set("generalPersistent", true); + retId = listener->Notify(appName, replacesId, icon, summary, body, {}, {{}}, 1); + QCOMPARE(retId, 0U); + QCOMPARE(proxiedNotifications, d->getSentPackages()); + retId = listener->Notify(appName2, replacesId, icon2, summary2, body2, {}, {{}}, 3); + QCOMPARE(retId, 0U); + QCOMPARE(proxiedNotifications, d->getSentPackages()); + // but timeout == 0 is + retId = listener->Notify(appName, replacesId, icon, summary, body, {}, {{}}, 0); + QCOMPARE(retId, replacesId); + QCOMPARE(++proxiedNotifications, d->getSentPackages()); + plugin->config()->set("generalPersistent", false); + + // if min-urgency is set, lower urgency levels are not synced: + plugin->config()->set("generalUrgency", 1); + retId = listener->Notify(appName, replacesId, icon, summary, body, {}, {{"urgency", 0}}, 0); + QCOMPARE(retId, 0U); + QCOMPARE(proxiedNotifications, d->getSentPackages()); + // equal urgency is + retId = listener->Notify(appName, replacesId, icon, summary, body, {}, {{"urgency", 1}}, 0); + QCOMPARE(retId, replacesId); + QCOMPARE(++proxiedNotifications, d->getSentPackages()); + // higher urgency as well + retId = listener->Notify(appName, replacesId, icon, summary, body, {}, {{"urgency", 2}}, 0); + QCOMPARE(retId, replacesId); + QCOMPARE(++proxiedNotifications, d->getSentPackages()); + plugin->config()->set("generalUrgency", 0); + + // notifications for a deactivated application are not synced: + QVERIFY(listener->getApplications().contains(appName)); + listener->getApplications()[appName].active = false; + QVERIFY(!listener->getApplications()[appName].active); + retId = listener->Notify(appName, replacesId, icon, summary, body, {}, {{"urgency", 0}}, 0); + QCOMPARE(retId, 0U); + QCOMPARE(proxiedNotifications, d->getSentPackages()); + // others are still: + retId = listener->Notify(appName2, replacesId+1, icon2, summary2, body2, {}, {{}}, 0); + QCOMPARE(retId, replacesId+1); + QCOMPARE(++proxiedNotifications, d->getSentPackages()); + // back to normal: + listener->getApplications()[appName].active = true; + QVERIFY(listener->getApplications()[appName].active); + retId = listener->Notify(appName, replacesId, icon, summary, body, {}, {{}}, 0); + QCOMPARE(retId, replacesId); + QCOMPARE(++proxiedNotifications, d->getSentPackages()); + + // notifications with blacklisted subjects are not synced: + QVERIFY(listener->getApplications().contains(appName)); + listener->getApplications()[appName].blacklistExpression.setPattern("black[12]|foo(bar|baz)"); + retId = listener->Notify(appName, replacesId, icon, "summary black1", body, {}, {{}}, 0); + QCOMPARE(retId, 0U); + QCOMPARE(proxiedNotifications, d->getSentPackages()); + retId = listener->Notify(appName, replacesId, icon, "summary foobar", body, {}, {{}}, 0); + QCOMPARE(retId, 0U); + QCOMPARE(proxiedNotifications, d->getSentPackages()); + // other subjects are synced: + retId = listener->Notify(appName, replacesId, icon, "summary foo", body, {}, {{}}, 0); + QCOMPARE(retId, replacesId); + QCOMPARE(++proxiedNotifications, d->getSentPackages()); + retId = listener->Notify(appName, replacesId, icon, "summary black3", body, {}, {{}}, 0); + QCOMPARE(retId, replacesId); + QCOMPARE(++proxiedNotifications, d->getSentPackages()); + // also body is checked by blacklist if requested: + plugin->config()->set("generalIncludeBody", true); + retId = listener->Notify(appName, replacesId, icon, summary, "body black1", {}, {{}}, 0); + QCOMPARE(retId, 0U); + QCOMPARE(proxiedNotifications, d->getSentPackages()); + retId = listener->Notify(appName, replacesId, icon, summary, "body foobaz", {}, {{}}, 0); + QCOMPARE(retId, 0U); + QCOMPARE(proxiedNotifications, d->getSentPackages()); + // body does not matter if inclusion was not requested: + plugin->config()->set("generalIncludeBody", false); + retId = listener->Notify(appName, replacesId, icon, summary, "body black1", {}, {{}}, 0); + QCOMPARE(retId, replacesId); + QCOMPARE(++proxiedNotifications, d->getSentPackages()); + // without body, also ticker value is different: + QCOMPARE(d->getLastPackage()->get("ticker"), summary); + retId = listener->Notify(appName, replacesId, icon, summary, "body foobaz", {}, {{}}, 0); + QCOMPARE(retId, replacesId); + QCOMPARE(++proxiedNotifications, d->getSentPackages()); + + // back to normal: + listener->getApplications()[appName].blacklistExpression.setPattern(""); + plugin->config()->set("generalIncludeBody", true); + retId = listener->Notify(appName, replacesId, icon, summary, body, {}, {{}}, 0); + QCOMPARE(retId, replacesId); + QCOMPARE(++proxiedNotifications, d->getSentPackages()); + retId = listener->Notify(appName2, replacesId, icon2, summary2, body2, {}, {{}}, 0); + QCOMPARE(retId, replacesId); + QCOMPARE(++proxiedNotifications, d->getSentPackages()); + + // icon synchronization: + int count = 0; + for (const auto& iconName: KIconLoader::global()->queryIcons(-KIconLoader::SizeEnormous, KIconLoader::Application)) { + if (!iconName.endsWith(".png")) + continue; + if (count++ > 3) // max 3 iterations + break; + + // existing icons are sync-ed if requested + plugin->config()->set("generalSynchronizeIcons", true); + QFileInfo fi(iconName); + //qDebug() << "XXX" << iconName << fi.baseName() << fi.size(); + retId = listener->Notify(appName, replacesId, fi.baseName(), summary, body, {}, {{}}, 0); + QCOMPARE(retId, replacesId); + QCOMPARE(++proxiedNotifications, d->getSentPackages()); + QVERIFY(d->getLastPackage()->hasPayload()); + QCOMPARE(d->getLastPackage()->payloadSize(), fi.size()); + + // otherwise no payload: + plugin->config()->set("generalSynchronizeIcons", false); + retId = listener->Notify(appName, replacesId, fi.baseName(), summary, body, {}, {{}}, 0); + QCOMPARE(retId, replacesId); + QCOMPARE(++proxiedNotifications, d->getSentPackages()); + QVERIFY(!d->getLastPackage()->hasPayload()); + QCOMPARE(d->getLastPackage()->payloadSize(), 0); + } +} + + +QTEST_GUILESS_MAIN(TestNotificationListener); + +#include "testnotificationlistener.moc" diff -Nru kdeconnect-plasma-0.0+git20150810/tests/testsocketlinereader.cpp kdeconnect-plasma-0.9+git20160315/tests/testsocketlinereader.cpp --- kdeconnect-plasma-0.0+git20150810/tests/testsocketlinereader.cpp 2015-08-10 16:21:25.000000000 +0100 +++ kdeconnect-plasma-0.9+git20160315/tests/testsocketlinereader.cpp 2016-03-15 09:57:50.000000000 +0000 @@ -80,7 +80,7 @@ QTcpSocket *sock = mServer->nextPendingConnection(); - QVERIFY2(sock != 0, "Could not open a connection to the client"); + QVERIFY2(sock != nullptr, "Could not open a connection to the client"); mReader = new SocketLineReader(sock, this); connect(mReader, SIGNAL(readyRead()), SLOT(newPackage()));