Commit 74e9f990 authored by David Edmundson's avatar David Edmundson Committed by David Edmundson
Browse files

[wallpaper] Avoid using pluginId for indexing package indexes

Image takes a string and loads the relevant package at a given path
wallpapers+packageName

pluginId typically is the same as the package name on disk, but not
always, either due to bad metadata or it being deliberately mangled
during install to avoid escaped characters.

Returning the package path has the same desired effect for saving
chosen images by package names, but avoids the complexity above.

metaData presence is still queried to separate real packages from the
fake packages generated internally which represent just one image.

BUG: 423987
parent be421fa8
......@@ -388,7 +388,7 @@ QVariant BackgroundListModel::data(const QModelIndex &index, int role) const
return QUrl::fromLocalFile(b.filePath("preferred"));
case PackageNameRole:
return !b.metadata().isValid() || b.metadata().pluginId().isEmpty() ? b.filePath("preferred") : b.metadata().pluginId();
return !b.metadata().isValid() ? b.filePath("preferred") : b.path();
case RemovableRole: {
QString localWallpapers = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/wallpapers/";
......
Markdown is supported
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