Use kdeconnect-settings for command configuration
Instead of relying on kde-cli-tools being installed.
This commit is contained in:
parent
eac1e07e29
commit
9f1101c9c1
2 changed files with 10 additions and 2 deletions
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in a new issue