clang-format pass
This commit is contained in:
parent
af907cea83
commit
9c87393b28
24 changed files with 86 additions and 97 deletions
|
@ -13,11 +13,11 @@
|
||||||
#include <QQuickStyle>
|
#include <QQuickStyle>
|
||||||
#include <QStandardPaths>
|
#include <QStandardPaths>
|
||||||
|
|
||||||
|
#include "kdeconnect-version.h"
|
||||||
#include <KAboutData>
|
#include <KAboutData>
|
||||||
#include <KColorSchemeManager>
|
#include <KColorSchemeManager>
|
||||||
#include <KLocalizedContext>
|
#include <KLocalizedContext>
|
||||||
#include <KLocalizedString>
|
#include <KLocalizedString>
|
||||||
#include "kdeconnect-version.h"
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
|
|
@ -15,4 +15,3 @@ DeviceLink::DeviceLink(const QString &deviceId, LinkProvider *parent)
|
||||||
parent->onLinkDestroyed(deviceId, this);
|
parent->onLinkDestroyed(deviceId, this);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,8 +13,8 @@
|
||||||
#include <netinet/tcp.h>
|
#include <netinet/tcp.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#else
|
#else
|
||||||
#include <winsock2.h>
|
|
||||||
#include <mstcpip.h>
|
#include <mstcpip.h>
|
||||||
|
#include <winsock2.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <QHostInfo>
|
#include <QHostInfo>
|
||||||
|
@ -562,15 +562,9 @@ void LanLinkProvider::configureSocket(QSslSocket *socket)
|
||||||
DWORD nop;
|
DWORD nop;
|
||||||
|
|
||||||
// see https://learn.microsoft.com/en-us/windows/win32/winsock/sio-keepalive-vals
|
// see https://learn.microsoft.com/en-us/windows/win32/winsock/sio-keepalive-vals
|
||||||
struct tcp_keepalive keepalive = {
|
struct tcp_keepalive keepalive = {1 /* true */, maxIdle, interval};
|
||||||
1 /* true */,
|
|
||||||
maxIdle,
|
|
||||||
interval
|
|
||||||
};
|
|
||||||
|
|
||||||
int rv = WSAIoctl(socket->socketDescriptor(), SIO_KEEPALIVE_VALS, &keepalive,
|
int rv = WSAIoctl(socket->socketDescriptor(), SIO_KEEPALIVE_VALS, &keepalive, sizeof(keepalive), nullptr, 0, &nop, nullptr, nullptr);
|
||||||
sizeof(keepalive), nullptr, 0, &nop,
|
|
||||||
nullptr, nullptr);
|
|
||||||
if (!rv) {
|
if (!rv) {
|
||||||
int error = WSAGetLastError();
|
int error = WSAGetLastError();
|
||||||
qCDebug(KDECONNECT_CORE) << "Could not enable TCP Keep-Alive: " << error;
|
qCDebug(KDECONNECT_CORE) << "Could not enable TCP Keep-Alive: " << error;
|
||||||
|
|
|
@ -26,42 +26,42 @@ void PairingHandler::packetReceived(const NetworkPacket &np)
|
||||||
bool wantsPair = np.get<bool>(QStringLiteral("pair"));
|
bool wantsPair = np.get<bool>(QStringLiteral("pair"));
|
||||||
if (wantsPair) {
|
if (wantsPair) {
|
||||||
switch (m_pairState) {
|
switch (m_pairState) {
|
||||||
case PairState::Requested:
|
case PairState::Requested:
|
||||||
pairingDone();
|
pairingDone();
|
||||||
break;
|
break;
|
||||||
case PairState::RequestedByPeer:
|
case PairState::RequestedByPeer:
|
||||||
qCDebug(KDECONNECT_CORE) << "Ignoring second pairing request before the first one timed out";
|
qCDebug(KDECONNECT_CORE) << "Ignoring second pairing request before the first one timed out";
|
||||||
break;
|
break;
|
||||||
case PairState::Paired:
|
case PairState::Paired:
|
||||||
case PairState::NotPaired:
|
case PairState::NotPaired:
|
||||||
if (m_pairState == PairState::Paired) {
|
if (m_pairState == PairState::Paired) {
|
||||||
qWarning() << "Received pairing request from a device we already trusted.";
|
qWarning() << "Received pairing request from a device we already trusted.";
|
||||||
// It would be nice to auto-accept the pairing request here, but since the pairing accept and pairing request
|
// It would be nice to auto-accept the pairing request here, but since the pairing accept and pairing request
|
||||||
// messages are identical, this could create an infinite loop if both devices are "accepting" each other pairs.
|
// messages are identical, this could create an infinite loop if both devices are "accepting" each other pairs.
|
||||||
// Instead, unpair and handle as if "NotPaired".
|
// Instead, unpair and handle as if "NotPaired".
|
||||||
m_pairState = PairState::NotPaired;
|
m_pairState = PairState::NotPaired;
|
||||||
Q_EMIT unpaired();
|
Q_EMIT unpaired();
|
||||||
}
|
}
|
||||||
m_pairState = PairState::RequestedByPeer;
|
m_pairState = PairState::RequestedByPeer;
|
||||||
m_pairingTimeout.start();
|
m_pairingTimeout.start();
|
||||||
Q_EMIT incomingPairRequest();
|
Q_EMIT incomingPairRequest();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else { // wantsPair == false
|
} else { // wantsPair == false
|
||||||
qCDebug(KDECONNECT_CORE) << "Unpair request received";
|
qCDebug(KDECONNECT_CORE) << "Unpair request received";
|
||||||
switch (m_pairState) {
|
switch (m_pairState) {
|
||||||
case PairState::NotPaired:
|
case PairState::NotPaired:
|
||||||
qCDebug(KDECONNECT_CORE) << "Ignoring unpair request for already unpaired device";
|
qCDebug(KDECONNECT_CORE) << "Ignoring unpair request for already unpaired device";
|
||||||
break;
|
break;
|
||||||
case PairState::Requested: // We started pairing and got rejected
|
case PairState::Requested: // We started pairing and got rejected
|
||||||
case PairState::RequestedByPeer: // They stared pairing, then cancelled
|
case PairState::RequestedByPeer: // They stared pairing, then cancelled
|
||||||
m_pairState = PairState::NotPaired;
|
m_pairState = PairState::NotPaired;
|
||||||
Q_EMIT pairingFailed(i18n("Canceled by other peer"));
|
Q_EMIT pairingFailed(i18n("Canceled by other peer"));
|
||||||
break;
|
break;
|
||||||
case PairState::Paired:
|
case PairState::Paired:
|
||||||
m_pairState = PairState::NotPaired;
|
m_pairState = PairState::NotPaired;
|
||||||
Q_EMIT unpaired();
|
Q_EMIT unpaired();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -140,7 +140,8 @@ void PairingHandler::pairingTimeout()
|
||||||
Q_EMIT pairingFailed(i18n("Timed out"));
|
Q_EMIT pairingFailed(i18n("Timed out"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void PairingHandler::pairingDone() {
|
void PairingHandler::pairingDone()
|
||||||
|
{
|
||||||
qCDebug(KDECONNECT_CORE) << "Pairing done";
|
qCDebug(KDECONNECT_CORE) << "Pairing done";
|
||||||
m_pairState = PairState::Paired;
|
m_pairState = PairState::Paired;
|
||||||
Q_EMIT pairingSuccessful();
|
Q_EMIT pairingSuccessful();
|
||||||
|
|
|
@ -24,7 +24,10 @@ public:
|
||||||
|
|
||||||
void packetReceived(const NetworkPacket &np);
|
void packetReceived(const NetworkPacket &np);
|
||||||
|
|
||||||
PairState pairState() { return m_pairState; }
|
PairState pairState()
|
||||||
|
{
|
||||||
|
return m_pairState;
|
||||||
|
}
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
bool requestPairing();
|
bool requestPairing();
|
||||||
|
@ -38,7 +41,6 @@ Q_SIGNALS:
|
||||||
void pairingSuccessful();
|
void pairingSuccessful();
|
||||||
void unpaired();
|
void unpaired();
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void pairingDone();
|
void pairingDone();
|
||||||
|
|
||||||
|
@ -48,7 +50,6 @@ private:
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void pairingTimeout();
|
void pairingTimeout();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // KDECONNECT_PAIRINGHANDLER_H
|
#endif // KDECONNECT_PAIRINGHANDLER_H
|
||||||
|
|
|
@ -108,7 +108,6 @@ void Daemon::removeDevice(Device *device)
|
||||||
Q_EMIT deviceListChanged();
|
Q_EMIT deviceListChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Daemon::forceOnNetworkChange()
|
void Daemon::forceOnNetworkChange()
|
||||||
{
|
{
|
||||||
qCDebug(KDECONNECT_CORE) << "Sending onNetworkChange to" << d->m_linkProviders.size() << "LinkProviders";
|
qCDebug(KDECONNECT_CORE) << "Sending onNetworkChange to" << d->m_linkProviders.size() << "LinkProviders";
|
||||||
|
|
|
@ -50,7 +50,7 @@ public:
|
||||||
|
|
||||||
QMultiMap<QString, KdeConnectPlugin *> m_pluginsByIncomingCapability;
|
QMultiMap<QString, KdeConnectPlugin *> m_pluginsByIncomingCapability;
|
||||||
QSet<QString> m_supportedPlugins;
|
QSet<QString> m_supportedPlugins;
|
||||||
PairingHandler* m_pairingHandler;
|
PairingHandler *m_pairingHandler;
|
||||||
};
|
};
|
||||||
|
|
||||||
static void warn(const QString &info)
|
static void warn(const QString &info)
|
||||||
|
@ -387,7 +387,6 @@ bool Device::isPairRequested() const
|
||||||
return d->m_pairingHandler->pairState() == PairState::Requested;
|
return d->m_pairingHandler->pairState() == PairState::Requested;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Device::isPairRequestedByPeer() const
|
bool Device::isPairRequestedByPeer() const
|
||||||
{
|
{
|
||||||
return d->m_pairingHandler->pairState() == PairState::RequestedByPeer;
|
return d->m_pairingHandler->pairState() == PairState::RequestedByPeer;
|
||||||
|
|
|
@ -11,11 +11,11 @@
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <qalgorithms.h>
|
|
||||||
#include <QNetworkAccessManager>
|
#include <QNetworkAccessManager>
|
||||||
|
#include <qalgorithms.h>
|
||||||
|
|
||||||
#include <KLocalizedString>
|
|
||||||
#include <KFileUtils>
|
#include <KFileUtils>
|
||||||
|
#include <KLocalizedString>
|
||||||
|
|
||||||
FileTransferJob::FileTransferJob(const NetworkPacket *np, const QUrl &destination)
|
FileTransferJob::FileTransferJob(const NetworkPacket *np, const QUrl &destination)
|
||||||
: KJob()
|
: KJob()
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
|
* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef PAIR_STATE_H
|
#ifndef PAIR_STATE_H
|
||||||
#define PAIR_STATE_H
|
#define PAIR_STATE_H
|
||||||
|
|
||||||
|
|
|
@ -13,9 +13,9 @@
|
||||||
#include <QStaticPlugin>
|
#include <QStaticPlugin>
|
||||||
#include <QVector>
|
#include <QVector>
|
||||||
|
|
||||||
#include "kdeconnectconfig.h"
|
|
||||||
#include "core_debug.h"
|
#include "core_debug.h"
|
||||||
#include "device.h"
|
#include "device.h"
|
||||||
|
#include "kdeconnectconfig.h"
|
||||||
#include "kdeconnectplugin.h"
|
#include "kdeconnectplugin.h"
|
||||||
|
|
||||||
// In older Qt released, qAsConst isnt available
|
// In older Qt released, qAsConst isnt available
|
||||||
|
@ -124,12 +124,13 @@ QSet<QString> PluginLoader::pluginsForCapabilities(const QSet<QString> &incoming
|
||||||
QString myDeviceType = KdeConnectConfig::instance().deviceType().toString();
|
QString myDeviceType = KdeConnectConfig::instance().deviceType().toString();
|
||||||
|
|
||||||
for (const KPluginMetaData &service : qAsConst(plugins)) {
|
for (const KPluginMetaData &service : qAsConst(plugins)) {
|
||||||
|
|
||||||
// Check if the plugin support this device type
|
// Check if the plugin support this device type
|
||||||
const QSet<QString> supportedDeviceTypes = KPluginMetaData::readStringList(service.rawData(), QStringLiteral("X-KdeConnect-SupportedDeviceTypes")).toSet();
|
const QSet<QString> supportedDeviceTypes =
|
||||||
|
KPluginMetaData::readStringList(service.rawData(), QStringLiteral("X-KdeConnect-SupportedDeviceTypes")).toSet();
|
||||||
if (!supportedDeviceTypes.isEmpty()) {
|
if (!supportedDeviceTypes.isEmpty()) {
|
||||||
if (!supportedDeviceTypes.contains(myDeviceType)) {
|
if (!supportedDeviceTypes.contains(myDeviceType)) {
|
||||||
qCDebug(KDECONNECT_CORE) << "Not loading plugin" << service.pluginId() << "because this device of type" << myDeviceType << "is not supported. Supports:" << supportedDeviceTypes.toList().join(QStringLiteral(", "));
|
qCDebug(KDECONNECT_CORE) << "Not loading plugin" << service.pluginId() << "because this device of type" << myDeviceType
|
||||||
|
<< "is not supported. Supports:" << supportedDeviceTypes.toList().join(QStringLiteral(", "));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -142,15 +143,15 @@ QSet<QString> PluginLoader::pluginsForCapabilities(const QSet<QString> &incoming
|
||||||
|
|
||||||
bool capabilitiesEmpty = (pluginIncomingCapabilities.isEmpty() && pluginOutgoingCapabilities.isEmpty());
|
bool capabilitiesEmpty = (pluginIncomingCapabilities.isEmpty() && pluginOutgoingCapabilities.isEmpty());
|
||||||
if (!capabilitiesEmpty) {
|
if (!capabilitiesEmpty) {
|
||||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0))
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0))
|
||||||
bool capabilitiesIntersect = (outgoing.intersects(pluginIncomingCapabilities) || incoming.intersects(pluginOutgoingCapabilities));
|
bool capabilitiesIntersect = (outgoing.intersects(pluginIncomingCapabilities) || incoming.intersects(pluginOutgoingCapabilities));
|
||||||
#else
|
#else
|
||||||
QSet<QString> commonIncoming = incoming;
|
QSet<QString> commonIncoming = incoming;
|
||||||
commonIncoming.intersect(pluginOutgoingCapabilities);
|
commonIncoming.intersect(pluginOutgoingCapabilities);
|
||||||
QSet<QString> commonOutgoing = outgoing;
|
QSet<QString> commonOutgoing = outgoing;
|
||||||
commonOutgoing.intersect(pluginIncomingCapabilities);
|
commonOutgoing.intersect(pluginIncomingCapabilities);
|
||||||
bool capabilitiesIntersect = (!commonIncoming.isEmpty() || !commonOutgoing.isEmpty());
|
bool capabilitiesIntersect = (!commonIncoming.isEmpty() || !commonOutgoing.isEmpty());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!capabilitiesIntersect) {
|
if (!capabilitiesIntersect) {
|
||||||
qCDebug(KDECONNECT_CORE) << "Not loading plugin" << service.pluginId() << "because device doesn't support it";
|
qCDebug(KDECONNECT_CORE) << "Not loading plugin" << service.pluginId() << "because device doesn't support it";
|
||||||
|
@ -160,7 +161,6 @@ QSet<QString> PluginLoader::pluginsForCapabilities(const QSet<QString> &incoming
|
||||||
|
|
||||||
// If we get here, the plugin can be loaded
|
// If we get here, the plugin can be loaded
|
||||||
ret += service.pluginId();
|
ret += service.pluginId();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
@ -20,10 +20,10 @@
|
||||||
|
|
||||||
#include <KAboutData>
|
#include <KAboutData>
|
||||||
#include <KDBusService>
|
#include <KDBusService>
|
||||||
|
#include <KIO/Global>
|
||||||
#include <KLocalizedString>
|
#include <KLocalizedString>
|
||||||
#include <KNotification>
|
#include <KNotification>
|
||||||
#include <KWindowSystem>
|
#include <KWindowSystem>
|
||||||
#include <KIO/Global>
|
|
||||||
|
|
||||||
#include <dbushelper.h>
|
#include <dbushelper.h>
|
||||||
|
|
||||||
|
|
|
@ -7,16 +7,16 @@
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QIcon>
|
#include <QIcon>
|
||||||
#include <QStandardPaths>
|
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
|
#include <QStandardPaths>
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
#include <tlhelp32.h>
|
#include <tlhelp32.h>
|
||||||
|
|
||||||
#include <winrt/Windows.UI.ViewManagement.h>
|
|
||||||
#include <winrt/Windows.Foundation.Collections.h>
|
#include <winrt/Windows.Foundation.Collections.h>
|
||||||
|
#include <winrt/Windows.UI.ViewManagement.h>
|
||||||
|
|
||||||
#include "indicator_debug.h"
|
#include "indicator_debug.h"
|
||||||
#include "indicatorhelper.h"
|
#include "indicatorhelper.h"
|
||||||
|
@ -70,9 +70,11 @@ void onThemeChanged(QSystemTrayIcon &systray)
|
||||||
QSettings registry(QStringLiteral("HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"), QSettings::Registry64Format);
|
QSettings registry(QStringLiteral("HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"), QSettings::Registry64Format);
|
||||||
bool isLightTheme = registry.value(QStringLiteral("SystemUsesLightTheme")).toBool();
|
bool isLightTheme = registry.value(QStringLiteral("SystemUsesLightTheme")).toBool();
|
||||||
if (isLightTheme) {
|
if (isLightTheme) {
|
||||||
systray.setIcon(QIcon(QStandardPaths::locate(QStandardPaths::AppLocalDataLocation, QStringLiteral("icons/hicolor/scalable/apps/kdeconnectindicator.svg"))));
|
systray.setIcon(
|
||||||
|
QIcon(QStandardPaths::locate(QStandardPaths::AppLocalDataLocation, QStringLiteral("icons/hicolor/scalable/apps/kdeconnectindicator.svg"))));
|
||||||
} else {
|
} else {
|
||||||
systray.setIcon(QIcon(QStandardPaths::locate(QStandardPaths::AppLocalDataLocation, QStringLiteral("icons/hicolor/scalable/apps/kdeconnectindicatordark.svg"))));
|
systray.setIcon(
|
||||||
|
QIcon(QStandardPaths::locate(QStandardPaths::AppLocalDataLocation, QStringLiteral("icons/hicolor/scalable/apps/kdeconnectindicatordark.svg"))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -226,15 +226,21 @@ ShareDbusInterface::ShareDbusInterface(const QString &deviceId, QObject *parent)
|
||||||
|
|
||||||
ShareDbusInterface::~ShareDbusInterface() = default;
|
ShareDbusInterface::~ShareDbusInterface() = default;
|
||||||
|
|
||||||
PhotoDbusInterface::PhotoDbusInterface(const QString& deviceId, QObject* parent):
|
PhotoDbusInterface::PhotoDbusInterface(const QString &deviceId, QObject *parent)
|
||||||
OrgKdeKdeconnectDevicePhotoInterface(DaemonDbusInterface::activatedService(), QStringLiteral("/modules/kdeconnect/devices/") + deviceId + QStringLiteral("/photo"), QDBusConnection::sessionBus(), parent)
|
: OrgKdeKdeconnectDevicePhotoInterface(DaemonDbusInterface::activatedService(),
|
||||||
|
QStringLiteral("/modules/kdeconnect/devices/") + deviceId + QStringLiteral("/photo"),
|
||||||
|
QDBusConnection::sessionBus(),
|
||||||
|
parent)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
PhotoDbusInterface::~PhotoDbusInterface() = default;
|
PhotoDbusInterface::~PhotoDbusInterface() = default;
|
||||||
|
|
||||||
RemoteSystemVolumeDbusInterface::RemoteSystemVolumeDbusInterface(const QString& deviceId, QObject* parent):
|
RemoteSystemVolumeDbusInterface::RemoteSystemVolumeDbusInterface(const QString &deviceId, QObject *parent)
|
||||||
OrgKdeKdeconnectDeviceRemotesystemvolumeInterface(DaemonDbusInterface::activatedService(), QStringLiteral("/modules/kdeconnect/devices/") + deviceId + QStringLiteral("/remotesystemvolume"), QDBusConnection::sessionBus(), parent)
|
: OrgKdeKdeconnectDeviceRemotesystemvolumeInterface(DaemonDbusInterface::activatedService(),
|
||||||
|
QStringLiteral("/modules/kdeconnect/devices/") + deviceId + QStringLiteral("/remotesystemvolume"),
|
||||||
|
QDBusConnection::sessionBus(),
|
||||||
|
parent)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -231,17 +231,15 @@ public:
|
||||||
~ShareDbusInterface() override;
|
~ShareDbusInterface() override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class KDECONNECTINTERFACES_EXPORT PhotoDbusInterface
|
class KDECONNECTINTERFACES_EXPORT PhotoDbusInterface : public OrgKdeKdeconnectDevicePhotoInterface
|
||||||
: public OrgKdeKdeconnectDevicePhotoInterface
|
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit PhotoDbusInterface(const QString& deviceId, QObject* parent = nullptr);
|
explicit PhotoDbusInterface(const QString &deviceId, QObject *parent = nullptr);
|
||||||
~PhotoDbusInterface() override;
|
~PhotoDbusInterface() override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class KDECONNECTINTERFACES_EXPORT RemoteSystemVolumeDbusInterface
|
class KDECONNECTINTERFACES_EXPORT RemoteSystemVolumeDbusInterface : public OrgKdeKdeconnectDeviceRemotesystemvolumeInterface
|
||||||
: public OrgKdeKdeconnectDeviceRemotesystemvolumeInterface
|
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -278,7 +278,6 @@ void KdeConnectKcm::pairingFailed(const QString &error)
|
||||||
kcmUi->messages->animatedShow();
|
kcmUi->messages->animatedShow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void KdeConnectKcm::setCurrentDevicePairState(int pairStateAsInt)
|
void KdeConnectKcm::setCurrentDevicePairState(int pairStateAsInt)
|
||||||
{
|
{
|
||||||
PairState state = (PairState)pairStateAsInt; // Hack because qdbus doesn't like enums
|
PairState state = (PairState)pairStateAsInt; // Hack because qdbus doesn't like enums
|
||||||
|
|
|
@ -51,7 +51,6 @@ private Q_SLOTS:
|
||||||
void acceptPairing();
|
void acceptPairing();
|
||||||
void cancelPairing();
|
void cancelPairing();
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void resetDeviceView();
|
void resetDeviceView();
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
K_PLUGIN_FACTORY(ClipboardConfigFactory, registerPlugin<ClipboardConfig>();)
|
K_PLUGIN_FACTORY(ClipboardConfigFactory, registerPlugin<ClipboardConfig>();)
|
||||||
|
|
||||||
ClipboardConfig::ClipboardConfig(QWidget* parent, const QVariantList &args)
|
ClipboardConfig::ClipboardConfig(QWidget *parent, const QVariantList &args)
|
||||||
: KdeConnectPluginKcm(parent, args, QStringLiteral("kdeconnect_clipboard"))
|
: KdeConnectPluginKcm(parent, args, QStringLiteral("kdeconnect_clipboard"))
|
||||||
, m_ui(new Ui::ClipboardConfigUi())
|
, m_ui(new Ui::ClipboardConfigUi())
|
||||||
{
|
{
|
||||||
|
|
|
@ -9,16 +9,16 @@
|
||||||
|
|
||||||
#include "kcmplugin/kdeconnectpluginkcm.h"
|
#include "kcmplugin/kdeconnectpluginkcm.h"
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui
|
||||||
class ClipboardConfigUi;
|
{
|
||||||
|
class ClipboardConfigUi;
|
||||||
}
|
}
|
||||||
|
|
||||||
class ClipboardConfig
|
class ClipboardConfig : public KdeConnectPluginKcm
|
||||||
: public KdeConnectPluginKcm
|
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
ClipboardConfig(QWidget *parent, const QVariantList&);
|
ClipboardConfig(QWidget *parent, const QVariantList &);
|
||||||
~ClipboardConfig() override;
|
~ClipboardConfig() override;
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
|
@ -29,7 +29,6 @@ public Q_SLOTS:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::ClipboardConfigUi *m_ui;
|
Ui::ClipboardConfigUi *m_ui;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -187,12 +187,12 @@ void Notification::reply()
|
||||||
Q_EMIT replyRequested();
|
Q_EMIT replyRequested();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Notification::sendReply(const QString& message)
|
void Notification::sendReply(const QString &message)
|
||||||
{
|
{
|
||||||
Q_EMIT replied(message);
|
Q_EMIT replied(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Notification::parseNetworkPacket(const NetworkPacket& np)
|
void Notification::parseNetworkPacket(const NetworkPacket &np)
|
||||||
{
|
{
|
||||||
m_internalId = np.get<QString>(QStringLiteral("id"));
|
m_internalId = np.get<QString>(QStringLiteral("id"));
|
||||||
m_appName = np.get<QString>(QStringLiteral("appName"));
|
m_appName = np.get<QString>(QStringLiteral("appName"));
|
||||||
|
|
|
@ -86,7 +86,7 @@ public:
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
Q_SCRIPTABLE void dismiss();
|
Q_SCRIPTABLE void dismiss();
|
||||||
Q_SCRIPTABLE void reply();
|
Q_SCRIPTABLE void reply();
|
||||||
Q_SCRIPTABLE void sendReply(const QString& message);
|
Q_SCRIPTABLE void sendReply(const QString &message);
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void dismissRequested(const QString &m_internalId);
|
void dismissRequested(const QString &m_internalId);
|
||||||
|
|
|
@ -117,12 +117,7 @@ void RemoteKeyboardPlugin::sendQKeyEvent(const QVariantMap &keyEvent, bool sendA
|
||||||
text = QKeySequence(key).toString().toLower();
|
text = QKeySequence(key).toString().toLower();
|
||||||
}
|
}
|
||||||
|
|
||||||
sendKeyPress(text,
|
sendKeyPress(text, k, modifiers & Qt::ShiftModifier, modifiers & Qt::ControlModifier, modifiers & Qt::AltModifier, sendAck);
|
||||||
k,
|
|
||||||
modifiers & Qt::ShiftModifier,
|
|
||||||
modifiers & Qt::ControlModifier,
|
|
||||||
modifiers & Qt::AltModifier,
|
|
||||||
sendAck);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int RemoteKeyboardPlugin::translateQtKey(int qtKey) const
|
int RemoteKeyboardPlugin::translateQtKey(int qtKey) const
|
||||||
|
|
|
@ -7,11 +7,11 @@
|
||||||
#include "runcommand_config.h"
|
#include "runcommand_config.h"
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include <QFileDialog>
|
||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
#include <QHeaderView>
|
#include <QHeaderView>
|
||||||
#include <QJsonDocument>
|
|
||||||
#include <QJsonArray>
|
#include <QJsonArray>
|
||||||
#include <QFileDialog>
|
#include <QJsonDocument>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include <QStandardItemModel>
|
#include <QStandardItemModel>
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
#include <KLocalizedString>
|
#include <KLocalizedString>
|
||||||
|
|
||||||
//#include "modeltest.h"
|
// #include "modeltest.h"
|
||||||
|
|
||||||
NotifyingApplicationModel::NotifyingApplicationModel(QObject *parent)
|
NotifyingApplicationModel::NotifyingApplicationModel(QObject *parent)
|
||||||
: QAbstractTableModel(parent)
|
: QAbstractTableModel(parent)
|
||||||
|
|
|
@ -445,7 +445,6 @@ bool SystemvolumePlugin::receivePacket(const NetworkPacket &np)
|
||||||
setDefaultAudioPlaybackDevice(name, np.get<bool>(QStringLiteral("enabled")));
|
setDefaultAudioPlaybackDevice(name, np.get<bool>(QStringLiteral("enabled")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue