Use kdeconnect-settings for command configuration

Instead of relying on kde-cli-tools being installed.
This commit is contained in:
Nicolas Fella 2020-03-21 21:26:42 +01:00
parent eac1e07e29
commit 9f1101c9c1
2 changed files with 10 additions and 2 deletions

View file

@ -85,7 +85,7 @@ bool RunCommandPlugin::receivePacket(const NetworkPacket& np)
QProcess::startDetached(QStringLiteral(COMMAND), QStringList()<< QStringLiteral(ARGS) << commandJson[QStringLiteral("command")].toString());
return true;
} else if (np.has(QStringLiteral("setup"))) {
QProcess::startDetached(QStringLiteral("kcmshell5"), {QStringLiteral("kdeconnect"), QStringLiteral("--args"), QString(device()->id() + QStringLiteral(":kdeconnect_runcommand")) });
QProcess::startDetached(QStringLiteral("kdeconnect-settings"), { QStringLiteral("--args"), QString(device()->id() + QStringLiteral(":kdeconnect_runcommand")) });
}
return false;

View file

@ -19,6 +19,7 @@
*/
#include <QApplication>
#include <QCommandLineParser>
#include <KCMultiDialog>
#include <KAboutData>
@ -37,10 +38,17 @@ int main(int argc, char** argv)
i18n("(C) 2018-2020 Nicolas Fella"));
KAboutData::setApplicationData(about);
QCommandLineParser parser;
parser.addOption(QCommandLineOption(QStringLiteral("args"), i18n("Arguments for the config module"), QStringLiteral("args")));
about.setupCommandLine(&parser);
parser.process(app);
about.processCommandLine(&parser);
KDBusService dbusService(KDBusService::Unique);
KCMultiDialog* dialog = new KCMultiDialog;
dialog->addModule(QStringLiteral("kcm_kdeconnect"));
dialog->addModule(QStringLiteral("kcm_kdeconnect"), {parser.value(QStringLiteral("args"))});
dialog->setAttribute(Qt::WA_DeleteOnClose);
dialog->show();