mirror of
https://invent.kde.org/network/kdeconnect-kde.git
synced 2025-10-06 00:32:40 +02:00
The KDE Connect QML app has reached the point where it has almost 100% feature parity with the KCM (two features missing only: exporting/importing commands lists for the runcommand plugin, and configuring the applications for the receive notifications plugin). So I think it's time we kill the KCM module and replace it with the nicer looking QML app, removing in the process a whole lot of code duplication.
I originally wrote the KCM module 12 years ago now and it has served us well all this years, but it's time for it to go 😄
48 lines
1.1 KiB
C++
48 lines
1.1 KiB
C++
/**
|
|
* SPDX-FileCopyrightText: 2022 Nicolas Fella <nicolas.fella@gmx.de>
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
|
|
*/
|
|
|
|
#include "openconfig.h"
|
|
|
|
#include <QDebug>
|
|
#include <QProcess>
|
|
|
|
#include <KIO/CommandLauncherJob>
|
|
|
|
void OpenConfig::setXdgActivationToken(const QString &token)
|
|
{
|
|
m_currentToken = token;
|
|
}
|
|
|
|
void OpenConfig::openConfiguration(const QString &deviceId, const QString &pluginId)
|
|
{
|
|
QStringList args;
|
|
|
|
QString argument;
|
|
|
|
if (!deviceId.isEmpty()) {
|
|
args << QStringLiteral("--device");
|
|
args << deviceId;
|
|
|
|
if (!pluginId.isEmpty()) {
|
|
args << QStringLiteral("--plugin-config");
|
|
args << pluginId;
|
|
}
|
|
}
|
|
|
|
#ifdef Q_OS_WIN
|
|
QProcess::startDetached(QStringLiteral("kdeconnect-app.exe"), args);
|
|
#else
|
|
auto job = new KIO::CommandLauncherJob(QStringLiteral("kdeconnect-app"), args);
|
|
job->setDesktopName(QStringLiteral("org.kde.kdeconnect.app"));
|
|
job->setStartupId(m_currentToken.toUtf8());
|
|
job->start();
|
|
|
|
m_currentToken = QString();
|
|
#endif
|
|
}
|
|
|
|
#include "moc_openconfig.cpp"
|