@@ -1,3 +1,19 @@
2+ * Copyright (C) 2016 Canonical, Ltd.
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
1#include <QDebug>
17#include <QDebug>
3#include "ualwrapper.h"
19#include "ualwrapper.h"
@@ -16,13 +32,13 @@ QStringList UalWrapper::installedApps()
16 QStringList appIds;
32 QStringList appIds;
18 for (const std::shared_ptr<Application> &app : Registry::installedApps()) {
34 for (const std::shared_ptr<Application> &app : Registry::installedApps()) {
19− if (!QString::fromStdString(app->appId().package).isEmpty()) {
35+ if (!app->appId().package.value().empty()) {
20− appIds << QString::fromStdString(app->appId().package) + QStringLiteral("_") + QString::fromStdString(app->appId().appname);
36+ appIds << QString::fromStdString(app->appId().package.value() + "_" + app->appId().appname.value());
22 appIds << QString::fromStdString(app->appId().appname);
38 appIds << QString::fromStdString(app->appId().appname);
25− } catch(std::runtime_error &e) {
41+ } catch (const std::runtime_error &e) {
26 qWarning() << "ubuntu-all-launch threw an exception listing apps:" << e.what();
42 qWarning() << "ubuntu-all-launch threw an exception listing apps:" << e.what();
@@ -49,7 +65,7 @@ UalWrapper::AppInfo UalWrapper::getApplicationInfo(const QString &appId)
49 info.keywords << QString::fromStdString(keyword);
65 info.keywords << QString::fromStdString(keyword);
51 info.valid = true;
67 info.valid = true;
52− } catch(std::runtime_error &e) {
68+ } catch (const std::runtime_error &e) {
53 qWarning() << "ubuntu-app-launch threw an exception getting app info for appId:" << appId << ":" << e.what();
69 qWarning() << "ubuntu-app-launch threw an exception getting app info for appId:" << appId << ":" << e.what();