summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleix Pol <[email protected]>2016-11-18 15:02:49 +0100
committerAleix Pol <[email protected]>2016-11-18 15:02:49 +0100
commit2896cbbb0aba39eeeb84d30e6a86285e204b072c (patch)
tree64d217bfabbcac9e985404df0b9f2b9d69744b80
parent6577bcb594eb1139434cb55d2ccba854f00613d8 (diff)
Use a passive notification to notify about lack of appstream data
-rw-r--r--libdiscover/backends/PackageKitBackend/PackageKitBackend.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/libdiscover/backends/PackageKitBackend/PackageKitBackend.cpp b/libdiscover/backends/PackageKitBackend/PackageKitBackend.cpp
index 9650d4d..f47a15e 100644
--- a/libdiscover/backends/PackageKitBackend/PackageKitBackend.cpp
+++ b/libdiscover/backends/PackageKitBackend/PackageKitBackend.cpp
@@ -59,11 +59,9 @@ PackageKitBackend::PackageKitBackend(QObject* parent)
if (!b) {
qWarning() << "Could not open the AppStream metadata pool";
- auto msg = new QAction(i18n("Got it"), this);
- msg->setWhatsThis(i18n("Please make sure that Appstream is properly set up on your system"));
- msg->setPriority(QAction::HighPriority);
- connect(msg, &QAction::triggered, msg, [msg](){ msg->setVisible(false); });
- m_messageActions << msg;
+ QTimer::singleShot(0, this, [this]() {
+ Q_EMIT passiveMessage(i18n("Please make sure that Appstream is properly set up on your system"));
+ });
}
reloadPackageList();
@@ -422,6 +420,9 @@ void PackageKitBackend::installApplication(AbstractResource* app, const AddonLis
QVector<AbstractResource*> appsToRemove = kTransform<QVector<AbstractResource*>>(addons.addonsToRemove(), [this](const QString& toRemove){ return m_packages.packages.value(toRemove); });
new PKTransaction(appsToRemove, Transaction::RemoveRole);
}
+
+ if (!app->isInstalled())
+ installApplication(app);
}
void PackageKitBackend::installApplication(AbstractResource* app)