homescreens/halcyon: Port to new app launch method

This commit is contained in:
Devin Lin 2022-10-12 17:01:03 -04:00
parent 7385ca9dca
commit 3e47bbd584
9 changed files with 4 additions and 23 deletions

View file

@ -6,7 +6,6 @@
#include <QQuickWindow>
#include <KIO/ApplicationLauncherJob>
#include <KNotificationJobUiDelegate>
#include <KService>
@ -102,19 +101,6 @@ void Application::setWindow(KWayland::Client::PlasmaWindow *window)
Q_EMIT windowChanged();
}
void Application::runApplication()
{
if (m_window) {
m_window->requestActivate();
return;
}
KService::Ptr service = KService::serviceByStorageId(m_storageId);
KIO::ApplicationLauncherJob *job = new KIO::ApplicationLauncherJob(service);
job->setUiDelegate(new KNotificationJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled));
job->start();
}
void Application::setMinimizedDelegate(QQuickItem *delegate)
{
QWindow *delegateWindow = delegate->window();

View file

@ -8,6 +8,7 @@
#include <QQuickItem>
#include <QString>
#include <KIO/ApplicationLauncherJob>
#include <KService>
#include <KWayland/Client/connection_thread.h>
@ -43,7 +44,6 @@ public:
void setStorageId(QString &storageId);
void setWindow(KWayland::Client::PlasmaWindow *window);
Q_INVOKABLE void runApplication();
Q_INVOKABLE void setMinimizedDelegate(QQuickItem *delegate);
Q_INVOKABLE void unsetMinimizedDelegate(QQuickItem *delegate);

View file

@ -7,6 +7,7 @@
#include "pinnedmodel.h"
#include "windowlistener.h"
#include <KIO/ApplicationLauncherJob>
#include <KWindowSystem>
#include <QDebug>

View file

@ -6,7 +6,6 @@ import QtQuick.Layouts 1.1
import QtQuick.Controls 2.3 as Controls
import QtGraphicalEffects 1.6
import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 3.0 as PlasmaComponents
import org.kde.kquickcontrolsaddons 2.0
@ -89,7 +88,7 @@ Item {
}
application.setMinimizedDelegate(delegate);
application.runApplication();
MobileShell.ShellUtil.launchApp(application.storageId);
}
Loader {

View file

@ -6,7 +6,6 @@ import QtQuick.Controls 2.15 as QQC2
import QtQuick.Layouts 1.1
import QtQml.Models 2.15
import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.extras 2.0 as PlasmaExtras
import org.kde.plasma.components 3.0 as PC3

View file

@ -6,7 +6,6 @@ import QtQuick.Controls 2.15 as QQC2
import QtQuick.Layouts 1.1
import QtQml.Models 2.15
import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.extras 2.0 as PlasmaExtras
import org.kde.plasma.components 3.0 as PC3

View file

@ -7,7 +7,6 @@ import QtQuick.Layouts 1.1
import QtQml.Models 2.15
import QtGraphicalEffects 1.12
import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.extras 2.0 as PlasmaExtras
import org.kde.plasma.components 3.0 as PC3

View file

@ -9,7 +9,6 @@ import QtQuick.Layouts 1.1
import QtQuick.Controls 2.15 as Controls
import QtGraphicalEffects 1.6
import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 3.0 as PlasmaComponents
import org.kde.kquickcontrolsaddons 2.0

View file

@ -7,7 +7,6 @@ import QtQuick 2.15
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.15 as Controls
import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 3.0 as PC3
import org.kde.plasma.extras 2.0 as PlasmaExtras
@ -86,7 +85,7 @@ MobileShell.GridView {
}
application.setMinimizedDelegate(delegate);
application.runApplication();
MobileShell.ShellUtil.launchApp(application.storageId);
}
}
}