From 9fa07a236143832f99db59826967d9754de32a50 Mon Sep 17 00:00:00 2001 From: Albert Vaca Cintora Date: Sat, 24 Jun 2023 20:34:15 +0200 Subject: [PATCH] Call connected only once in the lifetime of a plugin --- core/device.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/device.cpp b/core/device.cpp index 5f1d68ee2..307a41687 100644 --- a/core/device.cpp +++ b/core/device.cpp @@ -180,6 +180,8 @@ void Device::reloadPlugins() } newPluginMap[pluginName] = plugin; + + plugin->connected(); } } } @@ -192,11 +194,9 @@ void Device::reloadPlugins() d->m_plugins = newPluginMap; d->m_pluginsByIncomingCapability = newPluginsByIncomingCapability; + // Recreate dbus paths for all plugins (new and existing) QDBusConnection bus = QDBusConnection::sessionBus(); for (KdeConnectPlugin *plugin : qAsConst(d->m_plugins)) { - // TODO: see how it works in Android (only done once, when created) - plugin->connected(); - const QString dbusPath = plugin->dbusPath(); if (!dbusPath.isEmpty()) { bus.registerObject(dbusPath,