11
0
Files
plasma5-workspace/Look-for-both-json-and-desktop-metadata.patch
Fabian Vogt 04e52ea545 Accepting request 440076 from home:wolfi323:test
- Add Look-for-both-json-and-desktop-metadata.patch to fix adding a panel or plasmoid with the new json metadata files

OBS-URL: https://build.opensuse.org/request/show/440076
OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks5/plasma5-workspace?expand=0&rev=277
2016-11-12 21:41:27 +00:00

81 lines
3.6 KiB
Diff

From: Aleix Pol <aleixpol@kde.org>
Date: Mon, 31 Oct 2016 11:06:30 +0000
Subject: Make sure we're looking both for json and desktop metadata
X-Git-Url: http://quickgit.kde.org/?p=plasma-workspace.git&a=commitdiff&h=bfb91f9de153d53a30d82ad6ce0d6732da4ab367
---
Make sure we're looking both for json and desktop metadata
We shouldn't assume metadata is in metadata.desktop
REVIEW: 129276
---
--- a/shell/containmentconfigview.cpp
+++ b/shell/containmentconfigview.cpp
@@ -141,8 +141,8 @@
QStringList packages;
foreach (const QString &sdir, dir.entryList(QDir::AllDirs | QDir::Readable)) {
- QString metadata = dirPath + '/' + sdir + "/metadata.desktop";
- if (QFile::exists(metadata)) {
+ const QString metadata = dirPath + '/' + sdir;
+ if (QFile::exists(metadata + "/metadata.json") || QFile::exists(metadata + "/metadata.desktop")) {
packages << sdir;
}
}
--- a/shell/scripting/scriptengine_v1.cpp
+++ b/shell/scripting/scriptengine_v1.cpp
@@ -510,6 +510,11 @@
if (sc) {
const QString overridePackagePath = sc->lookAndFeelPackage().path() + QStringLiteral("contents/layouts/") + pluginData.pluginId();
+ path = overridePackagePath + QStringLiteral("/metadata.json");
+ if (QFile::exists(path)) {
+ package.setPath(overridePackagePath);
+ }
+
path = overridePackagePath + QStringLiteral("/metadata.desktop");
if (QFile::exists(path)) {
package.setPath(overridePackagePath);
@@ -518,7 +523,10 @@
}
if (!package.isValid()) {
- path = QStandardPaths::locate(QStandardPaths::GenericDataLocation, package.defaultPackageRoot() + pluginData.pluginId() + "/metadata.desktop");
+ path = QStandardPaths::locate(QStandardPaths::GenericDataLocation, package.defaultPackageRoot() + pluginData.pluginId() + "/metadata.json");
+ if (path.isEmpty()) {
+ path = QStandardPaths::locate(QStandardPaths::GenericDataLocation, package.defaultPackageRoot() + pluginData.pluginId() + "/metadata.desktop");
+ }
if (path.isEmpty()) {
// qDebug() << "script path is empty";
return false;
--- a/wallpapers/image/backgroundlistmodel.cpp
+++ b/wallpapers/image/backgroundlistmodel.cpp
@@ -559,7 +559,7 @@
}
const QString filePath = wp.filePath();
- if (QFile::exists(filePath + QString::fromLatin1("/metadata.desktop"))) {
+ if (QFile::exists(filePath + QString::fromLatin1("/metadata.desktop")) || QFile::exists(filePath + QString::fromLatin1("/metadata.json"))) {
package.setPath(filePath);
if (package.isValid()) {
if (!package.filePath("images").isEmpty()) {
--- a/wallpapers/image/image.cpp
+++ b/wallpapers/image/image.cpp
@@ -453,7 +453,9 @@
}
} else {
//if it's not an absolute path, check if it's just a wallpaper name
- const QString path = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1String("wallpapers/") + QString(m_wallpaper + QString::fromLatin1("/metadata.desktop")));
+ QString path = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1String("wallpapers/") + QString(m_wallpaper + QString::fromLatin1("/metadata.json")));
+ if (path.isEmpty())
+ path = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1String("wallpapers/") + QString(m_wallpaper + QString::fromLatin1("/metadata.desktop")));
if (!path.isEmpty()) {
QDir dir(path);