Merge branch '1.x'
# Conflicts: # app/org.kde.kdeconnect.app.desktop # plugins/kdeconnect.notifyrc # plugins/remotecommands/kdeconnect_remotecommands.json # plugins/sendnotifications/kdeconnect_sendnotifications_config.desktop
This commit is contained in:
commit
7e63a90da6
4 changed files with 3 additions and 33 deletions
|
@ -10,7 +10,7 @@ cmake_minimum_required(VERSION 2.8.12)
|
||||||
find_package(ECM 0.0.9 REQUIRED NO_MODULE)
|
find_package(ECM 0.0.9 REQUIRED NO_MODULE)
|
||||||
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${CMAKE_SOURCE_DIR}/cmake)
|
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${CMAKE_SOURCE_DIR}/cmake)
|
||||||
|
|
||||||
find_package(Qt5 5.2 REQUIRED COMPONENTS Quick Gui)
|
find_package(Qt5 5.2 REQUIRED COMPONENTS Quick)
|
||||||
find_package(KF5 REQUIRED COMPONENTS I18n ConfigWidgets DBusAddons)
|
find_package(KF5 REQUIRED COMPONENTS I18n ConfigWidgets DBusAddons)
|
||||||
find_package(KF5DocTools)
|
find_package(KF5DocTools)
|
||||||
find_package(Qca-qt5 2.1.0 REQUIRED)
|
find_package(Qca-qt5 2.1.0 REQUIRED)
|
||||||
|
|
|
@ -62,10 +62,10 @@ void LanPairingHandler::packageReceived(const NetworkPackage& np)
|
||||||
|
|
||||||
qCDebug(KDECONNECT_CORE) << "Unpair request";
|
qCDebug(KDECONNECT_CORE) << "Unpair request";
|
||||||
|
|
||||||
setInternalPairStatus(NotPaired);
|
|
||||||
if (isPairRequested()) {
|
if (isPairRequested()) {
|
||||||
Q_EMIT pairingError(i18n("Canceled by other peer"));
|
Q_EMIT pairingError(i18n("Canceled by other peer"));
|
||||||
}
|
}
|
||||||
|
setInternalPairStatus(NotPaired);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,4 +16,4 @@ qt5_add_dbus_interface(
|
||||||
|
|
||||||
kdeconnect_add_plugin(kdeconnect_mpriscontrol JSON kdeconnect_mpriscontrol.json SOURCES ${kdeconnect_mpriscontrol_SRCS})
|
kdeconnect_add_plugin(kdeconnect_mpriscontrol JSON kdeconnect_mpriscontrol.json SOURCES ${kdeconnect_mpriscontrol_SRCS})
|
||||||
|
|
||||||
target_link_libraries(kdeconnect_mpriscontrol Qt5::DBus kdeconnectcore Qt5::Gui)
|
target_link_libraries(kdeconnect_mpriscontrol Qt5::DBus kdeconnectcore)
|
||||||
|
|
|
@ -28,10 +28,6 @@
|
||||||
#include <QDBusMessage>
|
#include <QDBusMessage>
|
||||||
#include <QDBusServiceWatcher>
|
#include <QDBusServiceWatcher>
|
||||||
|
|
||||||
#include <QImage>
|
|
||||||
#include <QBuffer>
|
|
||||||
#include <QByteArray>
|
|
||||||
|
|
||||||
#include <KPluginFactory>
|
#include <KPluginFactory>
|
||||||
|
|
||||||
#include <core/device.h>
|
#include <core/device.h>
|
||||||
|
@ -142,32 +138,6 @@ void MprisControlPlugin::propertiesChanged(const QString& propertyInterface, con
|
||||||
}
|
}
|
||||||
somethingToSend = true;
|
somethingToSend = true;
|
||||||
}
|
}
|
||||||
if (nowPlayingMap.contains(QStringLiteral("mpris:artUrl"))) {
|
|
||||||
const QUrl artUrl(nowPlayingMap[QStringLiteral("mpris:artUrl")].toString());
|
|
||||||
|
|
||||||
/*
|
|
||||||
* We only handle images stored locally right now but it should be easy
|
|
||||||
* enough to download remote images and send them.
|
|
||||||
*/
|
|
||||||
const int artMaxWidth = 512;
|
|
||||||
const int artMaxHeight = 512;
|
|
||||||
if (artUrl.isLocalFile()) {
|
|
||||||
QImage artImage(artUrl.path());
|
|
||||||
|
|
||||||
// Scale the image to a sane size
|
|
||||||
artImage = artImage.scaled({artMaxWidth, artMaxHeight}, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
|
||||||
|
|
||||||
QByteArray imageBufferArray;
|
|
||||||
QBuffer imageBuffer(&imageBufferArray);
|
|
||||||
imageBuffer.open(QIODevice::WriteOnly);
|
|
||||||
artImage.save(&imageBuffer, "PNG");
|
|
||||||
|
|
||||||
const QString base64Image = QString::fromLatin1(imageBufferArray.toBase64());
|
|
||||||
np.set(QStringLiteral("artImage"), base64Image);
|
|
||||||
somethingToSend = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
if (properties.contains(QStringLiteral("PlaybackStatus"))) {
|
if (properties.contains(QStringLiteral("PlaybackStatus"))) {
|
||||||
|
|
Loading…
Reference in a new issue