use PLASMA_CUSTOM_PREFIX_PATHS environmant variable as optional custom fallback chain for plasmoidpackage (should it be for -all- packages?)
svn path=/trunk/KDE/kdelibs/; revision=1193156
This commit is contained in:
parent
5e9d88496a
commit
3cc339a852
@ -169,7 +169,7 @@ bool Package::isValid() const
|
|||||||
bool failed = true;
|
bool failed = true;
|
||||||
foreach (const QString &path, d->structure->searchPath(dir)) {
|
foreach (const QString &path, d->structure->searchPath(dir)) {
|
||||||
foreach (const QString &prefix, d->structure->contentsPrefixPaths()) {
|
foreach (const QString &prefix, d->structure->contentsPrefixPaths()) {
|
||||||
if (QFile::exists(d->structure->path() + prefix + path)) {
|
if (QFile::exists(d->structure->path() + prefix + "/" + path)) {
|
||||||
failed = false;
|
failed = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -190,7 +190,7 @@ bool Package::isValid() const
|
|||||||
bool failed = true;
|
bool failed = true;
|
||||||
foreach (const QString &path, d->structure->searchPath(file)) {
|
foreach (const QString &path, d->structure->searchPath(file)) {
|
||||||
foreach (const QString &prefix, d->structure->contentsPrefixPaths()) {
|
foreach (const QString &prefix, d->structure->contentsPrefixPaths()) {
|
||||||
if (QFile::exists(d->structure->path() + prefix + path)) {
|
if (QFile::exists(d->structure->path() + prefix + "/" + path)) {
|
||||||
failed = false;
|
failed = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -233,7 +233,7 @@ QString Package::filePath(const char *fileType, const QString &filename) const
|
|||||||
|
|
||||||
//Nested loop, but in the medium case resolves to just one iteration
|
//Nested loop, but in the medium case resolves to just one iteration
|
||||||
foreach (const QString &contentsPrefix, d->structure->contentsPrefixPaths()) {
|
foreach (const QString &contentsPrefix, d->structure->contentsPrefixPaths()) {
|
||||||
const QString prefix(d->structure->path() + contentsPrefix);
|
const QString prefix(d->structure->path() + contentsPrefix + "/");
|
||||||
|
|
||||||
foreach (const QString &path, paths) {
|
foreach (const QString &path, paths) {
|
||||||
QString file = prefix + path;
|
QString file = prefix + path;
|
||||||
@ -387,7 +387,7 @@ QString Package::contentsHash() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach (QString prefix, d->structure->contentsPrefixPaths()) {
|
foreach (QString prefix, d->structure->contentsPrefixPaths()) {
|
||||||
const QString basePath = d->structure->path() + prefix;
|
const QString basePath = d->structure->path() + prefix + "/";
|
||||||
QDir dir(basePath);
|
QDir dir(basePath);
|
||||||
|
|
||||||
if (!dir.exists()) {
|
if (!dir.exists()) {
|
||||||
|
@ -41,6 +41,14 @@ namespace Plasma
|
|||||||
PlasmoidPackage::PlasmoidPackage(QObject *parent)
|
PlasmoidPackage::PlasmoidPackage(QObject *parent)
|
||||||
: Plasma::PackageStructure(parent, QString("Plasmoid"))
|
: Plasma::PackageStructure(parent, QString("Plasmoid"))
|
||||||
{
|
{
|
||||||
|
QString pathsString(getenv("PLASMA_CUSTOM_PREFIX_PATHS"));
|
||||||
|
if (!pathsString.isEmpty()) {
|
||||||
|
QStringList prefixPaths(pathsString.split(":"));
|
||||||
|
if (!prefixPaths.isEmpty()) {
|
||||||
|
setContentsPrefixPaths(prefixPaths);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
addDirectoryDefinition("images", "images", i18n("Images"));
|
addDirectoryDefinition("images", "images", i18n("Images"));
|
||||||
QStringList mimetypes;
|
QStringList mimetypes;
|
||||||
mimetypes << "image/svg+xml" << "image/png" << "image/jpeg";
|
mimetypes << "image/svg+xml" << "image/png" << "image/jpeg";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user