File indexing completed on 2024-04-28 16:43:18

0001 /*
0002     SPDX-FileCopyrightText: 2014-2015 David Rosca <nowrep@gmail.com>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006 
0007 #include "launchapp.h"
0008 
0009 #include <KIO/ApplicationLauncherJob>
0010 #include <KIO/CommandLauncherJob>
0011 #include <KNotificationJobUiDelegate>
0012 
0013 LaunchApp::LaunchApp(QObject *parent)
0014     : QObject(parent)
0015 {
0016 }
0017 
0018 void LaunchApp::launchWizard()
0019 {
0020     auto *job = new KIO::ApplicationLauncherJob(KService::serviceByDesktopName(QStringLiteral("org.kde.bluedevilwizard")));
0021     auto *delegate = new KNotificationJobUiDelegate(KNotificationJobUiDelegate::AutoErrorHandlingEnabled);
0022     job->setUiDelegate(delegate);
0023     job->start();
0024 }
0025 
0026 void LaunchApp::launchSendFile(const QString &ubi)
0027 {
0028     auto *job = new KIO::CommandLauncherJob(QStringLiteral("bluedevil-sendfile"), {QStringLiteral("-u"), ubi});
0029     job->setDesktopName(QStringLiteral("org.kde.bluedevilsendfile"));
0030     auto *delegate = new KNotificationJobUiDelegate(KNotificationJobUiDelegate::AutoErrorHandlingEnabled);
0031     job->setUiDelegate(delegate);
0032     job->start();
0033 }