@@ -1,3 +1,19 @@
1+/*
2+ * Copyright (C) 2016 Canonical, Ltd.
3+ *
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.
7+ *
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.
12+ *
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/>.
15+ */
16+
117#include <QDebug>
218
319#include "ualwrapper.h"
@@ -16,13 +32,13 @@ QStringList UalWrapper::installedApps()
1632 QStringList appIds;
1733 try {
1834 for (const std::shared_ptr<Application> &app : Registry::installedApps()) {
19− if (!QString::fromStdString(app->appId().package).isEmpty()) {
20− appIds << QString::fromStdString(app->appId().package) + QStringLiteral("_") + QString::fromStdString(app->appId().appname);
35+ if (!app->appId().package.value().empty()) {
36+ appIds << QString::fromStdString(app->appId().package.value() + "_" + app->appId().appname.value());
2137 } else {
2238 appIds << QString::fromStdString(app->appId().appname);
2339 }
2440 }
25− } catch(std::runtime_error &e) {
41+ } catch (const std::runtime_error &e) {
2642 qWarning() << "ubuntu-all-launch threw an exception listing apps:" << e.what();
2743 }
2844
@@ -49,7 +65,7 @@ UalWrapper::AppInfo UalWrapper::getApplicationInfo(const QString &appId)
4965 info.keywords << QString::fromStdString(keyword);
5066 }
5167 info.valid = true;
52− } catch(std::runtime_error &e) {
68+ } catch (const std::runtime_error &e) {
5369 qWarning() << "ubuntu-app-launch threw an exception getting app info for appId:" << appId << ":" << e.what();
5470 }
5571