diff options
author | Robert Griebl <robert.griebl@pelagicore.com> | 2019-06-26 13:44:25 +0200 |
---|---|---|
committer | Robert Griebl <robert.griebl@pelagicore.com> | 2019-06-26 13:58:06 +0200 |
commit | 6be19e2462050932317111e24d9f8807232b3a5a (patch) | |
tree | d3d7c8f316ae2d20c885206e8d40a9d05c031a84 /src | |
parent | 2400143fb5b977203cbaf7430ae6f0169b493e6b (diff) | |
download | qtapplicationmanager-6be19e2462050932317111e24d9f8807232b3a5a.tar.gz |
Fix crashes when trying to start blocked apps
Task-number: AUTOSUITE-1079
Change-Id: I11fb811af92d782815659ce41c50008f9b336a71
Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/manager-lib/applicationmanager.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/manager-lib/applicationmanager.cpp b/src/manager-lib/applicationmanager.cpp index 464b59ee..38312931 100644 --- a/src/manager-lib/applicationmanager.cpp +++ b/src/manager-lib/applicationmanager.cpp @@ -1038,7 +1038,12 @@ bool ApplicationManager::openUrl(const QString &urlStr) if (!apps.isEmpty()) { if (!isSignalConnected(QMetaMethod::fromSignal(&ApplicationManager::openUrlRequested))) { // If the System-UI does not react to the signal, then just use the first match. - startApplicationInternal(apps.constFirst()->id(), urlStr, mimeTypeName); + try { + startApplicationInternal(apps.constFirst()->id(), urlStr, mimeTypeName); + } catch (const Exception &e) { + qCWarning(LogSystem) << "openUrl for" << urlStr << "requested app" << apps.constFirst()->id() + << "which could not be started:" << e.errorString(); + } } else { ApplicationManagerPrivate::OpenUrlRequest req { QUuid::createUuid().toString(), @@ -1095,7 +1100,12 @@ void ApplicationManager::acknowledgeOpenUrlRequest(const QString &requestId, con for (auto it = d->openUrlRequests.begin(); it != d->openUrlRequests.end(); ++it) { if (it->requestId == requestId) { if (it->possibleAppIds.contains(appId)) { - startApplicationInternal(appId, it->urlStr, it->mimeTypeName); + try { + startApplicationInternal(appId, it->urlStr, it->mimeTypeName); + } catch (const Exception &e) { + qCWarning(LogSystem) << "acknowledgeOpenUrlRequest for" << it->urlStr << "requested app" + << appId << "which could not be started:" << e.errorString(); + } } else { qCWarning(LogSystem) << "acknowledgeOpenUrlRequest for" << it->urlStr << "requested app" << appId << "which is not one of the registered possibilities:" @@ -1373,7 +1383,7 @@ void ApplicationManager::startSingleAppAndQuitWhenStopped() AbstractApplication *app = d->apps[0]; - if (!startApplicationInternal(app->id())) { + if (!startApplication(app->id())) { QMetaObject::invokeMethod(qApp, "shutDown", Qt::DirectConnection, Q_ARG(int, 1)); } else { connect(this, &ApplicationManager::applicationRunStateChanged, [app](const QString &id, Am::RunState runState) { @@ -1656,7 +1666,7 @@ void ApplicationManager::addApplication(AbstractApplication *app) connect (&app->requests, &ApplicationRequests::startRequested, this, [this, app](const QString &documentUrl) { - startApplicationInternal(app->id(), documentUrl); + startApplication(app->id(), documentUrl); }); connect (&app->requests, &ApplicationRequests::debugRequested, |