[SCM] kdeconnect packaging branch, master, updated. debian/0.9g-1-1183-g9d69498
Maximiliano Curia
maxy at moszumanska.debian.org
Fri Oct 14 14:28:06 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/kdeconnect.git;a=commitdiff;h=a58fab4
The following commit has been merged in the master branch:
commit a58fab4fb3b479a27e9228a6047753a2c0e63162
Merge: 728dab0353746ff4b609e2538dd9870e7c8cfe00 4478db8dce0eb3212a8f98f41bec35998324b7c8
Author: Albert Vaca <albertvaka at gmail.com>
Date: Tue Nov 11 21:40:54 2014 -0800
Merge branch 'master' into frameworks
Conflicts:
cli/kdeconnect-cli.cpp
core/device.cpp
core/filetransferjob.cpp
core/filetransferjob.h
core/networkpackage.h
kded/CMakeLists.txt
plugins/share/shareplugin.cpp
plugins/telephony/telephonyplugin.cpp
cli/kdeconnect-cli.cpp | 26 ++++++------
core/backends/lan/uploadjob.cpp | 20 ++++++---
core/device.cpp | 2 +-
core/filetransferjob.cpp | 2 +-
core/filetransferjob.h | 6 +--
core/networkpackage.h | 8 ++--
kded/CMakeLists.txt | 3 --
plugins/CMakeLists.txt | 2 +
{kded => plugins}/kdeconnect.notifyrc | 76 +++++++++++++----------------------
plugins/share/shareplugin.cpp | 2 +-
plugins/telephony/telephonyplugin.cpp | 2 +-
11 files changed, 69 insertions(+), 80 deletions(-)
diff --cc cli/kdeconnect-cli.cpp
index 8d6d698,b5336aa..14bd078
--- a/cli/kdeconnect-cli.cpp
+++ b/cli/kdeconnect-cli.cpp
@@@ -21,37 -21,37 +21,39 @@@
#include <interfaces/devicesmodel.h>
#include <interfaces/notificationsmodel.h>
#include <interfaces/dbusinterfaces.h>
- #include <iostream>
#include <QDBusMessage>
#include <QDBusConnection>
+#include <QGuiApplication>
+#include <KAboutData>
+#include <KLocalizedString>
+ #include <QTextStream>
int main(int argc, char** argv)
{
- KAboutData about("kdeconnect-cli", "kdeconnect-cli", ki18n(("kdeconnect-cli")), "1.0", ki18n("KDE Connect CLI tool"),
- KAboutData::License_GPL, ki18n("(C) 2013 Aleix Pol Gonzalez"));
- about.addAuthor( ki18n("Aleix Pol Gonzalez"), KLocalizedString(), "aleixpol at kde.org" );
- about.addAuthor( ki18n("Albert Vaca Cintora"), KLocalizedString(), "albertvaka at gmail.com" );
- KCmdLineArgs::init(argc, argv, &about);
- KCmdLineOptions options;
- options.add("l")
- .add("list-devices", ki18n("List all devices."));
- options.add("refresh", ki18n("Search for devices in the network and re-establish connections."));
- options.add("pair", ki18n("Request pairing to a said device."));
- options.add("unpair", ki18n("Stop pairing to a said device."));
- options.add("ping", ki18n("Send a ping to said device."));
- options.add("ping-msg <message>", ki18n("Same as ping but you can customize the message shown."));
- options.add("share <path>", ki18n("Share a file to a said device."));
- options.add("list-notifications", ki18n("Display the notifications on a said device."));
- options.add("d")
- .add("device <dev>", ki18n("Device ID."));
- KCmdLineArgs::addCmdLineOptions( options );
- KCmdLineArgs* args = KCmdLineArgs::parsedArgs();
- KApplication app;
- if(args->isSet("l")) {
+ QGuiApplication app(argc, argv);
+ KAboutData about("kdeconnect-cli", i18n("kdeconnect-cli"), "1.0", i18n("KDE Connect CLI tool"),
+ KAboutLicense::GPL, i18n("(C) 2013 Aleix Pol Gonzalez"));
+ KAboutData::setApplicationData(about);
+
+ about.addAuthor( i18n("Aleix Pol Gonzalez"), QString(), "aleixpol at kde.org" );
++ about.addAuthor( i18n("Albert Vaca Cintora"), QString(), "albertvaka at gmail.com" );
+ QCommandLineParser parser;
+ parser.addOption(QCommandLineOption(QStringList("l") << "list-devices", i18n("List all devices")));
- parser.addOption(QCommandLineOption("share", i18n("Share a file to a said device"), "path"));
++ parser.addOption(QCommandLineOption("refresh", i18n("Search for devices in the network and re-establishe connections")));
+ parser.addOption(QCommandLineOption("pair", i18n("Request pairing to a said device")));
+ 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")));
++ parser.addOption(QCommandLineOption("share", i18n("Share a file to a said device"), "path"));
+ 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"));
++ parser.addOption(QCommandLineOption(QstringList("device") << "d", i18n("Device ID"), "dev"));
+ about.setupCommandLine(&parser);
+
+ parser.addHelpOption();
+ parser.process(app);
+ about.processCommandLine(&parser);
+
+ if(parser.isSet("l")) {
DevicesModel devices;
for(int i=0, rows=devices.rowCount(); i<rows; ++i) {
QModelIndex idx = devices.index(i);
@@@ -89,19 -89,19 +91,19 @@@
msg.setArguments(QVariantList() << url.toString());
QDBusConnection::sessionBus().call(msg);
} else
- KCmdLineArgs::usageError(i18n("Couldn't share %1", url.toString()));
- } else if(args->isSet("pair")) {
+ qCritical() << (i18n("Couldn't share %1", url.toString()));
+ } else if(parser.isSet("pair")) {
DeviceDbusInterface dev(device);
if(dev.isPaired())
- std::cout << "Already paired" << std::endl;
+ QTextStream(stdout) << "Already paired" << endl;
else {
QDBusPendingReply<void> req = dev.requestPair();
req.waitForFinished();
}
- } else if(args->isSet("unpair")) {
+ } else if(parser.isSet("unpair")) {
DeviceDbusInterface dev(device);
if(!dev.isPaired())
- std::cout << "Already not paired" << std::endl;
+ QTextStream(stdout) << "Already not paired" << endl;
else {
QDBusPendingReply<void> req = dev.unpair();
req.waitForFinished();
@@@ -118,11 -118,11 +120,11 @@@
notifications.setDeviceId(device);
for(int i=0, rows=notifications.rowCount(); i<rows; ++i) {
QModelIndex idx = notifications.index(i);
- std::cout << "- " << idx.data(NotificationsModel::AppNameModelRole).toString().toStdString()
- << ": " << idx.data(NotificationsModel::NameModelRole).toString().toStdString() << std::endl;
+ QTextStream(stdout) << "- " << idx.data(NotificationsModel::AppNameModelRole).toString()
+ << ": " << idx.data(NotificationsModel::NameModelRole).toString() << endl;
}
} else {
- KCmdLineArgs::usageError(i18n("Nothing to be done with the device"));
+ qCritical() << i18n("Nothing to be done with the device");
}
}
QMetaObject::invokeMethod(&app, "quit", Qt::QueuedConnection);
diff --cc core/device.cpp
index 0a5c94c,c404318..6014478
--- a/core/device.cpp
+++ b/core/device.cpp
@@@ -374,11 -367,11 +374,11 @@@ void Device::privateReceivedPackage(con
} else {
- kDebug(debugArea()) << "Pair request";
+ qCDebug(KDECONNECT_CORE) << "Pair request";
- KNotification* notification = new KNotification("pingReceived"); //KNotification::Persistent
+ KNotification* notification = new KNotification("pairingRequest");
- notification->setPixmap(KIcon("dialog-information").pixmap(48, 48));
- notification->setComponentData(KComponentData("kdeconnect", "kdeconnect"));
+ notification->setPixmap(QIcon::fromTheme("dialog-information").pixmap(48, 48));
+ notification->setComponentName("kdeconnect");
notification->setTitle("KDE Connect");
notification->setText(i18n("Pairing request from %1", m_deviceName));
notification->setActions(QStringList() << i18n("Accept") << i18n("Reject"));
diff --cc core/filetransferjob.cpp
index 7e0b2a8,2dad5de..8accfa6
--- a/core/filetransferjob.cpp
+++ b/core/filetransferjob.cpp
@@@ -28,7 -26,9 +28,7 @@@
#include <KIO/RenameDialog>
#include <KLocalizedString>
- FileTransferJob::FileTransferJob(const QSharedPointer<QIODevice>& origin, int size, const QUrl &destination): KJob()
-#include "kdebugnamespace.h"
-
-FileTransferJob::FileTransferJob(const QSharedPointer<QIODevice>& origin, qint64 size, const KUrl& destination): KJob()
++FileTransferJob::FileTransferJob(const QSharedPointer<QIODevice>& origin, qint64 size, const QUrl &destination): KJob()
{
Q_ASSERT(destination.isLocalFile());
//TODO: Make a precondition before calling this function that destination file exists
diff --cc core/filetransferjob.h
index c0bff7a,b022210..e55359a
--- a/core/filetransferjob.h
+++ b/core/filetransferjob.h
@@@ -37,9 -37,9 +37,9 @@@ class FileTransferJo
Q_OBJECT
public:
- FileTransferJob(const QSharedPointer<QIODevice>& origin, int size, const QUrl &destination);
- FileTransferJob(const QSharedPointer<QIODevice>& origin, qint64 size, const KUrl& destination);
++ FileTransferJob(const QSharedPointer<QIODevice>& origin, qint64 size, const QUrl &destination);
virtual void start();
- KUrl destination() const { return mDestination; }
+ QUrl destination() const { return mDestination; }
void setDeviceName(const QString &deviceName) {mDeviceName = deviceName;};
public Q_SLOTS:
@@@ -58,11 -58,11 +58,11 @@@ private
QSharedPointer<QIODevice> mOrigin;
KIO::FileJob* mDestinationJob;
QString mDeviceName;
- KUrl mDestination;
+ QUrl mDestination;
QTime m_time;
qulonglong m_speedBytes;
- int mSize;
- int mWritten;
+ qint64 mSize;
+ qint64 mWritten;
};
diff --cc core/networkpackage.h
index cb8b4a8,5f1cfe8..83aa8b4
--- a/core/networkpackage.h
+++ b/core/networkpackage.h
@@@ -73,10 -75,10 +73,10 @@@ public
bool has(const QString& key) const { return mBody.contains(key); }
QSharedPointer<QIODevice> payload() const { return mPayload; }
- void setPayload(const QSharedPointer<QIODevice>& device, int payloadSize) { mPayload = device; mPayloadSize = payloadSize; Q_ASSERT(mPayloadSize >= -1); }
+ void setPayload(const QSharedPointer<QIODevice>& device, qint64 payloadSize) { mPayload = device; mPayloadSize = payloadSize; Q_ASSERT(mPayloadSize >= -1); }
bool hasPayload() const { return (mPayloadSize != 0); }
- int payloadSize() const { return mPayloadSize; } //-1 means it is an endless stream
+ qint64 payloadSize() const { return mPayloadSize; } //-1 means it is an endless stream
- FileTransferJob* createPayloadTransferJob(const KUrl& destination) const;
+ FileTransferJob* createPayloadTransferJob(const QUrl &destination) const;
//To be called by a particular DeviceLink
QVariantMap payloadTransferInfo() const { return mPayloadTransferInfo; }
diff --cc kded/CMakeLists.txt
index 8c873f5,d429dce..764efd3
--- a/kded/CMakeLists.txt
+++ b/kded/CMakeLists.txt
@@@ -13,6 -10,5 +13,3 @@@ target_link_libraries(kded_kdeconnect K
install(TARGETS kdeconnectd DESTINATION ${LIBEXEC_INSTALL_DIR})
install(TARGETS kded_kdeconnect DESTINATION ${PLUGIN_INSTALL_DIR})
install(FILES kdeconnect.desktop DESTINATION ${SERVICES_INSTALL_DIR}/kded)
--
- #TODO: Split this into several files for core and for each plugin
- install(FILES kdeconnect.notifyrc DESTINATION ${KNOTIFYRC_INSTALL_DIR})
-
diff --cc plugins/CMakeLists.txt
index 058834a,de1131d..9004c0a
--- a/plugins/CMakeLists.txt
+++ b/plugins/CMakeLists.txt
@@@ -13,3 -12,5 +13,5 @@@ add_subdirectory(share
add_subdirectory(notifications)
add_subdirectory(sftp)
+ #FIXME: If we split notifications in several files, they won't appear in the same group in the Notifications KCM
-install(FILES kdeconnect.notifyrc DESTINATION ${DATA_INSTALL_DIR}/kdeconnect)
++install(FILES kdeconnect.notifyrc DESTINATION ${KNOTIFYRC_INSTALL_DIR})
diff --cc plugins/share/shareplugin.cpp
index 906bf1b,2c7c815..b7ecec0
--- a/plugins/share/shareplugin.cpp
+++ b/plugins/share/shareplugin.cpp
@@@ -139,9 -129,9 +139,9 @@@ void SharePlugin::finished(KJob* job
bool error = (job->error() != 0);
FileTransferJob* transferJob = (FileTransferJob*)job;
- KNotification* notification = new KNotification("pingReceived"); //KNotification::Persistent
+ KNotification* notification = new KNotification("transferReceived");
- notification->setPixmap(KIcon(error? "edit-delete" : "dialog-ok").pixmap(48, 48));
- notification->setComponentData(KComponentData("kdeconnect", "kdeconnect-kded"));
+ notification->setPixmap(QIcon::fromTheme(error? "edit-delete" : "dialog-ok").pixmap(48, 48));
+ notification->setComponentName("kdeconnect");
notification->setTitle(i18n("Transfer finished"));
notification->setText(transferJob->destination().fileName());
notification->setActions(QStringList(i18n("Open destination folder")));
diff --cc plugins/telephony/telephonyplugin.cpp
index 6ab63f0,4e1c0a1..bea8c08
--- a/plugins/telephony/telephonyplugin.cpp
+++ b/plugins/telephony/telephonyplugin.cpp
@@@ -65,12 -60,12 +65,12 @@@ KNotification* TelephonyPlugin::createN
} else if (event == "talking") {
return NULL;
} else {
-#ifdef NDEBUG
+#ifndef NDEBUG
return NULL;
#else
- type = "unknownEvent";
+ type = "callReceived";
- icon = "pda";
- content = i18n("Unknown telephony event: %2", event);
+ icon = "phone";
+ content = i18n("Unknown telephony event: %1", event);
#endif
}
--
kdeconnect packaging
More information about the pkg-kde-commits
mailing list