Fix using kdeconnect-settings when instance is already running

kdeconnect-settings is a single-instance app

When activating an existing instance actually load the requested settings part

Bump KF5 dependency to 5.95 to include https://invent.kde.org/frameworks/kcmutils/-/merge_requests/90, otherwise there's a crash
This commit is contained in:
Nicolas Fella 2022-05-12 03:41:05 +02:00
parent e703b8b6b5
commit 184120642a
2 changed files with 11 additions and 1 deletions

View file

@ -12,7 +12,7 @@ if (SAILFISHOS)
set(KF5_MIN_VERSION "5.36.0") set(KF5_MIN_VERSION "5.36.0")
set(QT_MIN_VERSION "5.6.0") set(QT_MIN_VERSION "5.6.0")
else() else()
set(KF5_MIN_VERSION "5.89.0") set(KF5_MIN_VERSION "5.95.0")
set(QT_MIN_VERSION "5.10.0") set(QT_MIN_VERSION "5.10.0")
set(KDE_COMPILERSETTINGS_LEVEL "5.84.0") set(KDE_COMPILERSETTINGS_LEVEL "5.84.0")
endif() endif()

View file

@ -46,6 +46,16 @@ int main(int argc, char** argv)
dialog->setAttribute(Qt::WA_DeleteOnClose); dialog->setAttribute(Qt::WA_DeleteOnClose);
dialog->show(); dialog->show();
QObject::connect(&dbusService, &KDBusService::activateRequested, dialog, [dialog](const QStringList &args, const QString &/*workingDir*/) {
QCommandLineParser parser;
parser.addOption(QCommandLineOption(QStringLiteral("args"), i18n("Arguments for the config module"), QStringLiteral("args")));
parser.parse(args);
dialog->clear();
dialog->addModule(KPluginMetaData(QStringLiteral("kcm_kdeconnect")), {parser.value(QStringLiteral("args"))});
});
app.setQuitOnLastWindowClosed(true); app.setQuitOnLastWindowClosed(true);
return app.exec(); return app.exec();