diff --git a/components/mobileshell/shellutil.cpp b/components/mobileshell/shellutil.cpp index 904bb24f..e2090ccc 100644 --- a/components/mobileshell/shellutil.cpp +++ b/components/mobileshell/shellutil.cpp @@ -27,7 +27,6 @@ ShellUtil::ShellUtil(QObject *parent) : QObject{parent} , m_localeConfig{KSharedConfig::openConfig(QStringLiteral("kdeglobals"), KConfig::SimpleConfig)} - , m_launchingApp{nullptr} { m_localeConfigWatcher = KConfigWatcher::create(m_localeConfig); @@ -100,35 +99,4 @@ void ShellUtil::launchApp(const QString &storageId) auto job = new KIO::ApplicationLauncherJob(service, this); job->setUiDelegate(new KNotificationJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled)); job->start(); - - setLaunchingApp(job); -} - -bool ShellUtil::isLaunchingApp() -{ - return m_launchingApp != nullptr; -} - -void ShellUtil::setLaunchingApp(KIO::ApplicationLauncherJob *launcherJob) -{ - m_launchingAppPids = {}; - m_launchingApp = launcherJob; // do not assume that the pointer is valid, KJobs destroy themselves - connect(launcherJob, &KIO::ApplicationLauncherJob::result, this, [this](auto *job) { - m_launchingAppPids = m_launchingApp->pids(); - }); - Q_EMIT isLaunchingAppChanged(); -} - -void ShellUtil::cancelLaunchingApp() -{ - for (auto pid : m_launchingAppPids) { - QProcess::execute("kill", {QString::number(pid)}); - } - clearLaunchingApp(); -} - -void ShellUtil::clearLaunchingApp() -{ - m_launchingApp = nullptr; - Q_EMIT isLaunchingAppChanged(); } diff --git a/components/mobileshell/shellutil.h b/components/mobileshell/shellutil.h index d6b426c5..bea5a8a0 100644 --- a/components/mobileshell/shellutil.h +++ b/components/mobileshell/shellutil.h @@ -23,7 +23,6 @@ class ShellUtil : public QObject { Q_OBJECT Q_PROPERTY(bool isSystem24HourFormat READ isSystem24HourFormat NOTIFY isSystem24HourFormatChanged) - Q_PROPERTY(bool isLaunchingApp READ isLaunchingApp NOTIFY isLaunchingAppChanged) public: ShellUtil(QObject *parent = nullptr); @@ -64,33 +63,10 @@ public: */ Q_INVOKABLE bool isSystem24HourFormat(); - /** - * Whether an application is being launched. - */ - Q_INVOKABLE bool isLaunchingApp(); - - /** - * Cancels an application launch by running `kill pid` for every associated pid of the launching app. - */ - Q_INVOKABLE void cancelLaunchingApp(); - - /** - * Clears the currently stored launching app. - * - * This should be called if the application window finally shows. - */ - Q_INVOKABLE void clearLaunchingApp(); - Q_SIGNALS: void isSystem24HourFormatChanged(); - void isLaunchingAppChanged(); private: - void setLaunchingApp(KIO::ApplicationLauncherJob *launcherJob); - KConfigWatcher::Ptr m_localeConfigWatcher; KSharedConfig::Ptr m_localeConfig; - - KIO::ApplicationLauncherJob *m_launchingApp; - QVector m_launchingAppPids; }; diff --git a/containments/taskpanel/package/contents/ui/NavigationPanelComponent.qml b/containments/taskpanel/package/contents/ui/NavigationPanelComponent.qml index 3425ceac..340b9253 100644 --- a/containments/taskpanel/package/contents/ui/NavigationPanelComponent.qml +++ b/containments/taskpanel/package/contents/ui/NavigationPanelComponent.qml @@ -83,7 +83,7 @@ MobileShell.NavigationPanel { rightAction: MobileShell.NavigationPanelAction { id: closeAppAction - enabled: Keyboards.KWinVirtualKeyboard.visible || root.taskSwitcher.visible || MobileShell.WindowUtil.hasCloseableActiveWindow || MobileShell.ShellUtil.isLaunchingApp + enabled: Keyboards.KWinVirtualKeyboard.visible || root.taskSwitcher.visible || MobileShell.WindowUtil.hasCloseableActiveWindow iconSource: Keyboards.KWinVirtualKeyboard.visible ? "go-down-symbolic" : "mobile-close-app" // mobile-close-app (from plasma-frameworks) seems to have less margins than icons from breeze-icons iconSizeFactor: Keyboards.KWinVirtualKeyboard.visible ? 1 : 0.75 @@ -103,11 +103,6 @@ MobileShell.NavigationPanel { root.taskSwitcher.tasksModel.requestClose(root.taskSwitcher.tasksModel.activeTask); } MobileShellState.Shell.closeAppLaunchAnimation(); - } else if (MobileShell.ShellUtil.isLaunchingApp) { - - // cancel the launching of the app - MobileShellState.Shell.closeAppLaunchAnimation(); - MobileShell.ShellUtil.cancelLaunchingApp(); } } }