Close the application started notification when the job failed to open

So far, we leave the splash on which is confusing.

https://invent.kde.org/teams/plasma-mobile/issues/-/issues/70
This commit is contained in:
Aleix Pol 2021-09-13 14:22:47 +02:00 committed by Bhushan Shah
parent 89dbff8995
commit 3fc96fbc25
3 changed files with 12 additions and 0 deletions

View file

@ -399,6 +399,12 @@ void ApplicationListModel::runApplication(const QString &storageId)
KIO::ApplicationLauncherJob *job = new KIO::ApplicationLauncherJob(service);
job->setUiDelegate(new KNotificationJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled));
job->start();
connect(job, &KJob::finished, this, [this, job] {
if (job->error()) {
qWarning() << "error launching" << job->error() << job->errorString();
Q_EMIT launchError(job->errorString());
}
});
}
int ApplicationListModel::maxFavoriteCount() const

View file

@ -116,6 +116,7 @@ Q_SIGNALS:
void favoriteCountChanged();
void maxFavoriteCountChanged();
void appletChanged();
void launchError(const QString &msg);
protected:
void initWayland();

View file

@ -204,6 +204,11 @@ Item {
// boundsBehavior: Flickable.StopAtBounds
Connections {
target: HomeScreenComponents.ApplicationListModel
onLaunchError: NanoShell.StartupFeedback.close()
}
model: HomeScreenComponents.ApplicationListModel
header: Rectangle {