Revert "mechanism for coronas to load plasmoids from custom folders"

This reverts commit 2751b72835.
This commit is contained in:
Marco Martin 2016-03-08 15:39:50 +01:00
parent 12ea79b341
commit 5b0ec83c36
2 changed files with 2 additions and 44 deletions

View File

@ -57,8 +57,7 @@ class PluginLoaderPrivate
public: public:
PluginLoaderPrivate() PluginLoaderPrivate()
: isDefaultLoader(false), : isDefaultLoader(false),
plasmoidsDataDir(PLASMA_RELATIVE_DATA_INSTALL_DIR), packageRE("[^a-zA-Z0-9\\-_]")
packageRE(QLatin1String("[^a-zA-Z0-9\\-_]"))
{ {
KPackage::PackageLoader::self()->addKnownPackageStructure(QStringLiteral("Plasma/Applet"), new PlasmoidPackage()); KPackage::PackageLoader::self()->addKnownPackageStructure(QStringLiteral("Plasma/Applet"), new PlasmoidPackage());
KPackage::PackageLoader::self()->addKnownPackageStructure(QStringLiteral("Plasma/DataEngine"), new DataEnginePackage()); KPackage::PackageLoader::self()->addKnownPackageStructure(QStringLiteral("Plasma/DataEngine"), new DataEnginePackage());
@ -79,7 +78,6 @@ public:
static QString s_plasmoidsPluginDir; static QString s_plasmoidsPluginDir;
static QString s_servicesPluginDir; static QString s_servicesPluginDir;
static QString s_containmentActionsPluginDir; static QString s_containmentActionsPluginDir;
QString plasmoidsDataDir;
QRegExp packageRE; QRegExp packageRE;
}; };
@ -233,7 +231,6 @@ Applet *PluginLoader::loadApplet(const QString &name, uint appletId, const QVari
} }
} }
p.setDefaultPackageRoot(d->plasmoidsDataDir + "/plasmoids/");
// backwards compatibility: search in the root plugins directory // backwards compatibility: search in the root plugins directory
// TODO: remove when Plasma 5.4 is released // TODO: remove when Plasma 5.4 is released
{ {
@ -276,16 +273,6 @@ Applet *PluginLoader::loadApplet(const QString &name, uint appletId, const QVari
return applet; return applet;
} }
void PluginLoader::setAppletsDataDirectory(const QString &dir)
{
d->plasmoidsDataDir = dir;
}
QString PluginLoader::appletsDataDirectory() const
{
return d->plasmoidsDataDir;
}
DataEngine *PluginLoader::loadDataEngine(const QString &name) DataEngine *PluginLoader::loadDataEngine(const QString &name)
{ {
DataEngine *engine = d->isDefaultLoader ? 0 : internalLoadDataEngine(name); DataEngine *engine = d->isDefaultLoader ? 0 : internalLoadDataEngine(name);
@ -542,11 +529,7 @@ Package PluginLoader::loadPackage(const QString &packageFormat, const QString &s
structure = new PackageStructure(); structure = new PackageStructure();
structure->d->internalStructure = internalStructure; structure->d->internalStructure = internalStructure;
d->structures.insert(hashkey, structure); d->structures.insert(hashkey, structure);
Package p(structure); return Package(structure);
if (packageFormat == "Plasma/Applet") {
p.setDefaultPackageRoot(d->plasmoidsDataDir + "/plasmoids/");
}
return p;
} }
} }

View File

@ -66,31 +66,6 @@ public:
Applet *loadApplet(const QString &name, uint appletId = 0, Applet *loadApplet(const QString &name, uint appletId = 0,
const QVariantList &args = QVariantList()); const QVariantList &args = QVariantList());
/**
* Sets the data directory for plasmoids.
* By default plasmoid packages will be loaded from the
* "plasma" data directory, usually under the "share"
* subdirectory of the install prefix.
* An application that uses a custom plasma shell
* can have its private plasmoids
* in its own data directory, not having them mixeed
* with the ones from plasma desktop.
* It takes effect only in applets loaded after setting
* this, so use it at the application startup.
*
* @param dir data directory name
* @since 5.18
*/
void setAppletsDataDirectory(const QString &dir);
/**
* @return the custom applets data directory.
* Default is "plasma"
*
* @since 5.18
*/
QString appletsDataDirectory() const;
/** /**
* Load a DataEngine plugin. * Load a DataEngine plugin.
* *