diff --git a/cli/kdeconnect-cli.cpp b/cli/kdeconnect-cli.cpp index 40dd6c50e..c3324cc9a 100644 --- a/cli/kdeconnect-cli.cpp +++ b/cli/kdeconnect-cli.cpp @@ -167,7 +167,7 @@ int main(int argc, char** argv) } } else if(parser.isSet(QStringLiteral("refresh"))) { QDBusMessage msg = QDBusMessage::createMethodCall(QStringLiteral("org.kde.kdeconnect"), QStringLiteral("/modules/kdeconnect"), QStringLiteral("org.kde.kdeconnect.daemon"), QStringLiteral("forceOnNetworkChange")); - blockOnReply(DbusHelper::sessionBus().asyncCall(msg)); + blockOnReply(DBusHelper::sessionBus().asyncCall(msg)); } else { QString device = parser.value(QStringLiteral("device")); @@ -200,7 +200,7 @@ int main(int argc, char** argv) QStringLiteral("org.kde.kdeconnect.device.share"), QStringLiteral("shareUrls")); msg.setArguments(QVariantList() << QVariant(urls)); - blockOnReply(DbusHelper::sessionBus().asyncCall(msg)); + blockOnReply(DBusHelper::sessionBus().asyncCall(msg)); for (const QString& url : qAsConst(urls)) { QTextStream(stdout) << i18n("Shared %1", url) << endl; @@ -208,7 +208,7 @@ int main(int argc, char** argv) } else if (parser.isSet(QStringLiteral("share-text"))) { QDBusMessage msg = QDBusMessage::createMethodCall(QStringLiteral("org.kde.kdeconnect"), QStringLiteral("/modules/kdeconnect/devices/") + device + QStringLiteral("/share"), QStringLiteral("org.kde.kdeconnect.device.share"), QStringLiteral("shareText")); msg.setArguments(QVariantList() << parser.value(QStringLiteral("share-text"))); - blockOnReply(DbusHelper::sessionBus().asyncCall(msg)); + blockOnReply(DBusHelper::sessionBus().asyncCall(msg)); QTextStream(stdout) << i18n("Shared text: %1", parser.value(QStringLiteral("share-text"))) << endl; } else if(parser.isSet(QStringLiteral("pair"))) { DeviceDbusInterface dev(device); @@ -251,22 +251,22 @@ int main(int argc, char** argv) QString message = parser.value(QStringLiteral("ping-msg")); msg.setArguments(QVariantList() << message); } - blockOnReply(DbusHelper::sessionBus().asyncCall(msg)); + blockOnReply(DBusHelper::sessionBus().asyncCall(msg)); } else if(parser.isSet(QStringLiteral("send-sms"))) { if (parser.isSet(QStringLiteral("destination"))) { QDBusMessage msg = QDBusMessage::createMethodCall(QStringLiteral("org.kde.kdeconnect"), QStringLiteral("/modules/kdeconnect/devices/") + device + QStringLiteral("/sms"), QStringLiteral("org.kde.kdeconnect.device.sms"), QStringLiteral("sendSms")); msg.setArguments({ parser.value(QStringLiteral("destination")), parser.value(QStringLiteral("send-sms"))}); - blockOnReply(DbusHelper::sessionBus().asyncCall(msg)); + blockOnReply(DBusHelper::sessionBus().asyncCall(msg)); } else { QTextStream(stderr) << i18n("error: should specify the SMS's recipient by passing --destination "); return 1; } } else if(parser.isSet(QStringLiteral("ring"))) { QDBusMessage msg = QDBusMessage::createMethodCall(QStringLiteral("org.kde.kdeconnect"), QStringLiteral("/modules/kdeconnect/devices/") + device + QStringLiteral("/findmyphone"), QStringLiteral("org.kde.kdeconnect.device.findmyphone"), QStringLiteral("ring")); - blockOnReply(DbusHelper::sessionBus().asyncCall(msg)); + blockOnReply(DBusHelper::sessionBus().asyncCall(msg)); } else if(parser.isSet(QStringLiteral("photo"))) { QDBusMessage msg = QDBusMessage::createMethodCall(QStringLiteral("org.kde.kdeconnect"), QStringLiteral("/modules/kdeconnect/devices/") + device + QStringLiteral("/photo"), QStringLiteral("org.kde.kdeconnect.device.photo"), QStringLiteral("requestPhoto")); - blockOnReply(DbusHelper::sessionBus().asyncCall(msg)); + blockOnReply(DBusHelper::sessionBus().asyncCall(msg)); } else if(parser.isSet(QStringLiteral("send-keys"))) { QString seq = parser.value(QStringLiteral("send-keys")); QDBusMessage msg = QDBusMessage::createMethodCall(QStringLiteral("org.kde.kdeconnect"), QStringLiteral("/modules/kdeconnect/devices/") + device + QStringLiteral("/remotekeyboard"), QStringLiteral("org.kde.kdeconnect.device.remotekeyboard"), QStringLiteral("sendKeyPress")); @@ -277,13 +277,13 @@ int main(int argc, char** argv) while (!in.atEnd()) { QByteArray line = in.readLine(); // sanitize to ASCII-codes > 31? msg.setArguments({QString::fromLatin1(line), -1, false, false, false}); - blockOnReply(DbusHelper::sessionBus().asyncCall(msg)); + blockOnReply(DBusHelper::sessionBus().asyncCall(msg)); } in.close(); } } else { msg.setArguments({seq, -1, false, false, false}); - blockOnReply(DbusHelper::sessionBus().asyncCall(msg)); + blockOnReply(DBusHelper::sessionBus().asyncCall(msg)); } } else if(parser.isSet(QStringLiteral("list-notifications"))) { NotificationsModel notifications; diff --git a/core/daemon.cpp b/core/daemon.cpp index 1fdfe68a8..11065e0b3 100644 --- a/core/daemon.cpp +++ b/core/daemon.cpp @@ -108,8 +108,8 @@ void Daemon::init() //Register on DBus qDBusRegisterMetaType< QMap >(); - DbusHelper::sessionBus().registerService(QStringLiteral("org.kde.kdeconnect")); - DbusHelper::sessionBus().registerObject(QStringLiteral("/modules/kdeconnect"), this, QDBusConnection::ExportScriptableContents); + DBusHelper::sessionBus().registerService(QStringLiteral("org.kde.kdeconnect")); + DBusHelper::sessionBus().registerObject(QStringLiteral("/modules/kdeconnect"), this, QDBusConnection::ExportScriptableContents); NotificationServerInfo::instance().init(); diff --git a/core/dbushelper.cpp b/core/dbushelper.cpp index 2415849df..97ecae9ba 100644 --- a/core/dbushelper.cpp +++ b/core/dbushelper.cpp @@ -36,7 +36,7 @@ #include #endif -namespace DbusHelper { +namespace DBusHelper { #ifdef USE_PRIVATE_DBUS class DBusInstancePrivate diff --git a/core/dbushelper.h.in b/core/dbushelper.h.in index afcf392b2..2ae8f6ae0 100644 --- a/core/dbushelper.h.in +++ b/core/dbushelper.h.in @@ -30,7 +30,7 @@ #define KDECONNECT_SESSION_DBUS_LAUNCHD_ENV "DBUS_LAUNCHD_SESSION_BUS_SOCKET" -namespace DbusHelper { +namespace DBusHelper { void KDECONNECTCORE_EXPORT filterNonExportableCharacters(QString& s); #ifdef USE_PRIVATE_DBUS diff --git a/core/device.cpp b/core/device.cpp index 5670f2fea..18e35ec94 100644 --- a/core/device.cpp +++ b/core/device.cpp @@ -87,7 +87,7 @@ Device::Device(QObject* parent, const QString& id) d->m_deviceType = str2type(info.deviceType); //Register in bus - DbusHelper::sessionBus().registerObject(dbusPath(), this, QDBusConnection::ExportScriptableContents | QDBusConnection::ExportAdaptors); + DBusHelper::sessionBus().registerObject(dbusPath(), this, QDBusConnection::ExportScriptableContents | QDBusConnection::ExportAdaptors); //Assume every plugin is supported until addLink is called and we can get the actual list d->m_allPlugins = PluginLoader::instance()->getPluginList().toSet(); @@ -106,7 +106,7 @@ Device::Device(QObject* parent, const NetworkPacket& identityPacket, DeviceLink* addLink(identityPacket, dl); //Register in bus - DbusHelper::sessionBus().registerObject(dbusPath(), this, QDBusConnection::ExportScriptableContents | QDBusConnection::ExportAdaptors); + DBusHelper::sessionBus().registerObject(dbusPath(), this, QDBusConnection::ExportScriptableContents | QDBusConnection::ExportAdaptors); connect(this, &Device::pairingError, this, &warn); @@ -199,7 +199,7 @@ void Device::reloadPlugins() d->m_plugins = newPluginMap; d->m_pluginsByIncomingCapability = newPluginsByIncomingCapability; - QDBusConnection bus = DbusHelper::sessionBus(); + QDBusConnection bus = DBusHelper::sessionBus(); for (KdeConnectPlugin* plugin : qAsConst(d->m_plugins)) { //TODO: see how it works in Android (only done once, when created) plugin->connected(); diff --git a/core/kdeconnectconfig.cpp b/core/kdeconnectconfig.cpp index 8c2bb5cc8..b705a583b 100644 --- a/core/kdeconnectconfig.cpp +++ b/core/kdeconnectconfig.cpp @@ -295,7 +295,7 @@ void KdeConnectConfig::generateCertificate(const QString& certPath) bool error = false; QString uuid = QUuid::createUuid().toString(); - DbusHelper::filterNonExportableCharacters(uuid); + DBusHelper::filterNonExportableCharacters(uuid); qCDebug(KDECONNECT_CORE) << "My id:" << uuid; // FIXME: We only use QCA here to generate the cert and key, would be nice to get rid of it completely. diff --git a/core/kdeconnectpluginconfig.cpp b/core/kdeconnectpluginconfig.cpp index a59975e59..7a560c169 100644 --- a/core/kdeconnectpluginconfig.cpp +++ b/core/kdeconnectpluginconfig.cpp @@ -43,7 +43,7 @@ KdeConnectPluginConfig::KdeConnectPluginConfig(const QString& deviceId, const QS d->m_config = new QSettings(d->m_configDir.absoluteFilePath(QStringLiteral("config")), QSettings::IniFormat); d->m_signal = QDBusMessage::createSignal(QStringLiteral("/kdeconnect/") + deviceId + QStringLiteral("/") + pluginName, QStringLiteral("org.kde.kdeconnect.config"), QStringLiteral("configChanged")); - DbusHelper::sessionBus().connect(QLatin1String(""), QStringLiteral("/kdeconnect/") + deviceId + QStringLiteral("/") + pluginName, QStringLiteral("org.kde.kdeconnect.config"), QStringLiteral("configChanged"), this, SLOT(slotConfigChanged())); + DBusHelper::sessionBus().connect(QLatin1String(""), QStringLiteral("/kdeconnect/") + deviceId + QStringLiteral("/") + pluginName, QStringLiteral("org.kde.kdeconnect.config"), QStringLiteral("configChanged"), this, SLOT(slotConfigChanged())); } KdeConnectPluginConfig::~KdeConnectPluginConfig() @@ -79,7 +79,7 @@ void KdeConnectPluginConfig::set(const QString& key, const QVariant& value) { d->m_config->setValue(key, value); d->m_config->sync(); - DbusHelper::sessionBus().send(d->m_signal); + DBusHelper::sessionBus().send(d->m_signal); } void KdeConnectPluginConfig::setList(const QString& key, const QVariantList& list) @@ -91,7 +91,7 @@ void KdeConnectPluginConfig::setList(const QString& key, const QVariantList& lis } d->m_config->endArray(); d->m_config->sync(); - DbusHelper::sessionBus().send(d->m_signal); + DBusHelper::sessionBus().send(d->m_signal); } void KdeConnectPluginConfig::slotConfigChanged() diff --git a/core/networkpacket.cpp b/core/networkpacket.cpp index ee9f8a36c..98f38188d 100644 --- a/core/networkpacket.cpp +++ b/core/networkpacket.cpp @@ -157,7 +157,7 @@ bool NetworkPacket::unserialize(const QByteArray& a, NetworkPacket* np) if (np->m_body.contains(QStringLiteral("deviceId"))) { QString deviceId = np->get(QStringLiteral("deviceId")); - DbusHelper::filterNonExportableCharacters(deviceId); + DBusHelper::filterNonExportableCharacters(deviceId); np->set(QStringLiteral("deviceId"), deviceId); } diff --git a/core/notificationserverinfo.cpp b/core/notificationserverinfo.cpp index 862ea82c1..bddda1388 100644 --- a/core/notificationserverinfo.cpp +++ b/core/notificationserverinfo.cpp @@ -38,7 +38,7 @@ void NotificationServerInfo::init() { QDBusMessage query = QDBusMessage::createMethodCall(QStringLiteral("org.freedesktop.Notifications"), QStringLiteral("/org/freedesktop/Notifications"), QStringLiteral("org.freedesktop.Notifications"), QStringLiteral("GetCapabilities")); - QDBusPendingReply reply = DbusHelper::sessionBus().asyncCall(query); + QDBusPendingReply reply = DBusHelper::sessionBus().asyncCall(query); QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(reply, this); connect(watcher, &QDBusPendingCallWatcher::finished, this, [this, reply, watcher] { watcher->deleteLater(); diff --git a/daemon/kdeconnectd.cpp b/daemon/kdeconnectd.cpp index 69dca9744..f106384fe 100644 --- a/daemon/kdeconnectd.cpp +++ b/daemon/kdeconnectd.cpp @@ -139,7 +139,7 @@ int main(int argc, char* argv[]) app.setQuitOnLastWindowClosed(false); #ifdef USE_PRIVATE_DBUS - DbusHelper::launchDBusDaemon(); + DBusHelper::launchDBusDaemon(); #endif QCommandLineParser parser; @@ -154,7 +154,7 @@ int main(int argc, char* argv[]) QStringLiteral("/MainApplication"), QStringLiteral("org.qtproject.Qt.QCoreApplication"), QStringLiteral("quit")); - DbusHelper::sessionBus().call(message); //deliberately block until it's done, so we register the name after the app quits + DBusHelper::sessionBus().call(message); //deliberately block until it's done, so we register the name after the app quits } KDBusService dbusService(KDBusService::Unique); diff --git a/fileitemactionplugin/sendfileitemaction.cpp b/fileitemactionplugin/sendfileitemaction.cpp index 619475972..6d6f47387 100644 --- a/fileitemactionplugin/sendfileitemaction.cpp +++ b/fileitemactionplugin/sendfileitemaction.cpp @@ -94,7 +94,7 @@ void SendFileItemAction::sendFile() for (const QUrl& url : urls) { QDBusMessage msg = QDBusMessage::createMethodCall(QStringLiteral("org.kde.kdeconnect"), QStringLiteral("/modules/kdeconnect/devices/") + id + QStringLiteral("/share"), QStringLiteral("org.kde.kdeconnect.device.share"), QStringLiteral("shareUrl")); msg.setArguments(QVariantList() << url.toString()); - DbusHelper::sessionBus().call(msg); + DBusHelper::sessionBus().call(msg); } } diff --git a/indicator/deviceindicator.cpp b/indicator/deviceindicator.cpp index 8369f95d7..20cf22927 100644 --- a/indicator/deviceindicator.cpp +++ b/indicator/deviceindicator.cpp @@ -108,7 +108,7 @@ DeviceIndicator::DeviceIndicator(DeviceDbusInterface* device) QDBusMessage msg = QDBusMessage::createMethodCall(QStringLiteral("org.kde.kdeconnect"), QStringLiteral("/modules/kdeconnect/devices/") + device->id() + QStringLiteral("/share"), QStringLiteral("org.kde.kdeconnect.device.share"), QStringLiteral("shareUrl")); msg.setArguments(QVariantList() << url.toString()); - DbusHelper::sessionBus().call(msg); + DBusHelper::sessionBus().call(msg); }); setWhenAvailable(device->hasPlugin(QStringLiteral("kdeconnect_share")), [sendFile](bool available) { sendFile->setVisible(available); }, this); diff --git a/indicator/main.cpp b/indicator/main.cpp index f54fe7c9a..1e7b54fa7 100644 --- a/indicator/main.cpp +++ b/indicator/main.cpp @@ -59,7 +59,7 @@ int main(int argc, char** argv) #ifdef Q_OS_MAC // Unset launchctl env, avoid block - DbusHelper::macosUnsetLaunchctlEnv(); + DBusHelper::macosUnsetLaunchctlEnv(); // Start kdeconnectd QProcess kdeconnectdProcess; @@ -151,7 +151,7 @@ int main(int argc, char** argv) QStringLiteral("/MainApplication"), QStringLiteral("org.qtproject.Qt.QCoreApplication"), QStringLiteral("quit")); - DbusHelper::sessionBus().call(message); + DBusHelper::sessionBus().call(message); QCoreApplication::quit(); // Close this application }); #endif diff --git a/interfaces/dbusinterfaces.cpp b/interfaces/dbusinterfaces.cpp index 1340bee59..678ac53f0 100644 --- a/interfaces/dbusinterfaces.cpp +++ b/interfaces/dbusinterfaces.cpp @@ -23,7 +23,7 @@ QString DaemonDbusInterface::activatedService() { static const QString service = QStringLiteral("org.kde.kdeconnect"); - auto reply = DbusHelper::sessionBus().interface()->startService(service); + auto reply = DBusHelper::sessionBus().interface()->startService(service); if (!reply.isValid()) { qWarning() << "error activating kdeconnectd:" << reply.error(); } @@ -31,7 +31,7 @@ QString DaemonDbusInterface::activatedService() { } DaemonDbusInterface::DaemonDbusInterface(QObject* parent) - : OrgKdeKdeconnectDaemonInterface(DaemonDbusInterface::activatedService(), QStringLiteral("/modules/kdeconnect"), DbusHelper::sessionBus(), parent) + : OrgKdeKdeconnectDaemonInterface(DaemonDbusInterface::activatedService(), QStringLiteral("/modules/kdeconnect"), DBusHelper::sessionBus(), parent) { connect(this, &OrgKdeKdeconnectDaemonInterface::pairingRequestsChanged, this, &DaemonDbusInterface::pairingRequestsChangedProxy); } @@ -42,7 +42,7 @@ DaemonDbusInterface::~DaemonDbusInterface() } DeviceDbusInterface::DeviceDbusInterface(const QString& id, QObject* parent) - : OrgKdeKdeconnectDeviceInterface(DaemonDbusInterface::activatedService(), QStringLiteral("/modules/kdeconnect/devices/") +id, DbusHelper::sessionBus(), parent) + : OrgKdeKdeconnectDeviceInterface(DaemonDbusInterface::activatedService(), QStringLiteral("/modules/kdeconnect/devices/") +id, DBusHelper::sessionBus(), parent) , m_id(id) { connect(this, &OrgKdeKdeconnectDeviceInterface::trustedChanged, this, &DeviceDbusInterface::trustedChangedProxy); @@ -64,11 +64,11 @@ QString DeviceDbusInterface::id() const void DeviceDbusInterface::pluginCall(const QString& plugin, const QString& method) { QDBusMessage msg = QDBusMessage::createMethodCall(QStringLiteral("org.kde.kdeconnect"), QStringLiteral("/modules/kdeconnect/devices/") +id() + QStringLiteral("/") + plugin, QStringLiteral("org.kde.kdeconnect.device.") + plugin, method); - DbusHelper::sessionBus().asyncCall(msg); + DBusHelper::sessionBus().asyncCall(msg); } DeviceBatteryDbusInterface::DeviceBatteryDbusInterface(const QString& id, QObject* parent) - : OrgKdeKdeconnectDeviceBatteryInterface(DaemonDbusInterface::activatedService(), QStringLiteral("/modules/kdeconnect/devices/") +id, DbusHelper::sessionBus(), parent) + : OrgKdeKdeconnectDeviceBatteryInterface(DaemonDbusInterface::activatedService(), QStringLiteral("/modules/kdeconnect/devices/") +id, DBusHelper::sessionBus(), parent) { } @@ -79,7 +79,7 @@ DeviceBatteryDbusInterface::~DeviceBatteryDbusInterface() } DeviceNotificationsDbusInterface::DeviceNotificationsDbusInterface(const QString& id, QObject* parent) - : OrgKdeKdeconnectDeviceNotificationsInterface(DaemonDbusInterface::activatedService(), QStringLiteral("/modules/kdeconnect/devices/") +id, DbusHelper::sessionBus(), parent) + : OrgKdeKdeconnectDeviceNotificationsInterface(DaemonDbusInterface::activatedService(), QStringLiteral("/modules/kdeconnect/devices/") +id, DBusHelper::sessionBus(), parent) { } @@ -90,7 +90,7 @@ DeviceNotificationsDbusInterface::~DeviceNotificationsDbusInterface() } NotificationDbusInterface::NotificationDbusInterface(const QString& deviceId, const QString& notificationId, QObject* parent) - : OrgKdeKdeconnectDeviceNotificationsNotificationInterface(DaemonDbusInterface::activatedService(), QStringLiteral("/modules/kdeconnect/devices/") + deviceId + QStringLiteral("/notifications/") + notificationId, DbusHelper::sessionBus(), parent) + : OrgKdeKdeconnectDeviceNotificationsNotificationInterface(DaemonDbusInterface::activatedService(), QStringLiteral("/modules/kdeconnect/devices/") + deviceId + QStringLiteral("/notifications/") + notificationId, DBusHelper::sessionBus(), parent) , id(notificationId) { @@ -102,7 +102,7 @@ NotificationDbusInterface::~NotificationDbusInterface() } DeviceConversationsDbusInterface::DeviceConversationsDbusInterface(const QString& deviceId, QObject* parent) - : OrgKdeKdeconnectDeviceConversationsInterface(DaemonDbusInterface::activatedService(), QStringLiteral("/modules/kdeconnect/devices/") + deviceId, DbusHelper::sessionBus(), parent) + : OrgKdeKdeconnectDeviceConversationsInterface(DaemonDbusInterface::activatedService(), QStringLiteral("/modules/kdeconnect/devices/") + deviceId, DBusHelper::sessionBus(), parent) { } @@ -113,7 +113,7 @@ DeviceConversationsDbusInterface::~DeviceConversationsDbusInterface() } SftpDbusInterface::SftpDbusInterface(const QString& id, QObject* parent) - : OrgKdeKdeconnectDeviceSftpInterface(DaemonDbusInterface::activatedService(), QStringLiteral("/modules/kdeconnect/devices/") + id + QStringLiteral("/sftp"), DbusHelper::sessionBus(), parent) + : OrgKdeKdeconnectDeviceSftpInterface(DaemonDbusInterface::activatedService(), QStringLiteral("/modules/kdeconnect/devices/") + id + QStringLiteral("/sftp"), DBusHelper::sessionBus(), parent) { } @@ -124,7 +124,7 @@ SftpDbusInterface::~SftpDbusInterface() } MprisDbusInterface::MprisDbusInterface(const QString& id, QObject* parent) - : OrgKdeKdeconnectDeviceMprisremoteInterface(DaemonDbusInterface::activatedService(), QStringLiteral("/modules/kdeconnect/devices/") + id + QStringLiteral("/mprisremote"), DbusHelper::sessionBus(), parent) + : OrgKdeKdeconnectDeviceMprisremoteInterface(DaemonDbusInterface::activatedService(), QStringLiteral("/modules/kdeconnect/devices/") + id + QStringLiteral("/mprisremote"), DBusHelper::sessionBus(), parent) { connect(this, &OrgKdeKdeconnectDeviceMprisremoteInterface::propertiesChanged, this, &MprisDbusInterface::propertiesChangedProxy); } @@ -134,7 +134,7 @@ MprisDbusInterface::~MprisDbusInterface() } RemoteControlDbusInterface::RemoteControlDbusInterface(const QString& id, QObject* parent) - : OrgKdeKdeconnectDeviceRemotecontrolInterface(DaemonDbusInterface::activatedService(), QStringLiteral("/modules/kdeconnect/devices/") + id + QStringLiteral("/remotecontrol"), DbusHelper::sessionBus(), parent) + : OrgKdeKdeconnectDeviceRemotecontrolInterface(DaemonDbusInterface::activatedService(), QStringLiteral("/modules/kdeconnect/devices/") + id + QStringLiteral("/remotecontrol"), DBusHelper::sessionBus(), parent) { } @@ -143,7 +143,7 @@ RemoteControlDbusInterface::~RemoteControlDbusInterface() } LockDeviceDbusInterface::LockDeviceDbusInterface(const QString& id, QObject* parent) - : OrgKdeKdeconnectDeviceLockdeviceInterface(DaemonDbusInterface::activatedService(), QStringLiteral("/modules/kdeconnect/devices/") + id + QStringLiteral("/lockdevice"), DbusHelper::sessionBus(), parent) + : OrgKdeKdeconnectDeviceLockdeviceInterface(DaemonDbusInterface::activatedService(), QStringLiteral("/modules/kdeconnect/devices/") + id + QStringLiteral("/lockdevice"), DBusHelper::sessionBus(), parent) { connect(this, &OrgKdeKdeconnectDeviceLockdeviceInterface::lockedChanged, this, &LockDeviceDbusInterface::lockedChangedProxy); Q_ASSERT(isValid()); @@ -154,7 +154,7 @@ LockDeviceDbusInterface::~LockDeviceDbusInterface() } FindMyPhoneDeviceDbusInterface::FindMyPhoneDeviceDbusInterface(const QString& deviceId, QObject* parent): - OrgKdeKdeconnectDeviceFindmyphoneInterface(DaemonDbusInterface::activatedService(), QStringLiteral("/modules/kdeconnect/devices/") + deviceId + QStringLiteral("/findmyphone"), DbusHelper::sessionBus(), parent) + OrgKdeKdeconnectDeviceFindmyphoneInterface(DaemonDbusInterface::activatedService(), QStringLiteral("/modules/kdeconnect/devices/") + deviceId + QStringLiteral("/findmyphone"), DBusHelper::sessionBus(), parent) { } @@ -163,14 +163,14 @@ FindMyPhoneDeviceDbusInterface::~FindMyPhoneDeviceDbusInterface() } RemoteCommandsDbusInterface::RemoteCommandsDbusInterface(const QString& deviceId, QObject* parent): - OrgKdeKdeconnectDeviceRemotecommandsInterface(DaemonDbusInterface::activatedService(), QStringLiteral("/modules/kdeconnect/devices/") + deviceId + QStringLiteral("/remotecommands"), DbusHelper::sessionBus(), parent) + OrgKdeKdeconnectDeviceRemotecommandsInterface(DaemonDbusInterface::activatedService(), QStringLiteral("/modules/kdeconnect/devices/") + deviceId + QStringLiteral("/remotecommands"), DBusHelper::sessionBus(), parent) { } RemoteCommandsDbusInterface::~RemoteCommandsDbusInterface() = default; RemoteKeyboardDbusInterface::RemoteKeyboardDbusInterface(const QString& deviceId, QObject* parent): - OrgKdeKdeconnectDeviceRemotekeyboardInterface(DaemonDbusInterface::activatedService(), QStringLiteral("/modules/kdeconnect/devices/") + deviceId + QStringLiteral("/remotekeyboard"), DbusHelper::sessionBus(), parent) + OrgKdeKdeconnectDeviceRemotekeyboardInterface(DaemonDbusInterface::activatedService(), QStringLiteral("/modules/kdeconnect/devices/") + deviceId + QStringLiteral("/remotekeyboard"), DBusHelper::sessionBus(), parent) { connect(this, &OrgKdeKdeconnectDeviceRemotekeyboardInterface::remoteStateChanged, this, &RemoteKeyboardDbusInterface::remoteStateChanged); } @@ -178,20 +178,20 @@ RemoteKeyboardDbusInterface::RemoteKeyboardDbusInterface(const QString& deviceId RemoteKeyboardDbusInterface::~RemoteKeyboardDbusInterface() = default; SmsDbusInterface::SmsDbusInterface(const QString& deviceId, QObject* parent): - OrgKdeKdeconnectDeviceSmsInterface(DaemonDbusInterface::activatedService(), QStringLiteral("/modules/kdeconnect/devices/") + deviceId + QStringLiteral("/sms"), DbusHelper::sessionBus(), parent) + OrgKdeKdeconnectDeviceSmsInterface(DaemonDbusInterface::activatedService(), QStringLiteral("/modules/kdeconnect/devices/") + deviceId + QStringLiteral("/sms"), DBusHelper::sessionBus(), parent) { } SmsDbusInterface::~SmsDbusInterface() = default; ShareDbusInterface::ShareDbusInterface(const QString& deviceId, QObject* parent): - OrgKdeKdeconnectDeviceShareInterface(DaemonDbusInterface::activatedService(), QStringLiteral("/modules/kdeconnect/devices/") + deviceId + QStringLiteral("/share"), DbusHelper::sessionBus(), parent) + OrgKdeKdeconnectDeviceShareInterface(DaemonDbusInterface::activatedService(), QStringLiteral("/modules/kdeconnect/devices/") + deviceId + QStringLiteral("/share"), DBusHelper::sessionBus(), parent) { } ShareDbusInterface::~ShareDbusInterface() = default; RemoteSystemVolumeDbusInterface::RemoteSystemVolumeDbusInterface(const QString& deviceId, QObject* parent): - OrgKdeKdeconnectDeviceRemotesystemvolumeInterface(DaemonDbusInterface::activatedService(), QStringLiteral("/modules/kdeconnect/devices/") + deviceId + QStringLiteral("/remotesystemvolume"), DbusHelper::sessionBus(), parent) + OrgKdeKdeconnectDeviceRemotesystemvolumeInterface(DaemonDbusInterface::activatedService(), QStringLiteral("/modules/kdeconnect/devices/") + deviceId + QStringLiteral("/remotesystemvolume"), DBusHelper::sessionBus(), parent) { } diff --git a/interfaces/devicesmodel.cpp b/interfaces/devicesmodel.cpp index 25f2bc495..1be6c92e4 100644 --- a/interfaces/devicesmodel.cpp +++ b/interfaces/devicesmodel.cpp @@ -60,7 +60,7 @@ DevicesModel::DevicesModel(QObject* parent) this, &DevicesModel::deviceRemoved); QDBusServiceWatcher* watcher = new QDBusServiceWatcher(DaemonDbusInterface::activatedService(), - DbusHelper::sessionBus(), QDBusServiceWatcher::WatchForOwnerChange, this); + DBusHelper::sessionBus(), QDBusServiceWatcher::WatchForOwnerChange, this); connect(watcher, &QDBusServiceWatcher::serviceRegistered, this, &DevicesModel::refreshDeviceList); connect(watcher, &QDBusServiceWatcher::serviceUnregistered, this, &DevicesModel::clearDevices); diff --git a/interfaces/notificationsmodel.cpp b/interfaces/notificationsmodel.cpp index c690297ec..99c0bb033 100644 --- a/interfaces/notificationsmodel.cpp +++ b/interfaces/notificationsmodel.cpp @@ -51,7 +51,7 @@ NotificationsModel::NotificationsModel(QObject* parent) this, &NotificationsModel::anyDismissableChanged); QDBusServiceWatcher* watcher = new QDBusServiceWatcher(DaemonDbusInterface::activatedService(), - DbusHelper::sessionBus(), QDBusServiceWatcher::WatchForOwnerChange, this); + DBusHelper::sessionBus(), QDBusServiceWatcher::WatchForOwnerChange, this); connect(watcher, &QDBusServiceWatcher::serviceRegistered, this, &NotificationsModel::refreshNotificationList); connect(watcher, &QDBusServiceWatcher::serviceUnregistered, this, &NotificationsModel::clearNotifications); } diff --git a/interfaces/remotecommandsmodel.cpp b/interfaces/remotecommandsmodel.cpp index f53252477..bc7a7db03 100644 --- a/interfaces/remotecommandsmodel.cpp +++ b/interfaces/remotecommandsmodel.cpp @@ -37,7 +37,7 @@ RemoteCommandsModel::RemoteCommandsModel(QObject* parent) this, &RemoteCommandsModel::rowsChanged); QDBusServiceWatcher* watcher = new QDBusServiceWatcher(DaemonDbusInterface::activatedService(), - DbusHelper::sessionBus(), QDBusServiceWatcher::WatchForOwnerChange, this); + DBusHelper::sessionBus(), QDBusServiceWatcher::WatchForOwnerChange, this); connect(watcher, &QDBusServiceWatcher::serviceRegistered, this, &RemoteCommandsModel::refreshCommandList); connect(watcher, &QDBusServiceWatcher::serviceUnregistered, this, &RemoteCommandsModel::clearCommands); } diff --git a/interfaces/remotesinksmodel.cpp b/interfaces/remotesinksmodel.cpp index 8932ac65f..4b986b313 100644 --- a/interfaces/remotesinksmodel.cpp +++ b/interfaces/remotesinksmodel.cpp @@ -37,7 +37,7 @@ RemoteSinksModel::RemoteSinksModel(QObject* parent) this, &RemoteSinksModel::rowsChanged); QDBusServiceWatcher* watcher = new QDBusServiceWatcher(DaemonDbusInterface::activatedService(), - DbusHelper::sessionBus(), QDBusServiceWatcher::WatchForOwnerChange, this); + DBusHelper::sessionBus(), QDBusServiceWatcher::WatchForOwnerChange, this); connect(watcher, &QDBusServiceWatcher::serviceRegistered, this, &RemoteSinksModel::refreshSinkList); connect(watcher, &QDBusServiceWatcher::serviceUnregistered, this, &RemoteSinksModel::refreshSinkList); } diff --git a/plugins/lockdevice/lockdeviceplugin.cpp b/plugins/lockdevice/lockdeviceplugin.cpp index 454f52e17..da6945514 100644 --- a/plugins/lockdevice/lockdeviceplugin.cpp +++ b/plugins/lockdevice/lockdeviceplugin.cpp @@ -82,7 +82,7 @@ bool LockDevicePlugin::receivePacket(const NetworkPacket & np) OrgFreedesktopScreenSaverInterface* LockDevicePlugin::iface() { if (!m_iface) { - m_iface = new OrgFreedesktopScreenSaverInterface(QStringLiteral("org.freedesktop.ScreenSaver"), QStringLiteral("/org/freedesktop/ScreenSaver"), DbusHelper::sessionBus()); + m_iface = new OrgFreedesktopScreenSaverInterface(QStringLiteral("org.freedesktop.ScreenSaver"), QStringLiteral("/org/freedesktop/ScreenSaver"), DBusHelper::sessionBus()); if(!m_iface->isValid()) qCWarning(KDECONNECT_PLUGIN_LOCKREMOTE) << "Couldn't connect to the ScreenSaver interface"; } diff --git a/plugins/mpriscontrol/mpriscontrolplugin.cpp b/plugins/mpriscontrol/mpriscontrolplugin.cpp index 6bd58f1b9..1fb8f75ce 100644 --- a/plugins/mpriscontrol/mpriscontrolplugin.cpp +++ b/plugins/mpriscontrol/mpriscontrolplugin.cpp @@ -52,13 +52,13 @@ MprisControlPlugin::MprisControlPlugin(QObject* parent, const QVariantList& args : KdeConnectPlugin(parent, args) , prevVolume(-1) { - m_watcher = new QDBusServiceWatcher(QString(), DbusHelper::sessionBus(), QDBusServiceWatcher::WatchForOwnerChange, this); + m_watcher = new QDBusServiceWatcher(QString(), DBusHelper::sessionBus(), QDBusServiceWatcher::WatchForOwnerChange, this); // TODO: QDBusConnectionInterface::serviceOwnerChanged is deprecated, maybe query org.freedesktop.DBus directly? - connect(DbusHelper::sessionBus().interface(), &QDBusConnectionInterface::serviceOwnerChanged, this, &MprisControlPlugin::serviceOwnerChanged); + connect(DBusHelper::sessionBus().interface(), &QDBusConnectionInterface::serviceOwnerChanged, this, &MprisControlPlugin::serviceOwnerChanged); //Add existing interfaces - const QStringList services = DbusHelper::sessionBus().interface()->registeredServiceNames().value(); + const QStringList services = DBusHelper::sessionBus().interface()->registeredServiceNames().value(); for (const QString& service : services) { // The string doesn't matter, it just needs to be empty/non-empty serviceOwnerChanged(service, QLatin1String(""), QStringLiteral("1")); @@ -100,7 +100,7 @@ void MprisControlPlugin::addPlayer(const QString& service) uniqueName = identity + QLatin1String(" [") + QString::number(i) + QLatin1Char(']'); } - MprisPlayer player(service, mediaPlayerObjectPath, DbusHelper::sessionBus()); + MprisPlayer player(service, mediaPlayerObjectPath, DBusHelper::sessionBus()); playerList.insert(uniqueName, player); diff --git a/plugins/notifications/notificationsdbusinterface.cpp b/plugins/notifications/notificationsdbusinterface.cpp index fa6450f5e..4bcc2f4b7 100644 --- a/plugins/notifications/notificationsdbusinterface.cpp +++ b/plugins/notifications/notificationsdbusinterface.cpp @@ -118,7 +118,7 @@ void NotificationsDbusInterface::addNotification(Notification* noti) m_notifications[publicId] = noti; m_internalIdToPublicId[internalId] = publicId; - DbusHelper::sessionBus().registerObject(m_device->dbusPath() + QStringLiteral("/notifications/") + publicId, noti, QDBusConnection::ExportScriptableContents); + DBusHelper::sessionBus().registerObject(m_device->dbusPath() + QStringLiteral("/notifications/") + publicId, noti, QDBusConnection::ExportScriptableContents); Q_EMIT notificationPosted(publicId); } @@ -140,7 +140,7 @@ void NotificationsDbusInterface::removeNotification(const QString& internalId) } //Deleting the notification will unregister it automatically - //DbusHelper::sessionBus().unregisterObject(mDevice->dbusPath()+"/notifications/"+publicId); + //DBusHelper::sessionBus().unregisterObject(mDevice->dbusPath()+"/notifications/"+publicId); noti->deleteLater(); Q_EMIT notificationRemoved(publicId); diff --git a/plugins/pausemusic/pausemusicplugin.cpp b/plugins/pausemusic/pausemusicplugin.cpp index bd3fcd066..cf2ce0d1c 100644 --- a/plugins/pausemusic/pausemusicplugin.cpp +++ b/plugins/pausemusic/pausemusicplugin.cpp @@ -77,7 +77,7 @@ bool PauseMusicPlugin::receivePacket(const NetworkPacket& np) if (pause) { //Search for interfaces currently playing - const QStringList interfaces = DbusHelper::sessionBus().interface()->registeredServiceNames().value(); + const QStringList interfaces = DBusHelper::sessionBus().interface()->registeredServiceNames().value(); for (const QString& iface : interfaces) { if (iface.startsWith(QLatin1String("org.mpris.MediaPlayer2"))) { QDBusInterface mprisInterface(iface, QStringLiteral("/org/mpris/MediaPlayer2"), QStringLiteral("org.mpris.MediaPlayer2.Player")); diff --git a/plugins/runcommand/runcommand_config.cpp b/plugins/runcommand/runcommand_config.cpp index 6e7df95ed..7a7ed772c 100644 --- a/plugins/runcommand/runcommand_config.cpp +++ b/plugins/runcommand/runcommand_config.cpp @@ -132,7 +132,7 @@ void RunCommandConfig::save() if (key.isEmpty()) { key = QUuid::createUuid().toString(); - DbusHelper::filterNonExportableCharacters(key); + DBusHelper::filterNonExportableCharacters(key); } QJsonObject entry; entry[QStringLiteral("name")] = name; diff --git a/plugins/sendnotifications/notificationslistener.cpp b/plugins/sendnotifications/notificationslistener.cpp index 76221535d..bfbea38e9 100644 --- a/plugins/sendnotifications/notificationslistener.cpp +++ b/plugins/sendnotifications/notificationslistener.cpp @@ -48,7 +48,7 @@ NotificationsListener::NotificationsListener(KdeConnectPlugin* aPlugin) { qRegisterMetaTypeStreamOperators("NotifyingApplication"); - bool ret = DbusHelper::sessionBus() + bool ret = DBusHelper::sessionBus() .registerObject(QStringLiteral("/org/freedesktop/Notifications"), this, QDBusConnection::ExportScriptableContents); @@ -56,7 +56,7 @@ NotificationsListener::NotificationsListener(KdeConnectPlugin* aPlugin) qCWarning(KDECONNECT_PLUGIN_SENDNOTIFICATION) << "Error registering notifications listener for device" << m_plugin->device()->name() << ":" - << DbusHelper::sessionBus().lastError(); + << DBusHelper::sessionBus().lastError(); else qCDebug(KDECONNECT_PLUGIN_SENDNOTIFICATION) << "Registered notifications listener for device" @@ -80,7 +80,7 @@ NotificationsListener::~NotificationsListener() QStringLiteral("org.freedesktop.DBus")); QDBusMessage res = iface.call(QStringLiteral("RemoveMatch"), QStringLiteral("interface='org.freedesktop.Notifications',member='Notify',type='method_call',eavesdrop='true'")); - DbusHelper::sessionBus().unregisterObject(QStringLiteral("/org/freedesktop/Notifications")); + DBusHelper::sessionBus().unregisterObject(QStringLiteral("/org/freedesktop/Notifications")); } void NotificationsListener::setTranslatedAppName() diff --git a/tests/testprivatedbus.cpp b/tests/testprivatedbus.cpp index 2834b80e9..286588663 100644 --- a/tests/testprivatedbus.cpp +++ b/tests/testprivatedbus.cpp @@ -34,12 +34,12 @@ class PrivateDBusTest : public QObject public: PrivateDBusTest() { - DbusHelper::launchDBusDaemon(); + DBusHelper::launchDBusDaemon(); } ~PrivateDBusTest() { - DbusHelper::closeDBusDaemon(); + DBusHelper::closeDBusDaemon(); } private Q_SLOTS: @@ -53,7 +53,7 @@ private Q_SLOTS: */ void PrivateDBusTest::testConnectionWithPrivateDBus() { - QDBusConnection conn = DbusHelper::sessionBus(); + QDBusConnection conn = DBusHelper::sessionBus(); QVERIFY2(conn.isConnected(), "Connection not established"); QVERIFY2(conn.name() == QStringLiteral(KDECONNECT_PRIVATE_DBUS_NAME), @@ -65,7 +65,7 @@ void PrivateDBusTest::testConnectionWithPrivateDBus() */ void PrivateDBusTest::testServiceRegistrationWithPrivateDBus() { - QDBusConnection conn = DbusHelper::sessionBus(); + QDBusConnection conn = DBusHelper::sessionBus(); QVERIFY2(conn.isConnected(), "DBus not connected"); QDBusConnectionInterface *bus = conn.interface(); @@ -82,7 +82,7 @@ void PrivateDBusTest::testServiceRegistrationWithPrivateDBus() */ void PrivateDBusTest::testMethodCallWithPrivateDBus() { - QDBusConnection conn = DbusHelper::sessionBus(); + QDBusConnection conn = DBusHelper::sessionBus(); QVERIFY2(conn.isConnected(), "DBus not connected"); /* diff --git a/urlhandler/kdeconnect-handler.cpp b/urlhandler/kdeconnect-handler.cpp index 219082657..facd6f5b6 100644 --- a/urlhandler/kdeconnect-handler.cpp +++ b/urlhandler/kdeconnect-handler.cpp @@ -110,7 +110,7 @@ int main(int argc, char** argv) QDBusMessage msg = QDBusMessage::createMethodCall(QStringLiteral("org.kde.kdeconnect"), QStringLiteral("/modules/kdeconnect/devices/") + device + QStringLiteral("/share"), QStringLiteral("org.kde.kdeconnect.device.share"), action); msg.setArguments({ url.toString() }); - blockOnReply(DbusHelper::sessionBus().asyncCall(msg)); + blockOnReply(DBusHelper::sessionBus().asyncCall(msg)); return 0; } else { QTextStream(stderr) << (i18n("Couldn't share %1", url.toString())) << endl;