summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleix Pol <[email protected]>2018-06-21 23:54:33 +0200
committerAleix Pol <[email protected]>2018-06-21 23:54:33 +0200
commit9ce57430962027d76f9622990afccdbf21f0520e (patch)
tree1df73045d5e77ef3341131483aeb5c3dfd573c9f
parentbc71b6874dd9c42af03a42cd9ead38d8f918e7c0 (diff)
Fix warning: use the right API to get the component desktop id
-rw-r--r--libdiscover/backends/PackageKitBackend/PackageKitBackend.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/libdiscover/backends/PackageKitBackend/PackageKitBackend.cpp b/libdiscover/backends/PackageKitBackend/PackageKitBackend.cpp
index 5620dd8..e3fdc82 100644
--- a/libdiscover/backends/PackageKitBackend/PackageKitBackend.cpp
+++ b/libdiscover/backends/PackageKitBackend/PackageKitBackend.cpp
@@ -148,8 +148,9 @@ void PackageKitBackend::reloadPackageList()
const auto pkgNames = component.packageNames();
if (pkgNames.isEmpty()) {
- if (component.kind() == AppStream::Component::KindDesktopApp) {
- const QString file = locateService(component.desktopId());
+ auto launchable = component.launchable(AppStream::Launchable::KindDesktopId);
+ if (component.kind() == AppStream::Component::KindDesktopApp && !launchable.entries().isEmpty()) {
+ const QString file = locateService(launchable.entries().constFirst());
if (!file.isEmpty()) {
auto trans = PackageKit::Daemon::searchFiles(file);
connect(trans, &PackageKit::Transaction::package, this, [trans](PackageKit::Transaction::Info info, const QString &packageID){