kdeconnect_add_plugin: Autogenerate logging category
This is far less code and allows for an easier enforcing of standards, for example the name of the log identifiers which were adjusted in a few cases. Also clean up unused includes when noticed.
This commit is contained in:
parent
7feb3bdd0d
commit
ed1e24d231
45 changed files with 62 additions and 239 deletions
|
@ -1,9 +1,17 @@
|
||||||
# SPDX-FileCopyrightText: 2015 Aleix Pol Gonzalez <aleixpol@kde.org>
|
# SPDX-FileCopyrightText: 2015 Aleix Pol Gonzalez <aleixpol@kde.org>
|
||||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||||
|
|
||||||
|
# Function to create the plugin and generate a logging category for it
|
||||||
|
function(kdeconnect_add_plugin plugin_name)
|
||||||
|
kcoreaddons_add_plugin(${plugin_name} ${ARGN} INSTALL_NAMESPACE kdeconnect)
|
||||||
|
|
||||||
function(kdeconnect_add_plugin)
|
string(REPLACE "kdeconnect_" "" PlUGIN_WITHOUT_PREFIX "${plugin_name}") # For the file name and description, we don't want this
|
||||||
kcoreaddons_add_plugin(${ARGN} INSTALL_NAMESPACE kdeconnect)
|
string(TOUPPER "${PlUGIN_WITHOUT_PREFIX}" PLUGIN_UPPER) # The identifier is all capy
|
||||||
|
ecm_qt_declare_logging_category(${plugin_name}
|
||||||
|
HEADER plugin_${PlUGIN_WITHOUT_PREFIX}_debug.h
|
||||||
|
IDENTIFIER KDECONNECT_PLUGIN_${PLUGIN_UPPER} CATEGORY_NAME kdeconnect.plugin.${PlUGIN_WITHOUT_PREFIX}
|
||||||
|
DEFAULT_SEVERITY Warning
|
||||||
|
EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin ${PlUGIN_WITHOUT_PREFIX})")
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
function(kdeconnect_add_kcm plugin)
|
function(kdeconnect_add_kcm plugin)
|
||||||
|
|
|
@ -1,10 +1,4 @@
|
||||||
kdeconnect_add_plugin(kdeconnect_battery SOURCES batteryplugin.cpp)
|
kdeconnect_add_plugin(kdeconnect_battery SOURCES batteryplugin.cpp)
|
||||||
|
|
||||||
ecm_qt_declare_logging_category(kdeconnect_battery
|
|
||||||
HEADER plugin_battery_debug.h
|
|
||||||
IDENTIFIER KDECONNECT_PLUGIN_BATTERY CATEGORY_NAME kdeconnect.plugin.battery
|
|
||||||
DEFAULT_SEVERITY Warning
|
|
||||||
EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin battery)")
|
|
||||||
target_link_libraries(kdeconnect_battery
|
target_link_libraries(kdeconnect_battery
|
||||||
kdeconnectcore
|
kdeconnectcore
|
||||||
Qt::DBus
|
Qt::DBus
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
kdeconnect_add_plugin(kdeconnect_bigscreen SOURCES bigscreenplugin.cpp)
|
kdeconnect_add_plugin(kdeconnect_bigscreen SOURCES bigscreenplugin.cpp)
|
||||||
|
|
||||||
target_link_libraries(kdeconnect_bigscreen
|
target_link_libraries(kdeconnect_bigscreen
|
||||||
kdeconnectcore
|
kdeconnectcore
|
||||||
kdeconnectinterfaces
|
kdeconnectinterfaces
|
||||||
|
|
|
@ -18,8 +18,6 @@
|
||||||
|
|
||||||
K_PLUGIN_CLASS_WITH_JSON(BigscreenPlugin, "kdeconnect_bigscreen.json")
|
K_PLUGIN_CLASS_WITH_JSON(BigscreenPlugin, "kdeconnect_bigscreen.json")
|
||||||
|
|
||||||
Q_LOGGING_CATEGORY(KDECONNECT_PLUGIN_BIGSCREEN, "kdeconnect.plugin.bigscreen")
|
|
||||||
|
|
||||||
void BigscreenPlugin::receivePacket(const NetworkPacket &np)
|
void BigscreenPlugin::receivePacket(const NetworkPacket &np)
|
||||||
{
|
{
|
||||||
QString message = np.get<QString>(QStringLiteral("content"));
|
QString message = np.get<QString>(QStringLiteral("content"));
|
||||||
|
|
|
@ -1,11 +1,5 @@
|
||||||
kdeconnect_add_plugin(kdeconnect_clipboard SOURCES clipboardplugin.cpp clipboardlistener.cpp)
|
kdeconnect_add_plugin(kdeconnect_clipboard SOURCES clipboardplugin.cpp clipboardlistener.cpp)
|
||||||
|
|
||||||
ecm_qt_declare_logging_category(kdeconnect_clipboard
|
|
||||||
HEADER plugin_clipboard_debug.h
|
|
||||||
IDENTIFIER KDECONNECT_PLUGIN_CLIPBOARD CATEGORY_NAME kdeconnect.plugin.clipboard
|
|
||||||
DEFAULT_SEVERITY Warning
|
|
||||||
EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin clipboard)")
|
|
||||||
|
|
||||||
target_link_libraries(kdeconnect_clipboard kdeconnectcore
|
target_link_libraries(kdeconnect_clipboard kdeconnectcore
|
||||||
Qt::DBus
|
Qt::DBus
|
||||||
KF${QT_MAJOR_VERSION}::GuiAddons
|
KF${QT_MAJOR_VERSION}::GuiAddons
|
||||||
|
|
|
@ -1,10 +1,4 @@
|
||||||
kdeconnect_add_plugin(kdeconnect_connectivity_report SOURCES connectivity_reportplugin.cpp)
|
kdeconnect_add_plugin(kdeconnect_connectivity_report SOURCES connectivity_reportplugin.cpp)
|
||||||
ecm_qt_declare_logging_category(kdeconnect_connectivity_report
|
|
||||||
HEADER plugin_connectivity_report_debug.h
|
|
||||||
IDENTIFIER KDECONNECT_PLUGIN_CONNECTIVITY_REPORT CATEGORY_NAME kdeconnect.plugin.connectivity_report
|
|
||||||
DEFAULT_SEVERITY Warning
|
|
||||||
EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin connectivity_report)")
|
|
||||||
|
|
||||||
target_link_libraries(kdeconnect_connectivity_report
|
target_link_libraries(kdeconnect_connectivity_report
|
||||||
kdeconnectcore
|
kdeconnectcore
|
||||||
Qt::DBus
|
Qt::DBus
|
||||||
|
|
|
@ -1,10 +1,4 @@
|
||||||
kdeconnect_add_plugin(kdeconnect_contacts SOURCES contactsplugin.cpp)
|
kdeconnect_add_plugin(kdeconnect_contacts SOURCES contactsplugin.cpp)
|
||||||
ecm_qt_declare_logging_category(kdeconnect_contacts
|
|
||||||
HEADER plugin_contacts_debug.h
|
|
||||||
IDENTIFIER KDECONNECT_PLUGIN_CONTACTS CATEGORY_NAME kdeconnect.plugin.contacts
|
|
||||||
DEFAULT_SEVERITY Warning
|
|
||||||
EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin contacts)")
|
|
||||||
|
|
||||||
target_link_libraries(kdeconnect_contacts
|
target_link_libraries(kdeconnect_contacts
|
||||||
kdeconnectcore
|
kdeconnectcore
|
||||||
Qt::DBus
|
Qt::DBus
|
||||||
|
|
|
@ -1,9 +1,3 @@
|
||||||
set(kdeconnect_findmyphone_SRCS
|
kdeconnect_add_plugin(kdeconnect_findmyphone SOURCES findmyphoneplugin.cpp)
|
||||||
findmyphoneplugin.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
kdeconnect_add_plugin(kdeconnect_findmyphone SOURCES ${kdeconnect_findmyphone_SRCS})
|
|
||||||
|
|
||||||
target_link_libraries(kdeconnect_findmyphone kdeconnectcore Qt::Core Qt::DBus)
|
target_link_libraries(kdeconnect_findmyphone kdeconnectcore Qt::Core Qt::DBus)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,5 @@
|
||||||
kdeconnect_add_plugin(kdeconnect_findthisdevice SOURCES findthisdeviceplugin.cpp)
|
kdeconnect_add_plugin(kdeconnect_findthisdevice SOURCES findthisdeviceplugin.cpp)
|
||||||
|
|
||||||
ecm_qt_declare_logging_category(kdeconnect_findthisdevice
|
|
||||||
HEADER plugin_findthisdevice_debug.h
|
|
||||||
IDENTIFIER KDECONNECT_PLUGIN_FINDTHISDEVICE CATEGORY_NAME kdeconnect.plugin.findthisdevice
|
|
||||||
DEFAULT_SEVERITY Warning
|
|
||||||
EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin findthisdevice)")
|
|
||||||
|
|
||||||
target_link_libraries(kdeconnect_findthisdevice
|
target_link_libraries(kdeconnect_findthisdevice
|
||||||
kdeconnectcore
|
kdeconnectcore
|
||||||
Qt::Core
|
Qt::Core
|
||||||
|
|
|
@ -1,17 +1,10 @@
|
||||||
|
kdeconnect_add_plugin(kdeconnect_lockdevice)
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
list(APPEND lockdevice_SRCS lockdeviceplugin-win.cpp)
|
target_sources(kdeconnect_lockdevice PRIVATE lockdeviceplugin-win.cpp)
|
||||||
else ()
|
else ()
|
||||||
list(APPEND lockdevice_SRCS lockdeviceplugin.cpp)
|
target_sources(kdeconnect_lockdevice PRIVATE lockdeviceplugin.cpp)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
kdeconnect_add_plugin(kdeconnect_lockdevice SOURCES ${lockdevice_SRCS})
|
|
||||||
|
|
||||||
ecm_qt_declare_logging_category(kdeconnect_lockdevice
|
|
||||||
HEADER plugin_lock_debug.h
|
|
||||||
IDENTIFIER KDECONNECT_PLUGIN_LOCKREMOTE CATEGORY_NAME kdeconnect.plugin.lock
|
|
||||||
DEFAULT_SEVERITY Warning
|
|
||||||
EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin lockremote)")
|
|
||||||
|
|
||||||
target_link_libraries(kdeconnect_lockdevice
|
target_link_libraries(kdeconnect_lockdevice
|
||||||
kdeconnectcore
|
kdeconnectcore
|
||||||
kdeconnectinterfaces
|
kdeconnectinterfaces
|
||||||
|
|
|
@ -8,8 +8,6 @@
|
||||||
|
|
||||||
#include <KLocalizedString>
|
#include <KLocalizedString>
|
||||||
#include <KPluginFactory>
|
#include <KPluginFactory>
|
||||||
|
|
||||||
#include "plugin_lock_debug.h"
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
#include <core/daemon.h>
|
#include <core/daemon.h>
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
#include <KLocalizedString>
|
#include <KLocalizedString>
|
||||||
#include <KPluginFactory>
|
#include <KPluginFactory>
|
||||||
|
|
||||||
#include "plugin_lock_debug.h"
|
#include "plugin_lockdevice_debug.h"
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
#include <core/daemon.h>
|
#include <core/daemon.h>
|
||||||
|
@ -27,11 +27,11 @@ LockDevicePlugin::LockDevicePlugin(QObject *parent, const QVariantList &args)
|
||||||
, m_propertiesInterface(QStringLiteral("org.freedesktop.login1"), QString(), QDBusConnection::systemBus())
|
, m_propertiesInterface(QStringLiteral("org.freedesktop.login1"), QString(), QDBusConnection::systemBus())
|
||||||
{
|
{
|
||||||
if (!m_login1Interface.isValid()) {
|
if (!m_login1Interface.isValid()) {
|
||||||
qCWarning(KDECONNECT_PLUGIN_LOCKREMOTE) << "Could not connect to logind interface" << m_login1Interface.lastError();
|
qCWarning(KDECONNECT_PLUGIN_LOCKDEVICE) << "Could not connect to logind interface" << m_login1Interface.lastError();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_propertiesInterface.isValid()) {
|
if (!m_propertiesInterface.isValid()) {
|
||||||
qCWarning(KDECONNECT_PLUGIN_LOCKREMOTE) << "Could not connect to logind properties interface" << m_propertiesInterface.lastError();
|
qCWarning(KDECONNECT_PLUGIN_LOCKDEVICE) << "Could not connect to logind properties interface" << m_propertiesInterface.lastError();
|
||||||
}
|
}
|
||||||
|
|
||||||
connect(&m_propertiesInterface,
|
connect(&m_propertiesInterface,
|
||||||
|
|
|
@ -1,11 +1,4 @@
|
||||||
kdeconnect_add_plugin(kdeconnect_mmtelephony SOURCES mmtelephonyplugin.cpp)
|
kdeconnect_add_plugin(kdeconnect_mmtelephony SOURCES mmtelephonyplugin.cpp)
|
||||||
ecm_qt_declare_logging_category(kdeconnect_mmtelephony
|
|
||||||
HEADER plugin_mmtelephony_debug.h
|
|
||||||
IDENTIFIER KDECONNECT_PLUGIN_MMTELEPHONY CATEGORY_NAME kdeconnect.plugin.mmtelephony
|
|
||||||
DEFAULT_SEVERITY Warning
|
|
||||||
EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin mmtelephony)")
|
|
||||||
|
|
||||||
|
|
||||||
target_link_libraries(kdeconnect_mmtelephony
|
target_link_libraries(kdeconnect_mmtelephony
|
||||||
kdeconnectcore
|
kdeconnectcore
|
||||||
Qt::DBus
|
Qt::DBus
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
|
|
||||||
#include "abstractremoteinput.h"
|
#include "abstractremoteinput.h"
|
||||||
|
|
||||||
Q_LOGGING_CATEGORY(KDECONNECT_PLUGIN_MOUSEPAD, "kdeconnect.plugin.mousepad")
|
|
||||||
AbstractRemoteInput::AbstractRemoteInput(QObject *parent)
|
AbstractRemoteInput::AbstractRemoteInput(QObject *parent)
|
||||||
: QObject(parent)
|
: QObject(parent)
|
||||||
{
|
{
|
||||||
|
|
|
@ -9,10 +9,9 @@
|
||||||
#include <QLoggingCategory>
|
#include <QLoggingCategory>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
|
#include "plugin_mousepad_debug.h"
|
||||||
#include <core/networkpacket.h>
|
#include <core/networkpacket.h>
|
||||||
|
|
||||||
Q_DECLARE_LOGGING_CATEGORY(KDECONNECT_PLUGIN_MOUSEPAD)
|
|
||||||
|
|
||||||
class AbstractRemoteInput : public QObject
|
class AbstractRemoteInput : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
|
@ -10,12 +10,6 @@ endif()
|
||||||
|
|
||||||
kdeconnect_add_plugin(kdeconnect_mpriscontrol SOURCES ${kdeconnect_mpriscontrol_SRCS})
|
kdeconnect_add_plugin(kdeconnect_mpriscontrol SOURCES ${kdeconnect_mpriscontrol_SRCS})
|
||||||
|
|
||||||
ecm_qt_declare_logging_category(kdeconnect_mpriscontrol
|
|
||||||
HEADER plugin_mpris_debug.h
|
|
||||||
IDENTIFIER KDECONNECT_PLUGIN_MPRIS CATEGORY_NAME kdeconnect.plugin.mpris
|
|
||||||
DEFAULT_SEVERITY Warning
|
|
||||||
EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin mpris)")
|
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
target_link_libraries(kdeconnect_mpriscontrol kdeconnectcore windowsapp)
|
target_link_libraries(kdeconnect_mpriscontrol kdeconnectcore windowsapp)
|
||||||
else()
|
else()
|
||||||
|
|
|
@ -5,8 +5,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "mpriscontrolplugin-win.h"
|
#include "mpriscontrolplugin-win.h"
|
||||||
#include "plugin_mpris_debug.h"
|
|
||||||
|
|
||||||
|
#include "plugin_mpriscontrol_debug.h"
|
||||||
#include <core/device.h>
|
#include <core/device.h>
|
||||||
|
|
||||||
#include <KPluginFactory>
|
#include <KPluginFactory>
|
||||||
|
@ -37,7 +37,7 @@ std::optional<QString> MprisControlPlugin::getPlayerName(GlobalSystemMediaTransp
|
||||||
auto entry = std::find(this->playerList.constBegin(), this->playerList.constEnd(), player);
|
auto entry = std::find(this->playerList.constBegin(), this->playerList.constEnd(), player);
|
||||||
|
|
||||||
if (entry == this->playerList.constEnd()) {
|
if (entry == this->playerList.constEnd()) {
|
||||||
qCWarning(KDECONNECT_PLUGIN_MPRIS) << "PlaybackInfoChanged received for no longer tracked session" << player.SourceAppUserModelId().c_str();
|
qCWarning(KDECONNECT_PLUGIN_MPRISCONTROL) << "PlaybackInfoChanged received for no longer tracked session" << player.SourceAppUserModelId().c_str();
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -172,7 +172,7 @@ void MprisControlPlugin::updatePlayerList()
|
||||||
try {
|
try {
|
||||||
playerName = AppInfo::GetFromAppUserModelId(playerName).DisplayInfo().DisplayName();
|
playerName = AppInfo::GetFromAppUserModelId(playerName).DisplayInfo().DisplayName();
|
||||||
} catch (winrt::hresult_error e) {
|
} catch (winrt::hresult_error e) {
|
||||||
qCDebug(KDECONNECT_PLUGIN_MPRIS) << QString::fromWCharArray(playerName.c_str()) << "doesn\'t have a valid AppUserModelID! Sending as-is..";
|
qCDebug(KDECONNECT_PLUGIN_MPRISCONTROL) << QString::fromWCharArray(playerName.c_str()) << "doesn\'t have a valid AppUserModelID! Sending as-is..";
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
QString uniqueName = QString::fromWCharArray(playerName.c_str());
|
QString uniqueName = QString::fromWCharArray(playerName.c_str());
|
||||||
|
@ -248,7 +248,7 @@ bool MprisControlPlugin::sendAlbumArt(std::variant<NetworkPacket, QString> const
|
||||||
GlobalSystemMediaTransportControlsSession const &player,
|
GlobalSystemMediaTransportControlsSession const &player,
|
||||||
QString artUrl)
|
QString artUrl)
|
||||||
{
|
{
|
||||||
qWarning(KDECONNECT_PLUGIN_MPRIS) << "Sending Album Art";
|
qWarning(KDECONNECT_PLUGIN_MPRISCONTROL) << "Sending Album Art";
|
||||||
NetworkPacket np = packetOrName.index() == 0 ? std::get<0>(packetOrName) : NetworkPacket(PACKET_TYPE_MPRIS);
|
NetworkPacket np = packetOrName.index() == 0 ? std::get<0>(packetOrName) : NetworkPacket(PACKET_TYPE_MPRIS);
|
||||||
if (packetOrName.index() == 1)
|
if (packetOrName.index() == 1)
|
||||||
np.set(QStringLiteral("player"), std::get<1>(packetOrName));
|
np.set(QStringLiteral("player"), std::get<1>(packetOrName));
|
||||||
|
@ -320,11 +320,11 @@ void MprisControlPlugin::receivePacket(const NetworkPacket &np)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (np.has(QStringLiteral("setVolume"))) {
|
if (np.has(QStringLiteral("setVolume"))) {
|
||||||
qWarning(KDECONNECT_PLUGIN_MPRIS) << "Setting volume is not supported";
|
qWarning(KDECONNECT_PLUGIN_MPRISCONTROL) << "Setting volume is not supported";
|
||||||
}
|
}
|
||||||
if (np.has(QStringLiteral("Seek"))) {
|
if (np.has(QStringLiteral("Seek"))) {
|
||||||
TimeSpan offset = std::chrono::microseconds(np.get<int>(QStringLiteral("Seek")));
|
TimeSpan offset = std::chrono::microseconds(np.get<int>(QStringLiteral("Seek")));
|
||||||
qWarning(KDECONNECT_PLUGIN_MPRIS) << "Seeking" << offset.count() << "ns to" << name;
|
qWarning(KDECONNECT_PLUGIN_MPRISCONTROL) << "Seeking" << offset.count() << "ns to" << name;
|
||||||
player.TryChangePlaybackPositionAsync((player.GetTimelineProperties().Position() + offset).count()).get();
|
player.TryChangePlaybackPositionAsync((player.GetTimelineProperties().Position() + offset).count()).get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
#include "generated/systeminterfaces/dbusproperties.h"
|
#include "generated/systeminterfaces/dbusproperties.h"
|
||||||
#include "generated/systeminterfaces/mprisplayer.h"
|
#include "generated/systeminterfaces/mprisplayer.h"
|
||||||
#include "generated/systeminterfaces/mprisroot.h"
|
#include "generated/systeminterfaces/mprisroot.h"
|
||||||
#include "plugin_mpris_debug.h"
|
#include "plugin_mpriscontrol_debug.h"
|
||||||
|
|
||||||
K_PLUGIN_CLASS_WITH_JSON(MprisControlPlugin, "kdeconnect_mpriscontrol.json")
|
K_PLUGIN_CLASS_WITH_JSON(MprisControlPlugin, "kdeconnect_mpriscontrol.json")
|
||||||
|
|
||||||
|
@ -61,12 +61,12 @@ void MprisControlPlugin::serviceOwnerChanged(const QString &serviceName, const Q
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!oldOwner.isEmpty()) {
|
if (!oldOwner.isEmpty()) {
|
||||||
qCDebug(KDECONNECT_PLUGIN_MPRIS) << "MPRIS service" << serviceName << "just went offline";
|
qCDebug(KDECONNECT_PLUGIN_MPRISCONTROL) << "MPRIS service" << serviceName << "just went offline";
|
||||||
removePlayer(serviceName);
|
removePlayer(serviceName);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!newOwner.isEmpty()) {
|
if (!newOwner.isEmpty()) {
|
||||||
qCDebug(KDECONNECT_PLUGIN_MPRIS) << "MPRIS service" << serviceName << "just came online";
|
qCDebug(KDECONNECT_PLUGIN_MPRISCONTROL) << "MPRIS service" << serviceName << "just came online";
|
||||||
addPlayer(serviceName);
|
addPlayer(serviceName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -94,7 +94,7 @@ void MprisControlPlugin::addPlayer(const QString &service)
|
||||||
connect(player.propertiesInterface(), &OrgFreedesktopDBusPropertiesInterface::PropertiesChanged, this, &MprisControlPlugin::propertiesChanged);
|
connect(player.propertiesInterface(), &OrgFreedesktopDBusPropertiesInterface::PropertiesChanged, this, &MprisControlPlugin::propertiesChanged);
|
||||||
connect(player.mediaPlayer2PlayerInterface(), &OrgMprisMediaPlayer2PlayerInterface::Seeked, this, &MprisControlPlugin::seeked);
|
connect(player.mediaPlayer2PlayerInterface(), &OrgMprisMediaPlayer2PlayerInterface::Seeked, this, &MprisControlPlugin::seeked);
|
||||||
|
|
||||||
qCDebug(KDECONNECT_PLUGIN_MPRIS) << "Mpris addPlayer" << service << "->" << uniqueName;
|
qCDebug(KDECONNECT_PLUGIN_MPRISCONTROL) << "Mpris addPlayer" << service << "->" << uniqueName;
|
||||||
sendPlayerList();
|
sendPlayerList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ void MprisControlPlugin::seeked(qlonglong position)
|
||||||
return (player.mediaPlayer2PlayerInterface() == mediaPlayer2PlayerInterface);
|
return (player.mediaPlayer2PlayerInterface() == mediaPlayer2PlayerInterface);
|
||||||
});
|
});
|
||||||
if (it == end) {
|
if (it == end) {
|
||||||
qCWarning(KDECONNECT_PLUGIN_MPRIS) << "Seeked signal received for no longer tracked service" << mediaPlayer2PlayerInterface->service();
|
qCWarning(KDECONNECT_PLUGIN_MPRISCONTROL) << "Seeked signal received for no longer tracked service" << mediaPlayer2PlayerInterface->service();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -127,7 +127,7 @@ void MprisControlPlugin::propertiesChanged(const QString & /*propertyInterface*/
|
||||||
return (player.propertiesInterface() == propertiesInterface);
|
return (player.propertiesInterface() == propertiesInterface);
|
||||||
});
|
});
|
||||||
if (it == end) {
|
if (it == end) {
|
||||||
qCWarning(KDECONNECT_PLUGIN_MPRIS) << "PropertiesChanged signal received for no longer tracked service" << propertiesInterface->service();
|
qCWarning(KDECONNECT_PLUGIN_MPRISCONTROL) << "PropertiesChanged signal received for no longer tracked service" << propertiesInterface->service();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -202,12 +202,12 @@ void MprisControlPlugin::removePlayer(const QString &serviceName)
|
||||||
return (player.serviceName() == serviceName);
|
return (player.serviceName() == serviceName);
|
||||||
});
|
});
|
||||||
if (it == end) {
|
if (it == end) {
|
||||||
qCWarning(KDECONNECT_PLUGIN_MPRIS) << "Could not find player for serviceName" << serviceName;
|
qCWarning(KDECONNECT_PLUGIN_MPRISCONTROL) << "Could not find player for serviceName" << serviceName;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString &playerName = it.key();
|
const QString &playerName = it.key();
|
||||||
qCDebug(KDECONNECT_PLUGIN_MPRIS) << "Mpris removePlayer" << serviceName << "->" << playerName;
|
qCDebug(KDECONNECT_PLUGIN_MPRISCONTROL) << "Mpris removePlayer" << serviceName << "->" << playerName;
|
||||||
|
|
||||||
playerList.erase(it);
|
playerList.erase(it);
|
||||||
|
|
||||||
|
@ -287,17 +287,17 @@ void MprisControlPlugin::receivePacket(const NetworkPacket &np)
|
||||||
}
|
}
|
||||||
if (np.has(QStringLiteral("setLoopStatus"))) {
|
if (np.has(QStringLiteral("setLoopStatus"))) {
|
||||||
const QString &loopStatus = np.get<QString>(QStringLiteral("setLoopStatus"));
|
const QString &loopStatus = np.get<QString>(QStringLiteral("setLoopStatus"));
|
||||||
qCDebug(KDECONNECT_PLUGIN_MPRIS) << "Setting loopStatus" << loopStatus << "to" << serviceName;
|
qCDebug(KDECONNECT_PLUGIN_MPRISCONTROL) << "Setting loopStatus" << loopStatus << "to" << serviceName;
|
||||||
mprisInterface.setLoopStatus(loopStatus);
|
mprisInterface.setLoopStatus(loopStatus);
|
||||||
}
|
}
|
||||||
if (np.has(QStringLiteral("setShuffle"))) {
|
if (np.has(QStringLiteral("setShuffle"))) {
|
||||||
bool shuffle = np.get<bool>(QStringLiteral("setShuffle"));
|
bool shuffle = np.get<bool>(QStringLiteral("setShuffle"));
|
||||||
qCDebug(KDECONNECT_PLUGIN_MPRIS) << "Setting shuffle" << shuffle << "to" << serviceName;
|
qCDebug(KDECONNECT_PLUGIN_MPRISCONTROL) << "Setting shuffle" << shuffle << "to" << serviceName;
|
||||||
mprisInterface.setShuffle(shuffle);
|
mprisInterface.setShuffle(shuffle);
|
||||||
}
|
}
|
||||||
if (np.has(QStringLiteral("setVolume"))) {
|
if (np.has(QStringLiteral("setVolume"))) {
|
||||||
double volume = np.get<int>(QStringLiteral("setVolume")) / 100.f;
|
double volume = np.get<int>(QStringLiteral("setVolume")) / 100.f;
|
||||||
qCDebug(KDECONNECT_PLUGIN_MPRIS) << "Setting volume" << volume << "to" << serviceName;
|
qCDebug(KDECONNECT_PLUGIN_MPRISCONTROL) << "Setting volume" << volume << "to" << serviceName;
|
||||||
mprisInterface.setVolume(volume);
|
mprisInterface.setVolume(volume);
|
||||||
}
|
}
|
||||||
if (np.has(QStringLiteral("Seek"))) {
|
if (np.has(QStringLiteral("Seek"))) {
|
||||||
|
|
|
@ -6,11 +6,6 @@ target_sources(kdeconnect_mprisremote PRIVATE
|
||||||
mprisremoteplayermediaplayer2.cpp
|
mprisremoteplayermediaplayer2.cpp
|
||||||
mprisremoteplayermediaplayer2player.cpp
|
mprisremoteplayermediaplayer2player.cpp
|
||||||
)
|
)
|
||||||
ecm_qt_declare_logging_category(kdeconnect_mprisremote
|
|
||||||
HEADER plugin_mprisremote_debug.h
|
|
||||||
IDENTIFIER KDECONNECT_PLUGIN_MPRISREMOTE CATEGORY_NAME kdeconnect.plugin.mprisremote
|
|
||||||
DEFAULT_SEVERITY Warning
|
|
||||||
EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin mprisremote)")
|
|
||||||
target_link_libraries(kdeconnect_mprisremote
|
target_link_libraries(kdeconnect_mprisremote
|
||||||
kdeconnectcore
|
kdeconnectcore
|
||||||
Qt::DBus
|
Qt::DBus
|
||||||
|
|
|
@ -1,12 +1,6 @@
|
||||||
kdeconnect_add_plugin(kdeconnect_notifications SOURCES sendreplydialog.cpp notificationsplugin.cpp notification.cpp)
|
kdeconnect_add_plugin(kdeconnect_notifications SOURCES sendreplydialog.cpp notificationsplugin.cpp notification.cpp)
|
||||||
|
|
||||||
ki18n_wrap_ui(kdeconnect_notifications sendreplydialog.ui)
|
ki18n_wrap_ui(kdeconnect_notifications sendreplydialog.ui)
|
||||||
ecm_qt_declare_logging_category(kdeconnect_notifications
|
|
||||||
HEADER plugin_notification_debug.h
|
|
||||||
IDENTIFIER KDECONNECT_PLUGIN_NOTIFICATION CATEGORY_NAME kdeconnect.plugin.notification
|
|
||||||
DEFAULT_SEVERITY Warning
|
|
||||||
EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin notification)")
|
|
||||||
|
|
||||||
target_link_libraries(kdeconnect_notifications
|
target_link_libraries(kdeconnect_notifications
|
||||||
kdeconnectcore
|
kdeconnectcore
|
||||||
Qt::DBus
|
Qt::DBus
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "notification.h"
|
#include "notification.h"
|
||||||
#include "plugin_notification_debug.h"
|
#include "plugin_notifications_debug.h"
|
||||||
|
|
||||||
#include <KLocalizedString>
|
#include <KLocalizedString>
|
||||||
#include <KNotification>
|
#include <KNotification>
|
||||||
|
@ -148,7 +148,7 @@ void Notification::loadIcon(const NetworkPacket &np)
|
||||||
connect(fileTransferJob, &FileTransferJob::result, this, [this, fileTransferJob] {
|
connect(fileTransferJob, &FileTransferJob::result, this, [this, fileTransferJob] {
|
||||||
s_downloadsInProgress.remove(m_iconPath);
|
s_downloadsInProgress.remove(m_iconPath);
|
||||||
if (fileTransferJob->error()) {
|
if (fileTransferJob->error()) {
|
||||||
qCDebug(KDECONNECT_PLUGIN_NOTIFICATION) << "Error in FileTransferJob: " << fileTransferJob->errorString();
|
qCDebug(KDECONNECT_PLUGIN_NOTIFICATIONS) << "Error in FileTransferJob: " << fileTransferJob->errorString();
|
||||||
} else {
|
} else {
|
||||||
applyIcon();
|
applyIcon();
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
#include "notificationsplugin.h"
|
#include "notificationsplugin.h"
|
||||||
|
|
||||||
#include "plugin_notification_debug.h"
|
#include "plugin_notifications_debug.h"
|
||||||
#include "sendreplydialog.h"
|
#include "sendreplydialog.h"
|
||||||
#include <dbushelper.h>
|
#include <dbushelper.h>
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ void NotificationsPlugin::connected()
|
||||||
void NotificationsPlugin::receivePacket(const NetworkPacket &np)
|
void NotificationsPlugin::receivePacket(const NetworkPacket &np)
|
||||||
{
|
{
|
||||||
if (np.get<bool>(QStringLiteral("request"))) {
|
if (np.get<bool>(QStringLiteral("request"))) {
|
||||||
qCWarning(KDECONNECT_PLUGIN_NOTIFICATION) << "Unexpected notification request. Maybe the paired client is very old?";
|
qCWarning(KDECONNECT_PLUGIN_NOTIFICATIONS) << "Unexpected notification request. Maybe the paired client is very old?";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (np.get<bool>(QStringLiteral("isCancel"))) {
|
if (np.get<bool>(QStringLiteral("isCancel"))) {
|
||||||
|
@ -89,7 +89,7 @@ void NotificationsPlugin::addNotification(Notification *noti)
|
||||||
removeNotification(internalId);
|
removeNotification(internalId);
|
||||||
}
|
}
|
||||||
|
|
||||||
// qCDebug(KDECONNECT_PLUGIN_NOTIFICATION) << "addNotification" << internalId;
|
// qCDebug(KDECONNECT_PLUGIN_NOTIFICATIONS) << "addNotification" << internalId;
|
||||||
|
|
||||||
connect(noti, &Notification::dismissRequested, this, &NotificationsPlugin::dismissRequested);
|
connect(noti, &Notification::dismissRequested, this, &NotificationsPlugin::dismissRequested);
|
||||||
|
|
||||||
|
@ -114,10 +114,10 @@ void NotificationsPlugin::addNotification(Notification *noti)
|
||||||
|
|
||||||
void NotificationsPlugin::removeNotification(const QString &internalId)
|
void NotificationsPlugin::removeNotification(const QString &internalId)
|
||||||
{
|
{
|
||||||
// qCDebug(KDECONNECT_PLUGIN_NOTIFICATION) << "removeNotification" << internalId;
|
// qCDebug(KDECONNECT_PLUGIN_NOTIFICATIONS) << "removeNotification" << internalId;
|
||||||
|
|
||||||
if (!m_internalIdToPublicId.contains(internalId)) {
|
if (!m_internalIdToPublicId.contains(internalId)) {
|
||||||
qCDebug(KDECONNECT_PLUGIN_NOTIFICATION) << "Not found noti by internal Id: " << internalId;
|
qCDebug(KDECONNECT_PLUGIN_NOTIFICATIONS) << "Not found noti by internal Id: " << internalId;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -125,7 +125,7 @@ void NotificationsPlugin::removeNotification(const QString &internalId)
|
||||||
|
|
||||||
Notification *noti = m_notifications.take(publicId);
|
Notification *noti = m_notifications.take(publicId);
|
||||||
if (!noti) {
|
if (!noti) {
|
||||||
qCDebug(KDECONNECT_PLUGIN_NOTIFICATION) << "Not found noti by public Id: " << publicId;
|
qCDebug(KDECONNECT_PLUGIN_NOTIFICATIONS) << "Not found noti by public Id: " << publicId;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,12 +6,6 @@ else()
|
||||||
target_sources(kdeconnect_pausemusic PRIVATE pausemusicplugin.cpp)
|
target_sources(kdeconnect_pausemusic PRIVATE pausemusicplugin.cpp)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
ecm_qt_declare_logging_category(kdeconnect_pausemusic
|
|
||||||
HEADER plugin_pausemusic_debug.h
|
|
||||||
IDENTIFIER KDECONNECT_PLUGIN_PAUSEMUSIC CATEGORY_NAME kdeconnect.plugin.pausemusic
|
|
||||||
DEFAULT_SEVERITY Warning
|
|
||||||
EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin pausemusic)")
|
|
||||||
|
|
||||||
target_link_libraries(kdeconnect_pausemusic
|
target_link_libraries(kdeconnect_pausemusic
|
||||||
kdeconnectcore
|
kdeconnectcore
|
||||||
kdeconnectinterfaces
|
kdeconnectinterfaces
|
||||||
|
|
|
@ -1,10 +1,4 @@
|
||||||
kdeconnect_add_plugin(kdeconnect_photo SOURCES photoplugin.cpp)
|
kdeconnect_add_plugin(kdeconnect_photo SOURCES photoplugin.cpp)
|
||||||
|
|
||||||
ecm_qt_declare_logging_category(kdeconnect_photo
|
|
||||||
HEADER plugin_photo_debug.h
|
|
||||||
IDENTIFIER KDECONNECT_PLUGIN_PHOTO CATEGORY_NAME kdeconnect.plugin.photo
|
|
||||||
DEFAULT_SEVERITY Warning
|
|
||||||
EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin photo)")
|
|
||||||
target_link_libraries(kdeconnect_photo
|
target_link_libraries(kdeconnect_photo
|
||||||
kdeconnectcore
|
kdeconnectcore
|
||||||
Qt::DBus
|
Qt::DBus
|
||||||
|
|
|
@ -1,11 +1,4 @@
|
||||||
kdeconnect_add_plugin(kdeconnect_ping SOURCES pingplugin.cpp)
|
kdeconnect_add_plugin(kdeconnect_ping SOURCES pingplugin.cpp)
|
||||||
|
|
||||||
ecm_qt_declare_logging_category(kdeconnect_ping
|
|
||||||
HEADER plugin_ping_debug.h
|
|
||||||
IDENTIFIER KDECONNECT_PLUGIN_PING CATEGORY_NAME kdeconnect.plugin.ping
|
|
||||||
DEFAULT_SEVERITY Warning
|
|
||||||
EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin ping)")
|
|
||||||
|
|
||||||
target_link_libraries(kdeconnect_ping
|
target_link_libraries(kdeconnect_ping
|
||||||
kdeconnectcore
|
kdeconnectcore
|
||||||
Qt::DBus
|
Qt::DBus
|
||||||
|
|
|
@ -1,11 +1,6 @@
|
||||||
qt_add_resources(presenter_SRCS assets.qrc)
|
qt_add_resources(presenter_SRCS assets.qrc)
|
||||||
|
|
||||||
kdeconnect_add_plugin(kdeconnect_presenter SOURCES presenterplugin.cpp ${presenter_SRCS})
|
kdeconnect_add_plugin(kdeconnect_presenter SOURCES presenterplugin.cpp ${presenter_SRCS})
|
||||||
ecm_qt_declare_logging_category(kdeconnect_presenter
|
|
||||||
HEADER plugin_presenter_debug.h
|
|
||||||
IDENTIFIER KDECONNECT_PLUGIN_PRESENT CATEGORY_NAME kdeconnect.plugin.presenter
|
|
||||||
DEFAULT_SEVERITY Warning
|
|
||||||
EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin presenter)")
|
|
||||||
|
|
||||||
target_link_libraries(kdeconnect_presenter
|
target_link_libraries(kdeconnect_presenter
|
||||||
kdeconnectcore
|
kdeconnectcore
|
||||||
|
|
|
@ -44,7 +44,7 @@ public:
|
||||||
|
|
||||||
const auto ourErrors = errors();
|
const auto ourErrors = errors();
|
||||||
for (const auto &error : ourErrors) {
|
for (const auto &error : ourErrors) {
|
||||||
qCWarning(KDECONNECT_PLUGIN_PRESENT) << "error" << error.description() << error.url() << error.line() << error.column();
|
qCWarning(KDECONNECT_PLUGIN_PRESENTER) << "error" << error.description() << error.url() << error.line() << error.column();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,10 +1,4 @@
|
||||||
kdeconnect_add_plugin(kdeconnect_remotecommands SOURCES remotecommandsplugin.cpp)
|
kdeconnect_add_plugin(kdeconnect_remotecommands SOURCES remotecommandsplugin.cpp)
|
||||||
|
|
||||||
ecm_qt_declare_logging_category(kdeconnect_remotecommands
|
|
||||||
HEADER plugin_remotecommands_debug.h
|
|
||||||
IDENTIFIER KDECONNECT_PLUGIN_REMOTECOMMANDS CATEGORY_NAME kdeconnect.plugin.remotecommands
|
|
||||||
DEFAULT_SEVERITY Warning
|
|
||||||
EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin remotecommands)")
|
|
||||||
target_link_libraries(kdeconnect_remotecommands
|
target_link_libraries(kdeconnect_remotecommands
|
||||||
kdeconnectcore
|
kdeconnectcore
|
||||||
Qt::DBus
|
Qt::DBus
|
||||||
|
|
|
@ -1,10 +1,4 @@
|
||||||
kdeconnect_add_plugin(kdeconnect_remotecontrol SOURCES remotecontrolplugin.cpp)
|
kdeconnect_add_plugin(kdeconnect_remotecontrol SOURCES remotecontrolplugin.cpp)
|
||||||
|
|
||||||
ecm_qt_declare_logging_category(kdeconnect_remotecontrol
|
|
||||||
HEADER plugin_remotecontrol_debug.h
|
|
||||||
IDENTIFIER KDECONNECT_PLUGIN_REMOTECONTROL CATEGORY_NAME kdeconnect.plugin.remotecontrol
|
|
||||||
DEFAULT_SEVERITY Warning
|
|
||||||
EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin remotecontrol)")
|
|
||||||
target_link_libraries(kdeconnect_remotecontrol
|
target_link_libraries(kdeconnect_remotecontrol
|
||||||
kdeconnectcore
|
kdeconnectcore
|
||||||
Qt::DBus
|
Qt::DBus
|
||||||
|
|
|
@ -1,11 +1,4 @@
|
||||||
kdeconnect_add_plugin(kdeconnect_remotekeyboard SOURCES remotekeyboardplugin.cpp)
|
kdeconnect_add_plugin(kdeconnect_remotekeyboard SOURCES remotekeyboardplugin.cpp)
|
||||||
|
|
||||||
ecm_qt_declare_logging_category(kdeconnect_remotekeyboard
|
|
||||||
HEADER plugin_remotekeyboard_debug.h
|
|
||||||
IDENTIFIER KDECONNECT_PLUGIN_REMOTEKEYBOARD CATEGORY_NAME kdeconnect.plugin.remotekeyboard
|
|
||||||
DEFAULT_SEVERITY Warning
|
|
||||||
EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin remotekeyboard)")
|
|
||||||
|
|
||||||
target_link_libraries(kdeconnect_remotekeyboard
|
target_link_libraries(kdeconnect_remotekeyboard
|
||||||
kdeconnectcore
|
kdeconnectcore
|
||||||
Qt::DBus
|
Qt::DBus
|
||||||
|
|
|
@ -1,10 +1,4 @@
|
||||||
kdeconnect_add_plugin(kdeconnect_remotesystemvolume SOURCES remotesystemvolumeplugin.cpp)
|
kdeconnect_add_plugin(kdeconnect_remotesystemvolume SOURCES remotesystemvolumeplugin.cpp)
|
||||||
|
|
||||||
ecm_qt_declare_logging_category(kdeconnect_remotesystemvolume
|
|
||||||
HEADER plugin_remotesystemvolume_debug.h
|
|
||||||
IDENTIFIER KDECONNECT_PLUGIN_REMOTESYSTEMVOLUME CATEGORY_NAME kdeconnect.plugin.remotesystemvolume
|
|
||||||
DEFAULT_SEVERITY Warning
|
|
||||||
EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin remotesystemvolume)")
|
|
||||||
target_link_libraries(kdeconnect_remotesystemvolume
|
target_link_libraries(kdeconnect_remotesystemvolume
|
||||||
kdeconnectcore
|
kdeconnectcore
|
||||||
Qt::DBus
|
Qt::DBus
|
||||||
|
|
|
@ -1,10 +1,4 @@
|
||||||
kdeconnect_add_plugin(kdeconnect_runcommand SOURCES runcommandplugin.cpp)
|
kdeconnect_add_plugin(kdeconnect_runcommand SOURCES runcommandplugin.cpp)
|
||||||
|
|
||||||
ecm_qt_declare_logging_category(kdeconnect_runcommand
|
|
||||||
HEADER plugin_runcommand_debug.h
|
|
||||||
IDENTIFIER KDECONNECT_PLUGIN_RUNCOMMAND CATEGORY_NAME kdeconnect.plugin.runcommand
|
|
||||||
DEFAULT_SEVERITY Warning
|
|
||||||
EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin runcommand)")
|
|
||||||
target_link_libraries(kdeconnect_runcommand
|
target_link_libraries(kdeconnect_runcommand
|
||||||
kdeconnectcore
|
kdeconnectcore
|
||||||
Qt::DBus
|
Qt::DBus
|
||||||
|
|
|
@ -14,13 +14,6 @@ endif()
|
||||||
|
|
||||||
|
|
||||||
kdeconnect_add_plugin(kdeconnect_screensaver_inhibit SOURCES ${kdeconnect_screensaver_inhibit_SRCS})
|
kdeconnect_add_plugin(kdeconnect_screensaver_inhibit SOURCES ${kdeconnect_screensaver_inhibit_SRCS})
|
||||||
|
|
||||||
ecm_qt_declare_logging_category(kdeconnect_screensaver_inhibit
|
|
||||||
HEADER kdeconnect_screensaverinhibit_debug.h
|
|
||||||
IDENTIFIER KDECONNECT_PLUGIN_SCREENSAVERINHIBIT CATEGORY_NAME kdeconnect.plugin.screensaverinhibit
|
|
||||||
DEFAULT_SEVERITY Warning
|
|
||||||
EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin screensaverinhibit)")
|
|
||||||
|
|
||||||
target_link_libraries(kdeconnect_screensaver_inhibit kdeconnectcore kdeconnectinterfaces)
|
target_link_libraries(kdeconnect_screensaver_inhibit kdeconnectcore kdeconnectinterfaces)
|
||||||
if(NOT APPLE AND NOT WIN32)
|
if(NOT APPLE AND NOT WIN32)
|
||||||
target_link_libraries(kdeconnect_screensaver_inhibit
|
target_link_libraries(kdeconnect_screensaver_inhibit
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
#include "screensaverinhibitplugin-macos.h"
|
#include "screensaverinhibitplugin-macos.h"
|
||||||
|
|
||||||
#include "kdeconnect_screensaverinhibit_debug.h"
|
#include "plugin_screensaver_inhibit_debug.h"
|
||||||
#include <KPluginFactory>
|
#include <KPluginFactory>
|
||||||
|
|
||||||
K_PLUGIN_CLASS_WITH_JSON(ScreensaverInhibitPlugin, "kdeconnect_screensaver_inhibit.json")
|
K_PLUGIN_CLASS_WITH_JSON(ScreensaverInhibitPlugin, "kdeconnect_screensaver_inhibit.json")
|
||||||
|
@ -21,7 +21,7 @@ ScreensaverInhibitPlugin::ScreensaverInhibitPlugin(QObject *parent, const QVaria
|
||||||
m_caffeinateProcess->setArguments({QStringLiteral("-d")}); // Prevent the display from sleeping
|
m_caffeinateProcess->setArguments({QStringLiteral("-d")}); // Prevent the display from sleeping
|
||||||
m_caffeinateProcess->start();
|
m_caffeinateProcess->start();
|
||||||
} else {
|
} else {
|
||||||
qWarning(KDECONNECT_PLUGIN_SCREENSAVERINHIBIT) << "Cannot find caffeinate on macOS install";
|
qWarning(KDECONNECT_PLUGIN_SCREENSAVER_INHIBIT) << "Cannot find caffeinate on macOS install";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
|
|
||||||
#include "screensaverinhibitplugin-win.h"
|
#include "screensaverinhibitplugin-win.h"
|
||||||
|
|
||||||
#include "kdeconnect_screensaverinhibit_debug.h"
|
|
||||||
#include <KPluginFactory>
|
#include <KPluginFactory>
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
#include "screensaverinhibitplugin.h"
|
#include "screensaverinhibitplugin.h"
|
||||||
|
|
||||||
#include "generated/systeminterfaces/screensaver.h"
|
#include "generated/systeminterfaces/screensaver.h"
|
||||||
#include "kdeconnect_screensaverinhibit_debug.h"
|
|
||||||
#include <KLocalizedString>
|
#include <KLocalizedString>
|
||||||
#include <KPluginFactory>
|
#include <KPluginFactory>
|
||||||
#include <QDBusConnection>
|
#include <QDBusConnection>
|
||||||
|
|
|
@ -5,11 +5,6 @@ target_sources(kdeconnect_sendnotifications PRIVATE
|
||||||
notificationslistener.cpp
|
notificationslistener.cpp
|
||||||
notifyingapplication.cpp
|
notifyingapplication.cpp
|
||||||
)
|
)
|
||||||
ecm_qt_declare_logging_category(kdeconnect_sendnotifications
|
|
||||||
HEADER plugin_sendnotification_debug.h
|
|
||||||
IDENTIFIER KDECONNECT_PLUGIN_SENDNOTIFICATION CATEGORY_NAME kdeconnect.plugin.sendnotification
|
|
||||||
DEFAULT_SEVERITY Warning
|
|
||||||
EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin sendnotification)")
|
|
||||||
target_link_libraries(kdeconnect_sendnotifications
|
target_link_libraries(kdeconnect_sendnotifications
|
||||||
kdeconnectcore
|
kdeconnectcore
|
||||||
Qt::DBus
|
Qt::DBus
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#include <dbushelper.h>
|
#include <dbushelper.h>
|
||||||
|
|
||||||
#include "notifyingapplication.h"
|
#include "notifyingapplication.h"
|
||||||
#include "plugin_sendnotification_debug.h"
|
#include "plugin_sendnotifications_debug.h"
|
||||||
#include "sendnotificationsplugin.h"
|
#include "sendnotificationsplugin.h"
|
||||||
|
|
||||||
NotificationsListener::NotificationsListener(KdeConnectPlugin *aPlugin)
|
NotificationsListener::NotificationsListener(KdeConnectPlugin *aPlugin)
|
||||||
|
@ -60,7 +60,7 @@ NotificationsListener::NotificationsListener(KdeConnectPlugin *aPlugin)
|
||||||
|
|
||||||
NotificationsListener::~NotificationsListener()
|
NotificationsListener::~NotificationsListener()
|
||||||
{
|
{
|
||||||
qCDebug(KDECONNECT_PLUGIN_SENDNOTIFICATION) << "Destroying NotificationsListener";
|
qCDebug(KDECONNECT_PLUGIN_SENDNOTIFICATIONS) << "Destroying NotificationsListener";
|
||||||
g_dbus_connection_remove_filter(m_gdbusConnection, m_gdbusFilterId);
|
g_dbus_connection_remove_filter(m_gdbusConnection, m_gdbusFilterId);
|
||||||
g_object_unref(m_gdbusConnection);
|
g_object_unref(m_gdbusConnection);
|
||||||
}
|
}
|
||||||
|
@ -70,7 +70,8 @@ void NotificationsListener::setTranslatedAppName()
|
||||||
QString filePath =
|
QString filePath =
|
||||||
QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("knotifications5/kdeconnect.notifyrc"), QStandardPaths::LocateFile);
|
QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("knotifications5/kdeconnect.notifyrc"), QStandardPaths::LocateFile);
|
||||||
if (filePath.isEmpty()) {
|
if (filePath.isEmpty()) {
|
||||||
qCDebug(KDECONNECT_PLUGIN_SENDNOTIFICATION) << "Couldn't find kdeconnect.notifyrc to hide kdeconnect notifications on the devices. Using default name.";
|
qCDebug(KDECONNECT_PLUGIN_SENDNOTIFICATIONS)
|
||||||
|
<< "Couldn't find kdeconnect.notifyrc to hide kdeconnect notifications on the devices. Using default name.";
|
||||||
m_translatedAppName = QStringLiteral("KDE Connect");
|
m_translatedAppName = QStringLiteral("KDE Connect");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -90,7 +91,7 @@ void NotificationsListener::loadApplications()
|
||||||
m_applications.insert(app.name, app);
|
m_applications.insert(app.name, app);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// qCDebug(KDECONNECT_PLUGIN_SENDNOTIFICATION) << "Loaded" << applications.size() << " applications";
|
// qCDebug(KDECONNECT_PLUGIN_SENDNOTIFICATIONS) << "Loaded" << applications.size() << " applications";
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NotificationsListener::parseImageDataArgument(GVariant *argument,
|
bool NotificationsListener::parseImageDataArgument(GVariant *argument,
|
||||||
|
@ -163,9 +164,9 @@ QSharedPointer<QIODevice> NotificationsListener::iconForImageData(GVariant *argu
|
||||||
return QSharedPointer<QIODevice>();
|
return QSharedPointer<QIODevice>();
|
||||||
|
|
||||||
if (bitsPerSample != 8) {
|
if (bitsPerSample != 8) {
|
||||||
qCWarning(KDECONNECT_PLUGIN_SENDNOTIFICATION) << "Unsupported image format:"
|
qCWarning(KDECONNECT_PLUGIN_SENDNOTIFICATIONS) << "Unsupported image format:"
|
||||||
<< "width=" << width << "height=" << height << "rowStride=" << rowStride
|
<< "width=" << width << "height=" << height << "rowStride=" << rowStride
|
||||||
<< "bitsPerSample=" << bitsPerSample << "channels=" << channels << "hasAlpha=" << hasAlpha;
|
<< "bitsPerSample=" << bitsPerSample << "channels=" << channels << "hasAlpha=" << hasAlpha;
|
||||||
return QSharedPointer<QIODevice>();
|
return QSharedPointer<QIODevice>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -175,7 +176,7 @@ QSharedPointer<QIODevice> NotificationsListener::iconForImageData(GVariant *argu
|
||||||
|
|
||||||
QSharedPointer<QBuffer> buffer = QSharedPointer<QBuffer>(new QBuffer);
|
QSharedPointer<QBuffer> buffer = QSharedPointer<QBuffer>(new QBuffer);
|
||||||
if (!buffer || !buffer->open(QIODevice::WriteOnly) || !image.save(buffer.data(), "PNG")) {
|
if (!buffer || !buffer->open(QIODevice::WriteOnly) || !image.save(buffer.data(), "PNG")) {
|
||||||
qCWarning(KDECONNECT_PLUGIN_SENDNOTIFICATION) << "Could not initialize image buffer";
|
qCWarning(KDECONNECT_PLUGIN_SENDNOTIFICATIONS) << "Could not initialize image buffer";
|
||||||
return QSharedPointer<QIODevice>();
|
return QSharedPointer<QIODevice>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -193,7 +194,7 @@ QSharedPointer<QIODevice> NotificationsListener::iconForIconName(const QString &
|
||||||
KIconTheme hicolor(QStringLiteral("hicolor"));
|
KIconTheme hicolor(QStringLiteral("hicolor"));
|
||||||
if (hicolor.isValid()) {
|
if (hicolor.isValid()) {
|
||||||
iconPath = hicolor.iconPath(iconName + QStringLiteral(".png"), size, KIconLoader::MatchBest);
|
iconPath = hicolor.iconPath(iconName + QStringLiteral(".png"), size, KIconLoader::MatchBest);
|
||||||
// qCDebug(KDECONNECT_PLUGIN_SENDNOTIFICATION) << "Found non-png icon in default theme trying fallback to hicolor:" << iconPath;
|
// qCDebug(KDECONNECT_PLUGIN_SENDNOTIFICATIONS) << "Found non-png icon in default theme trying fallback to hicolor:" << iconPath;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -250,7 +251,7 @@ GDBusMessage *NotificationsListener::onMessageFiltered(GDBusConnection *, GDBusM
|
||||||
for (const auto &a : std::as_const(listener->m_applications))
|
for (const auto &a : std::as_const(listener->m_applications))
|
||||||
list << QVariant::fromValue<NotifyingApplication>(a);
|
list << QVariant::fromValue<NotifyingApplication>(a);
|
||||||
listener->m_plugin->config()->setList(QStringLiteral("applications"), list);
|
listener->m_plugin->config()->setList(QStringLiteral("applications"), list);
|
||||||
// qCDebug(KDECONNECT_PLUGIN_SENDNOTIFICATION) << "Added new application to config:" << app;
|
// qCDebug(KDECONNECT_PLUGIN_SENDNOTIFICATIONS) << "Added new application to config:" << app;
|
||||||
} else {
|
} else {
|
||||||
app = listener->m_applications.value(appName);
|
app = listener->m_applications.value(appName);
|
||||||
}
|
}
|
||||||
|
@ -308,7 +309,7 @@ GDBusMessage *NotificationsListener::onMessageFiltered(GDBusConnection *, GDBusM
|
||||||
variant = g_variant_get_child_value(bodyVariant, 1);
|
variant = g_variant_get_child_value(bodyVariant, 1);
|
||||||
const unsigned replacesId = g_variant_get_uint32(variant);
|
const unsigned replacesId = g_variant_get_uint32(variant);
|
||||||
|
|
||||||
// qCDebug(KDECONNECT_PLUGIN_SENDNOTIFICATION) << "Sending notification from" << appName << ":" <<ticker << "; appIcon=" << appIcon;
|
// qCDebug(KDECONNECT_PLUGIN_SENDNOTIFICATIONS) << "Sending notification from" << appName << ":" <<ticker << "; appIcon=" << appIcon;
|
||||||
NetworkPacket np(PACKET_TYPE_NOTIFICATION,
|
NetworkPacket np(PACKET_TYPE_NOTIFICATION,
|
||||||
{{QStringLiteral("id"), QString::number(replacesId > 0 ? replacesId : ++id)},
|
{{QStringLiteral("id"), QString::number(replacesId > 0 ? replacesId : ++id)},
|
||||||
{QStringLiteral("appName"), appName},
|
{QStringLiteral("appName"), appName},
|
||||||
|
@ -342,9 +343,9 @@ GDBusMessage *NotificationsListener::onMessageFiltered(GDBusConnection *, GDBusM
|
||||||
|
|
||||||
listener->m_plugin->sendPacket(np);
|
listener->m_plugin->sendPacket(np);
|
||||||
|
|
||||||
qCDebug(KDECONNECT_PLUGIN_SENDNOTIFICATION) << "Got notification appName=" << appName << "replacesId=" << replacesId << "appIcon=" << appIcon
|
qCDebug(KDECONNECT_PLUGIN_SENDNOTIFICATIONS) << "Got notification appName=" << appName << "replacesId=" << replacesId << "appIcon=" << appIcon
|
||||||
<< "summary=" << ticker << "body=" << body << "hints=" << hints.size() << "urgency=" << urgency
|
<< "summary=" << ticker << "body=" << body << "hints=" << hints.size() << "urgency=" << urgency
|
||||||
<< "timeout=" << timeout;
|
<< "timeout=" << timeout;
|
||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
#include "sendnotificationsplugin.h"
|
#include "sendnotificationsplugin.h"
|
||||||
|
|
||||||
#include "notificationslistener.h"
|
#include "notificationslistener.h"
|
||||||
#include "plugin_sendnotification_debug.h"
|
|
||||||
|
|
||||||
#include <KPluginFactory>
|
#include <KPluginFactory>
|
||||||
|
|
||||||
|
|
|
@ -15,12 +15,6 @@ else()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
kdeconnect_add_plugin(kdeconnect_sftp SOURCES ${kdeconnect_sftp_SRCS})
|
kdeconnect_add_plugin(kdeconnect_sftp SOURCES ${kdeconnect_sftp_SRCS})
|
||||||
ecm_qt_declare_logging_category(kdeconnect_sftp
|
|
||||||
HEADER plugin_sftp_debug.h
|
|
||||||
IDENTIFIER KDECONNECT_PLUGIN_SFTP CATEGORY_NAME kdeconnect.plugin.sftp
|
|
||||||
DEFAULT_SEVERITY Warning
|
|
||||||
EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin sftp)")
|
|
||||||
|
|
||||||
target_link_libraries(kdeconnect_sftp
|
target_link_libraries(kdeconnect_sftp
|
||||||
kdeconnectcore
|
kdeconnectcore
|
||||||
Qt::DBus
|
Qt::DBus
|
||||||
|
|
|
@ -1,13 +1,4 @@
|
||||||
kdeconnect_add_plugin(kdeconnect_share SOURCES shareplugin.cpp)
|
kdeconnect_add_plugin(kdeconnect_share SOURCES shareplugin.cpp)
|
||||||
|
|
||||||
ecm_qt_declare_logging_category(kdeconnect_share
|
|
||||||
HEADER plugin_share_debug.h
|
|
||||||
IDENTIFIER KDECONNECT_PLUGIN_SHARE
|
|
||||||
CATEGORY_NAME kdeconnect.plugin.share
|
|
||||||
DEFAULT_SEVERITY Warning
|
|
||||||
EXPORT kdeconnect-kde
|
|
||||||
DESCRIPTION "kdeconnect (plugin share)"
|
|
||||||
)
|
|
||||||
target_link_libraries(kdeconnect_share
|
target_link_libraries(kdeconnect_share
|
||||||
kdeconnectcore
|
kdeconnectcore
|
||||||
Qt::DBus
|
Qt::DBus
|
||||||
|
@ -18,11 +9,7 @@ target_link_libraries(kdeconnect_share
|
||||||
KF${QT_MAJOR_VERSION}::Service
|
KF${QT_MAJOR_VERSION}::Service
|
||||||
)
|
)
|
||||||
|
|
||||||
#######################################
|
|
||||||
# Config
|
|
||||||
|
|
||||||
kdeconnect_add_kcm(kdeconnect_share_config SOURCES share_config.cpp)
|
kdeconnect_add_kcm(kdeconnect_share_config SOURCES share_config.cpp)
|
||||||
|
|
||||||
ki18n_wrap_ui(kdeconnect_share_config share_config.ui)
|
ki18n_wrap_ui(kdeconnect_share_config share_config.ui)
|
||||||
target_link_libraries(kdeconnect_share_config
|
target_link_libraries(kdeconnect_share_config
|
||||||
kdeconnectpluginkcm
|
kdeconnectpluginkcm
|
||||||
|
|
|
@ -5,12 +5,6 @@ target_sources(kdeconnect_sms PRIVATE
|
||||||
conversationsdbusinterface.cpp
|
conversationsdbusinterface.cpp
|
||||||
requestconversationworker.cpp
|
requestconversationworker.cpp
|
||||||
)
|
)
|
||||||
ecm_qt_declare_logging_category(kdeconnect_sms
|
|
||||||
HEADER plugin_sms_debug.h
|
|
||||||
IDENTIFIER KDECONNECT_PLUGIN_SMS CATEGORY_NAME kdeconnect.plugin.sms
|
|
||||||
DEFAULT_SEVERITY Warning
|
|
||||||
EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin sms)")
|
|
||||||
|
|
||||||
ecm_qt_declare_logging_category(kdeconnect_sms
|
ecm_qt_declare_logging_category(kdeconnect_sms
|
||||||
HEADER kdeconnect_conversations_debug.h
|
HEADER kdeconnect_conversations_debug.h
|
||||||
IDENTIFIER KDECONNECT_CONVERSATIONS CATEGORY_NAME kdeconnect.conversations
|
IDENTIFIER KDECONNECT_CONVERSATIONS CATEGORY_NAME kdeconnect.conversations
|
||||||
|
|
|
@ -14,11 +14,6 @@ endif()
|
||||||
|
|
||||||
kdeconnect_add_plugin(kdeconnect_systemvolume SOURCES ${kdeconnect_systemvolume_SRCS})
|
kdeconnect_add_plugin(kdeconnect_systemvolume SOURCES ${kdeconnect_systemvolume_SRCS})
|
||||||
|
|
||||||
ecm_qt_declare_logging_category(kdeconnect_systemvolume
|
|
||||||
HEADER plugin_systemvolume_debug.h
|
|
||||||
IDENTIFIER KDECONNECT_PLUGIN_SYSTEMVOLUME CATEGORY_NAME kdeconnect.plugin.systemvolume
|
|
||||||
DEFAULT_SEVERITY Warning
|
|
||||||
EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin systemvolume)")
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
target_link_libraries(kdeconnect_systemvolume
|
target_link_libraries(kdeconnect_systemvolume
|
||||||
kdeconnectcore
|
kdeconnectcore
|
||||||
|
|
|
@ -1,10 +1,4 @@
|
||||||
kdeconnect_add_plugin(kdeconnect_telephony SOURCES telephonyplugin.cpp)
|
kdeconnect_add_plugin(kdeconnect_telephony SOURCES telephonyplugin.cpp)
|
||||||
|
|
||||||
ecm_qt_declare_logging_category(kdeconnect_telephony
|
|
||||||
HEADER plugin_telephony_debug.h
|
|
||||||
IDENTIFIER KDECONNECT_PLUGIN_TELEPHONY CATEGORY_NAME kdeconnect.plugin.telephony
|
|
||||||
DEFAULT_SEVERITY Warning
|
|
||||||
EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin telephony)")
|
|
||||||
target_link_libraries(kdeconnect_telephony
|
target_link_libraries(kdeconnect_telephony
|
||||||
kdeconnectcore
|
kdeconnectcore
|
||||||
KF${QT_MAJOR_VERSION}::I18n
|
KF${QT_MAJOR_VERSION}::I18n
|
||||||
|
|
|
@ -1,10 +1,4 @@
|
||||||
kdeconnect_add_plugin(kdeconnect_virtualmonitor SOURCES virtualmonitorplugin.cpp)
|
kdeconnect_add_plugin(kdeconnect_virtualmonitor SOURCES virtualmonitorplugin.cpp)
|
||||||
ecm_qt_declare_logging_category(kdeconnect_virtualmonitor
|
|
||||||
HEADER plugin_virtualmonitor_debug.h
|
|
||||||
IDENTIFIER KDECONNECT_PLUGIN_VIRTUALMONITOR CATEGORY_NAME kdeconnect.plugin.virtualmonitor
|
|
||||||
DEFAULT_SEVERITY Warning
|
|
||||||
EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin virtualmonitor)")
|
|
||||||
|
|
||||||
target_link_libraries(kdeconnect_virtualmonitor
|
target_link_libraries(kdeconnect_virtualmonitor
|
||||||
kdeconnectcore
|
kdeconnectcore
|
||||||
Qt::Core
|
Qt::Core
|
||||||
|
|
Loading…
Reference in a new issue