Commit 21ab5a4f authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

Merge branch 'master' into frameworks

Mostly kDebug -> qCDebug
Also some KCmdLineArgs -> QCommandLineParser

Conflicts:
	cli/kdeconnect-cli.cpp
	core/CMakeLists.txt
	core/backends/lan/lanlinkprovider.cpp
	core/daemon.cpp
	core/pluginloader.cpp
	interfaces/CMakeLists.txt
	kio/kiokdeconnect.cpp
	plugins/mousepad/CMakeLists.txt
	plugins/mousepad/mousepadplugin.h
	plugins/mpriscontrol/mpriscontrolplugin.cpp
	plugins/sftp/sftpplugin.cpp
parents 1a1969f4 3b192ea1
......@@ -43,6 +43,7 @@ int main(int argc, char** argv)
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("list-notifications", i18n("Display the notifications on a said device")));
parser.addOption(QCommandLineOption("ping-msg <message>", i18n("Same as ping but you can customize the shown message."), i18n("message")));
parser.addOption(QCommandLineOption("device", i18n("Device ID"), "dev"));
about.setupCommandLine(&parser);
......@@ -70,6 +71,9 @@ int main(int argc, char** argv)
<< ": " << idx.data(DevicesModel::IdModelRole).toString().toStdString() << ' ' << statusInfo.toStdString() << std::endl;
}
std::cout << devices.rowCount() << " devices found" << std::endl;
} else if(parser.isSet("refresh")) {
QDBusMessage msg = QDBusMessage::createMethodCall("org.kde.kdeconnect", "/modules/kdeconnect", "org.kde.kdeconnect.daemon", "forceOnNetworkChange");
QDBusConnection::sessionBus().call(msg);
} else {
QString device;
if(!parser.isSet("device")) {
......@@ -102,8 +106,12 @@ int main(int argc, char** argv)
QDBusPendingReply<void> req = dev.unpair();
req.waitForFinished();
}
} else if(parser.isSet("ping")) {
} else if(parser.isSet("ping") || parser.isSet("ping-msg")) {
QDBusMessage msg = QDBusMessage::createMethodCall("org.kde.kdeconnect", "/modules/kdeconnect/devices/"+device+"/ping", "org.kde.kdeconnect.device.ping", "sendPing");
if (parser.isSet("ping-msg")) {
QString message = parser.value("ping-msg");
msg.setArguments(QVariantList() << message);
}
QDBusConnection::sessionBus().call(msg);
} else if(parser.isSet("list-notifications")) {
NotificationsModel notifications;
......
#
# - Try to find the fakekey library
# Once done this will define
#
# LibFakeKey_FOUND - system has LibFakeKey
# LibFakeKey_INCLUDE_DIRS - the LibFakeKey include directory
# LibFakeKey_LIBRARIES - The libraries needed to use LibFakeKey
# LibFakeKey_VERSION - The LibFakeKey version
# Copyright (c) 2014 Christophe Giboudeaux <cgiboudeaux@gmx.com>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. The name of the author may not be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
find_package(PkgConfig QUIET REQUIRED)
pkg_check_modules(PC_LibFakeKey libfakekey)
find_path(LibFakeKey_INCLUDE_DIRS
NAMES fakekey/fakekey.h
HINTS ${PC_LibFakeKey_LIBRARY_DIRS}
)
find_library(LibFakeKey_LIBRARIES
NAMES fakekey
HINTS ${PC_LibFakeKey_LIBRARY_DIRS}
)
set(LibFakeKey_VERSION ${PC_LibFakeKey_VERSION})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LibFakeKey
FOUND_VAR LibFakeKey_FOUND
REQUIRED_VARS LibFakeKey_LIBRARIES LibFakeKey_INCLUDE_DIRS
VERSION_VAR LibFakeKey_VERSION
)
mark_as_advanced(LibFakeKey_LIBRARIES LibFakeKey_INCLUDE_DIRS LibFakeKey_VERSION)
......@@ -23,6 +23,7 @@ set(kded_kdeconnect_SRCS
kdeconnectplugin.cpp
pluginloader.cpp
dbushelper.cpp
networkpackage.cpp
filetransferjob.cpp
daemon.cpp
......
......@@ -29,6 +29,5 @@ DeviceLink::DeviceLink(const QString& deviceId, LinkProvider* parent)
Q_ASSERT(!deviceId.isEmpty());
setProperty("deviceId", deviceId);
//gcc complains if we don't add something to compile on a class with virtual functions
}
......@@ -30,6 +30,9 @@
#include <QTcpServer>
#include <QUdpSocket>
#include <KSharedConfig>
#include <KConfigGroup>
#include "landevicelink.h"
void LanLinkProvider::configureSocket(QTcpSocket* socket)
......@@ -44,13 +47,17 @@ void LanLinkProvider::configureSocket(QTcpSocket* socket)
#endif
#ifdef TCP_KEEPCNT
int count = 3; // send up to 3 keepalive packets out, then disconnect if no response
setsockopt(fd, getprotobyname("TCP")->p_proto, TCP_KEEPCNT, &count, sizeof(count));
if (getprotobyname("TCP")) {
int count = 3; // send up to 3 keepalive packets out, then disconnect if no response
setsockopt(fd, getprotobyname("TCP")->p_proto, TCP_KEEPCNT, &count, sizeof(count));
}
#endif
#ifdef TCP_KEEPINTVL
int interval = 5; // send a keepalive packet out every 2 seconds (after the 5 second idle period)
setsockopt(fd, getprotobyname("TCP")->p_proto, TCP_KEEPINTVL, &interval, sizeof(interval));
if (getprotobyname("TCP")) {
int interval = 5; // send a keepalive packet out every 2 seconds (after the 5 second idle period)
setsockopt(fd, getprotobyname("TCP")->p_proto, TCP_KEEPINTVL, &interval, sizeof(interval));
}
#endif
}
......@@ -98,6 +105,8 @@ void LanLinkProvider::onNetworkChange(QNetworkSession::State state)
NetworkPackage::createIdentityPackage(&np);
np.set("tcpPort", mTcpPort);
mUdpSocket.writeDatagram(np.serialize(), QHostAddress("255.255.255.255"), port);
//TODO: Ping active connections to see if they are still reachable
}
//I'm the existing device, a new device is kindly introducing itself (I will create a TcpSocket)
......@@ -123,17 +132,17 @@ void LanLinkProvider::newUdpConnection()
delete receivedPackage;
}
NetworkPackage np2("");
NetworkPackage::createIdentityPackage(&np2);
KSharedConfigPtr config = KSharedConfig::openConfig("kdeconnectrc");
const QString myId = config->group("myself").readEntry<QString>("id","");
if (receivedPackage->get<QString>("deviceId") == np2.get<QString>("deviceId")) {
//kDebug(kdeconnect_kded()) << "Ignoring my own broadcast";
//kDebug(debugArea()) << "Ignoring my own broadcast";
if (receivedPackage->get<QString>("deviceId") == myId) {
return;
}
int tcpPort = receivedPackage->get<int>("tcpPort", port);
//kDebug(kdeconnect_kded()) << "Received Udp presentation from" << sender << "asking for a tcp connection on port " << tcpPort;
//kDebug(debugArea()) << "Received Udp presentation from" << sender << "asking for a tcp connection on port " << tcpPort;
QTcpSocket* socket = new QTcpSocket(this);
receivedIdentityPackages[socket].np = receivedPackage;
......@@ -165,6 +174,8 @@ void LanLinkProvider::connected()
QTcpSocket* socket = qobject_cast<QTcpSocket*>(sender());
if (!socket) return;
disconnect(socket, SIGNAL(connected()), this, SLOT(connected()));
disconnect(socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(connectError()));
......@@ -181,7 +192,6 @@ void LanLinkProvider::connected()
bool success = deviceLink->sendPackage(np2);
//TODO: Use reverse connection too to preffer connecting a unstable device (a phone) to a stable device (a computer)
if (success) {
//qCDebug(KDECONNECT_CORE) << "Handshaking done (i'm the existing device)";
......
......@@ -36,7 +36,7 @@ class LinkProvider
public:
const static int PRIORITY_LOW = 0; //eg: 3g
const static int PRIORITY_LOW = 0; //eg: 3g internet
const static int PRIORITY_MEDIUM = 50; //eg: internet
const static int PRIORITY_HIGH = 100; //eg: lan
......
......@@ -28,12 +28,14 @@
#include <QNetworkConfigurationManager>
#include <QtCrypto>
#include <QStandardPaths>
#include <QNetworkAccessManager>
#include <KConfig>
#include <KConfigGroup>
#include <KSharedConfig>
#include "core_debug.h"
#include "dbushelper.h"
#include "networkpackage.h"
#include "backends/lan/lanlinkprovider.h"
#include "backends/loopback/loopbacklinkprovider.h"
......@@ -60,12 +62,13 @@ Daemon::Daemon(QObject *parent)
: QObject(parent)
, d(new DaemonPrivate)
{
qCDebug(KDECONNECT_CORE) << "KdeConnect daemon starting";
KSharedConfigPtr config = KSharedConfig::openConfig("kdeconnectrc");
if (!config->group("myself").hasKey("id")) {
QString uuid = QUuid::createUuid().toString();
//uuids contain charcaters that are not exportable in dbus paths
uuid = uuid.mid(1, uuid.length() - 2).replace("-", "_");
DbusHelper::filterNonExportableCharacters(uuid);
config->group("myself").writeEntry("id", uuid);
config->sync();
qCDebug(KDECONNECT_CORE) << "My id:" << uuid;
......@@ -73,7 +76,7 @@ Daemon::Daemon(QObject *parent)
//qCDebug(KDECONNECT_CORE) << "QCA supported capabilities:" << QCA::supportedFeatures().join(",");
if(!QCA::isSupported("rsa")) {
//TODO: Maybe display this in a more visible way?
//TODO: Display this in a notification or another visible way
qCDebug(KDECONNECT_CORE) << "Error: KDE Connect could not find support for RSA in your QCA installation, if your distribution provides"
<< "separate packages for QCA-ossl and QCA-gnupg plugins, make sure you have them installed and try again";
return;
......@@ -106,6 +109,7 @@ Daemon::Daemon(QObject *parent)
}
privKey.close();
//TODO: This should not store an absolute path: it will cause problems if the home folder changes, .kde4 becomes .kde (debian?), or similar...
config->group("myself").writeEntry("privateKeyPath", privateKeyPath);
config->sync();
}
......@@ -115,8 +119,9 @@ Daemon::Daemon(QObject *parent)
qCDebug(KDECONNECT_CORE) << "Error: KDE Connect detects wrong permissions for private file " << config->group("myself").readEntry("privateKeyPath");
}
//Debugging
qCDebug(KDECONNECT_CORE) << "Starting KdeConnect daemon";
//Register on DBus
QDBusConnection::sessionBus().registerService("org.kde.kdeconnect");
QDBusConnection::sessionBus().registerObject("/modules/kdeconnect", this, QDBusConnection::ExportScriptableContents);
//Load backends (hardcoded by now, should be plugins in a future)
d->mLinkProviders.insert(new LanLinkProvider());
......@@ -133,25 +138,28 @@ Daemon::Daemon(QObject *parent)
Q_EMIT deviceAdded(id);
}
//Listen to connectivity changes
QNetworkSession* network = new QNetworkSession(QNetworkConfigurationManager().defaultConfiguration());
//Listen to new devices
Q_FOREACH (LinkProvider* a, d->mLinkProviders) {
connect(network, SIGNAL(stateChanged(QNetworkSession::State)),
a, SLOT(onNetworkChange(QNetworkSession::State)));
connect(a, SIGNAL(onConnectionReceived(NetworkPackage, DeviceLink*)),
this, SLOT(onNewDeviceLink(NetworkPackage, DeviceLink*)));
}
QDBusConnection::sessionBus().registerService("org.kde.kdeconnect");
QDBusConnection::sessionBus().registerObject("/modules/kdeconnect", this, QDBusConnection::ExportScriptableContents);
setDiscoveryEnabled(true);
//Listen to connectivity changes
QNetworkConfigurationManager* manager = new QNetworkConfigurationManager();
QNetworkSession* network = new QNetworkSession(manager->defaultConfiguration());
connect(manager, SIGNAL(configurationAdded(QNetworkConfiguration)),
this, SLOT(forceOnNetworkChange()));
Q_FOREACH (LinkProvider* a, d->mLinkProviders) {
connect(network, SIGNAL(stateChanged(QNetworkSession::State)),
a, SLOT(onNetworkChange(QNetworkSession::State)));
}
qCDebug(KDECONNECT_CORE) << "KdeConnect daemon started";
}
void Daemon::setDiscoveryEnabled(bool b)
{
//Listen to incomming connections
Q_FOREACH (LinkProvider* a, d->mLinkProviders) {
if (b)
a->onStart();
......
/**
* Copyright 2014 Albert Vaca <albertvaka@gmail.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License or (at your option) version 3 or any later version
* accepted by the membership of KDE e.V. (or its successor approved
* by the membership of KDE e.V.), which shall act as a proxy
* defined in Section 14 of version 3 of the license.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "dbushelper.h"
#include <QRegExp>
namespace DbusHelper {
void filterNonExportableCharacters(QString& s)
{
static QRegExp regexp("[^A-Za-z0-9_]", Qt::CaseSensitive, QRegExp::Wildcard);
s.replace(regexp,"_");
}
}
\ No newline at end of file
/**
* Copyright 2014 Albert Vaca <albertvaka@gmail.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License or (at your option) version 3 or any later version
* accepted by the membership of KDE e.V. (or its successor approved
* by the membership of KDE e.V.), which shall act as a proxy
* defined in Section 14 of version 3 of the license.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef KDECONNECT_DBUSHELPER_H
#define KDECONNECT_DBUSHELPER_H
#include <QString>
namespace DbusHelper {
void filterNonExportableCharacters(QString& s);
}
#endif
\ No newline at end of file
......@@ -40,14 +40,6 @@ struct default_arg<int> {
static int get() { return -1; }
};
//Pointer types -> NULL (partial specialization)
//NOTE: Comented because it doesn't makeno sense to send a pointer over the network, but I just left it here for reference --albertvaka
/*template<class T*>
struct default_arg<T*> {
static T* get() { NULL; }
};
*/
//QByteArray-> empty qbytearray
template<>
struct default_arg<QByteArray> {
......
......@@ -71,6 +71,8 @@ Device::Device(QObject* parent, const NetworkPackage& identityPackage, DeviceLin
, m_deviceType(str2type(identityPackage.get<QString>("deviceType")))
, m_pairStatus(Device::NotPaired)
, m_protocolVersion(identityPackage.get<int>("protocolVersion"))
, m_incomingCapabilities(identityPackage.get<QStringList>("SupportedIncomingInterfaces", QStringList()).toSet())
, m_outgoingCapabilities(identityPackage.get<QStringList>("SupportedOutgoingInterfaces", QStringList()).toSet())
{
initPrivateKey();
......@@ -137,11 +139,27 @@ void Device::reloadPlugins()
incomingInterfaces = m_pluginsByIncomingInterface.keys(plugin);
outgoingInterfaces = m_pluginsByOutgoingInterface.keys(plugin);
} else {
PluginData data = loader->instantiatePluginForDevice(pluginName, this);
plugin = data.plugin;
incomingInterfaces = data.incomingInterfaces;
outgoingInterfaces = data.outgoingInterfaces;
KService::Ptr service = loader->pluginService(pluginName);
incomingInterfaces = service->property("X-KdeConnect-SupportedPackageType", QVariant::StringList).toStringList();
outgoingInterfaces = service->property("X-KdeConnect-OutgoingPackageType", QVariant::StringList).toStringList();
}
//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.intersect(outgoingInterfaces.toSet()).isEmpty()
&& m_outgoingCapabilities.intersect(incomingInterfaces.toSet()).isEmpty()
) {
delete plugin;
continue;
}
if (!plugin) {
plugin = loader->instantiatePluginForDevice(pluginName, this);
}
foreach(const QString& interface, incomingInterfaces) {
newPluginsByIncomingInterface.insert(interface, plugin);
}
......
......@@ -24,6 +24,7 @@
#include <QObject>
#include <QString>
#include <QMap>
#include <QSet>
#include <QSslKey>
#include <QTimer>
#include <QtCrypto>
......@@ -135,6 +136,8 @@ private:
QMultiMap<QString, KdeConnectPlugin*> m_pluginsByOutgoingInterface;
QTimer m_pairingTimeut;
QSet<QString> m_incomingCapabilities;
QSet<QString> m_outgoingCapabilities;
void setAsPaired();
void storeAsTrusted();
......
......@@ -190,7 +190,7 @@ void FileTransferJob::sourceFinished()
//Make sure we do not enter this function again
disconnect(mOrigin.data(), SIGNAL(aboutToClose()),this, SLOT(sourceFinished()));
//TODO: MD5 check the file
//TODO: MD5-check the file
if (mSize > -1 && mWritten != mSize) {
qCDebug(KDECONNECT_CORE) << "Received incomplete file (" << mWritten << " of " << mSize << " bytes)";
setError(1);
......
......@@ -35,7 +35,9 @@
#include <QtCrypto>
#include <QDebug>
#include "dbushelper.h"
#include "filetransferjob.h"
#include "pluginloader.h"
const QCA::EncryptionAlgorithm NetworkPackage::EncryptionAlgorithm = QCA::EME_PKCS1v15;
const int NetworkPackage::ProtocolVersion = 5;
......@@ -59,8 +61,10 @@ void NetworkPackage::createIdentityPackage(NetworkPackage* np)
np->mPayloadSize = 0;
np->set("deviceId", id);
np->set("deviceName", qgetenv("USER") + "@" + QHostInfo::localHostName());
np->set("protocolType", "desktop"); //TODO: Detect laptop, tablet, phone...
np->set("deviceType", "desktop"); //TODO: Detect laptop, tablet, phone...
np->set("protocolVersion", NetworkPackage::ProtocolVersion);
np->set("SupportedIncomingInterfaces", PluginLoader::instance()->incomingInterfaces().join(","));
np->set("SupportedOutgoingInterfaces", PluginLoader::instance()->outgoingInterfaces().join(","));
//kDebug(kdeconnect_kded()) << "createIdentityPackage" << np->serialize();
}
......@@ -151,6 +155,14 @@ bool NetworkPackage::unserialize(const QByteArray& a, NetworkPackage* np)
}
np->mPayloadTransferInfo = variant["payloadTransferInfo"].toMap(); //Will return an empty qvariantmap if was not present, which is ok
//Ids containing characters that are not allowed as dbus paths would make app crash
if (np->mBody.contains("deviceId"))
{
QString deviceId = np->get<QString>("deviceId");
DbusHelper::filterNonExportableCharacters(deviceId);
np->set("deviceId", deviceId);
}
return true;
}
......
......@@ -93,7 +93,7 @@ private:
QString mId;
QString mType;
QVariantMap mBody;
QSharedPointer<QIODevice> mPayload;
int mPayloadSize;
QVariantMap mPayloadTransferInfo;
......
......@@ -57,9 +57,9 @@ KPluginInfo PluginLoader::getPluginInfo(const QString& name) const
return KPluginInfo(service);
}
PluginData PluginLoader::instantiatePluginForDevice(const QString& name, Device* device) const
KdeConnectPlugin* PluginLoader::instantiatePluginForDevice(const QString& name, Device* device) const
{
PluginData ret;
KdeConnectPlugin* ret = 0;
KService::Ptr service = plugins[name];
if (!service) {
......@@ -73,14 +73,12 @@ PluginData PluginLoader::instantiatePluginForDevice(const QString& name, Device*
return ret;
}
ret.incomingInterfaces = service->property("X-KdeConnect-SupportedPackageType", QVariant::StringList).toStringList();
ret.outgoingInterfaces = service->property("X-KdeConnect-OutgoingPackageType", QVariant::StringList).toStringList();
QStringList outgoingInterfaces = service->property("X-KdeConnect-OutgoingPackageType", QVariant::StringList).toStringList();
QVariant deviceVariant = QVariant::fromValue<Device*>(device);
//FIXME any reason to use QObject in template param instead KdeConnectPlugin?
ret.plugin = factory->create<KdeConnectPlugin>(device, QVariantList() << deviceVariant << ret.outgoingInterfaces);
if (!ret.plugin) {
ret = factory->create<KdeConnectPlugin>(device, QVariantList() << deviceVariant << outgoingInterfaces);
if (!ret) {
qCDebug(KDECONNECT_CORE) << "Error loading plugin";
return ret;
}
......@@ -89,3 +87,25 @@ PluginData PluginLoader::instantiatePluginForDevice(const QString& name, Device*
return ret;
}
KService::Ptr PluginLoader::pluginService(const QString& pluginName) const
{
return plugins[pluginName];
}
QStringList PluginLoader::incomingInterfaces() const
{
QSet<QString> ret;
foreach(const KService::Ptr& service, plugins) {
ret += service->property("X-KdeConnect-SupportedPackageType", QVariant::StringList).toStringList().toSet();
}
return ret.toList();
}
QStringList PluginLoader::outgoingInterfaces() const
{
QSet<QString> ret;
foreach(const KService::Ptr& service, plugins) {
ret += service->property("X-KdeConnect-OutgoingPackageType", QVariant::StringList).toStringList().toSet();
}
return ret.toList();
}
......@@ -32,23 +32,18 @@
class Device;
class KdeConnectPlugin;
struct PluginData
{
PluginData() : plugin(0) {}
KdeConnectPlugin* plugin;
QStringList incomingInterfaces;
QStringList outgoingInterfaces;
};
class PluginLoader
{
public:
static PluginLoader* instance();
QStringList incomingInterfaces() const;
QStringList outgoingInterfaces() const;
QStringList getPluginList() const;
KPluginInfo getPluginInfo(const QString& name) const;
PluginData instantiatePluginForDevice(const QString& name, Device* device) const;
KService::Ptr pluginService(const QString& pluginName) const;
KdeConnectPlugin* instantiatePluginForDevice(const QString& name, Device* device) const;
private:
PluginLoader();
......
......@@ -4,7 +4,10 @@ Name=Send file via KDE Connect service
Name[ca]=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[es]=Enviar archivo usando el servicio KDE Connect
Name[fi]=Lähetä tiedosto KDE-Connect-palvelulla
Name[fr]=Envoyer un fichier via le service KDE Connect
Name[hu]=Fájl küldése a KDE csatlakozás szolgáltatáson keresztül
Name[nl]=Bestand via de service KDE Connect versturen
Name[pl]=Wyślij plik przez usługę KDE Connect
......@@ -19,7 +22,10 @@ X-KDE-Submenu=Connect
X-KDE-Submenu[ca]=Connecta
X-KDE-Submenu[cs]=Připojit
X-KDE-Submenu[da]=Forbind
X-KDE-Submenu[de]=Verbinden
X-KDE-Submenu[es]=Conectar
X-KDE-Submenu[fi]=Yhdistä
X-KDE-Submenu[fr]=Connecter
X-KDE-Submenu[hu]=Csatlakozás
X-KDE-Submenu[nl]=Verbinden
X-KDE-Submenu[pl]=Połącz
......
......@@ -69,9 +69,10 @@ add_dependencies(kdeconnectinterfaces
)
target_link_libraries(kdeconnectinterfaces
Qt5::Core
Qt5::DBus
LINK_PUBLIC
Qt5::Gui
Qt5::DBus
LINK_PRIVATE
KF5::ConfigCore
)
......
......@@ -33,7 +33,7 @@ public:
virtual bool lessThan(const QModelIndex& left, const QModelIndex& right) const;
virtual bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const;
public slots:
public Q_SLOTS:
void sourceDataChanged(QModelIndex,QModelIndex);
};
......
......@@ -74,7 +74,8 @@ KdeConnectKcm::KdeConnectKcm(QWidget *parent, const QVariantList&)
this, SLOT(unpair()));
connect(kcmUi->ping_button, SIGNAL(pressed()),
this, SLOT(sendPing()));
connect(kcmUi->refresh_button,SIGNAL(pressed()),
this, SLOT(refresh()));
}
KdeConnectKcm::~KdeConnectKcm()
......@@ -82,6 +83,12 @@ KdeConnectKcm::~KdeConnectKcm()