kdeconnect-kde/core/openconfig.cpp
Albert Vaca Cintora 495e3019e4 Reduce number of optional dependencies
Change some optional dependencies from being optional to being mandatory
or being mandatory but behind on-by-default cmake flags. Eg: instead of
only compiling Wayland support if we find the appropriate libraries, we
always require the libraries unless the user specifies WITH_WAYLAND=OFF.

Optional libraries are hard to discover by packagers (since they don't
see an error once we add them) and create lots of possible build flavors
with a different features that can confuse users.
2023-07-19 17:08:03 +00:00

41 lines
972 B
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 <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("--args");
argument = deviceId;
if (!pluginId.isEmpty()) {
argument += QLatin1Char(':') + pluginId;
}
args << argument;
}
auto job = new KIO::CommandLauncherJob(QStringLiteral("kdeconnect-settings"), args);
job->setDesktopName(QStringLiteral("org.kde.kdeconnect-settings"));
job->setStartupId(m_currentToken.toUtf8());
job->start();
m_currentToken = QString();
}