Commit e1aa6b37 authored by Antonio Rojas's avatar Antonio Rojas
Browse files

PackageKit backend: fix searching for appstream id's without .desktop suffix

The comparison was backwards, which in particular made all links in apps.kde.org not work
parent 1ee46e82
Pipeline #184662 passed with stage
in 1 minute and 2 seconds
......@@ -627,7 +627,9 @@ PKResultsStream *PackageKitBackend::findResourceByPackageName(const QUrl &url)
return it.key().compare(id, Qt::CaseInsensitive) == 0 ||
// doing (id == id.key()+".desktop") without allocating
(id.size() == (desktopPostfix.size() + it.key().size()) && id.endsWith(desktopPostfix)
&& id.startsWith(it.key(), Qt::CaseInsensitive));
&& id.startsWith(it.key(), Qt::CaseInsensitive)) ||
(it.key().size() == (desktopPostfix.size() + id.size()) && it.key().endsWith(desktopPostfix)
&& it.key().startsWith(id, Qt::CaseInsensitive));
});
if (matches) {
pkg = it.value();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment