at tokamak i said i regretted using the term "Language" to describe what is really "API". i meant it.
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=802486
This commit is contained in:
parent
b717f9bdbb
commit
9165b11235
@ -48,17 +48,17 @@ public:
|
||||
package(0)
|
||||
{
|
||||
if (runnerDescription.isValid()) {
|
||||
const QString language = runnerDescription.property("X-Plasma-Language").toString();
|
||||
if (!language.isEmpty()) {
|
||||
const QString api = runnerDescription.property("X-Plasma-API").toString();
|
||||
if (!api.isEmpty()) {
|
||||
const QString path = KStandardDirs::locate("data",
|
||||
"plasma/runners/" + runnerDescription.pluginName() + "/");
|
||||
PackageStructure::Ptr structure = Plasma::packageStructure(language, Plasma::RunnerComponent);
|
||||
PackageStructure::Ptr structure = Plasma::packageStructure(api, Plasma::RunnerComponent);
|
||||
structure->setPath(path);
|
||||
package = new Package(path, structure);
|
||||
|
||||
script = Plasma::loadScriptEngine(language, runner);
|
||||
script = Plasma::loadScriptEngine(api, runner);
|
||||
if (!script) {
|
||||
kDebug() << "Could not create a" << language << "ScriptEngine for the"
|
||||
kDebug() << "Could not create a" << api << "ScriptEngine for the"
|
||||
<< runnerDescription.name() << "Runner.";
|
||||
delete package;
|
||||
package = 0;
|
||||
@ -254,10 +254,10 @@ AbstractRunner::List AbstractRunner::loadAll(QObject* parent, const QStringList&
|
||||
QString error;
|
||||
foreach (const KService::Ptr &service, offers) {
|
||||
if (whitelist.empty() || whitelist.contains(service->name())) {
|
||||
QString language = service->property("X-Plasma-Language").toString();
|
||||
QString api = service->property("X-Plasma-API").toString();
|
||||
AbstractRunner* runner = 0;
|
||||
|
||||
if (language.isEmpty()) {
|
||||
if (api.isEmpty()) {
|
||||
QVariantList args;
|
||||
args << service->storageId();
|
||||
runner = service->createInstance<AbstractRunner>(parent, args, &error);
|
||||
|
14
applet.cpp
14
applet.cpp
@ -154,10 +154,10 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
QString language = appletDescription.property("X-Plasma-Language").toString();
|
||||
QString api = appletDescription.property("X-Plasma-API").toString();
|
||||
|
||||
// we have a scripted plasmoid
|
||||
if (!language.isEmpty()) {
|
||||
if (!api.isEmpty()) {
|
||||
// find where the Package is
|
||||
QString path = KStandardDirs::locate("data",
|
||||
"plasma/plasmoids/" + appletDescription.pluginName() +
|
||||
@ -169,7 +169,7 @@ public:
|
||||
} else {
|
||||
// create the package and see if we have something real
|
||||
//kDebug() << "trying for" << path;
|
||||
PackageStructure::Ptr structure = Plasma::packageStructure(language, Plasma::AppletComponent);
|
||||
PackageStructure::Ptr structure = Plasma::packageStructure(api, Plasma::AppletComponent);
|
||||
structure->setPath(path);
|
||||
package = new Package(path, structure);
|
||||
|
||||
@ -178,12 +178,12 @@ public:
|
||||
// it will be parented to this applet and so will get
|
||||
// deleted when the applet does
|
||||
|
||||
script = Plasma::loadScriptEngine(language, q);
|
||||
script = Plasma::loadScriptEngine(api, q);
|
||||
if (!script) {
|
||||
delete package;
|
||||
package = 0;
|
||||
q->setFailedToLaunch(true, i18n("Could not create a %1 ScriptEngine for the %2 widget.",
|
||||
language, appletDescription.name()));
|
||||
api, appletDescription.name()));
|
||||
}
|
||||
} else {
|
||||
q->setFailedToLaunch(true, i18n("Could not open the %1 package required for the %2 widget.",
|
||||
@ -1341,8 +1341,8 @@ Applet* Applet::load(const QString& appletName, uint appletId, const QVariantLis
|
||||
appletId = ++Private::s_maxAppletId;
|
||||
}
|
||||
|
||||
if (!offer->property("X-Plasma-Language").toString().isEmpty()) {
|
||||
kDebug() << "we have a script in the language of" << offer->property("X-Plasma-Language").toString();
|
||||
if (!offer->property("X-Plasma-API").toString().isEmpty()) {
|
||||
kDebug() << "we have a script using the" << offer->property("X-Plasma-API").toString() << "API";
|
||||
if (isContainment) {
|
||||
return new Containment(0, offer->storageId(), appletId);
|
||||
}
|
||||
|
@ -417,18 +417,18 @@ DataEngine::Private::Private(DataEngine* e, KService::Ptr service)
|
||||
|
||||
KPluginInfo dataEngineDescription(service);
|
||||
if (dataEngineDescription.isValid()) {
|
||||
QString language = dataEngineDescription.property("X-Plasma-Language").toString();
|
||||
QString api = dataEngineDescription.property("X-Plasma-API").toString();
|
||||
|
||||
if (!language.isEmpty()) {
|
||||
if (!api.isEmpty()) {
|
||||
const QString path = KStandardDirs::locate("data",
|
||||
"plasma/engines/" + dataEngineDescription.pluginName() + "/");
|
||||
PackageStructure::Ptr structure = Plasma::packageStructure(language, Plasma::RunnerComponent);
|
||||
PackageStructure::Ptr structure = Plasma::packageStructure(api, Plasma::RunnerComponent);
|
||||
structure->setPath(path);
|
||||
package = new Package(path, structure);
|
||||
|
||||
script = Plasma::loadScriptEngine(language, q);
|
||||
script = Plasma::loadScriptEngine(api, q);
|
||||
if (!script) {
|
||||
kDebug() << "Could not create a" << language << "ScriptEngine for the"
|
||||
kDebug() << "Could not create a" << api << "ScriptEngine for the"
|
||||
<< dataEngineDescription.name() << "DataEngine.";
|
||||
delete package;
|
||||
package = 0;
|
||||
|
@ -128,8 +128,8 @@ Plasma::DataEngine* DataEngineManager::loadEngine(const QString& name)
|
||||
} else {
|
||||
QVariantList allArgs;
|
||||
allArgs << offers.first()->storageId();
|
||||
QString language = offers.first()->property("X-Plasma-Language").toString();
|
||||
if (language.isEmpty()) {
|
||||
QString api = offers.first()->property("X-Plasma-API").toString();
|
||||
if (api.isEmpty()) {
|
||||
engine = offers.first()->createInstance<Plasma::DataEngine>(0, allArgs, &error);
|
||||
} else {
|
||||
engine = new DataEngine(0, offers.first());
|
||||
|
@ -42,7 +42,7 @@ class PackageMetadata::Private
|
||||
QString pluginName;
|
||||
QString type;
|
||||
QString serviceType;
|
||||
QString language;
|
||||
QString api;
|
||||
};
|
||||
|
||||
PackageMetadata::PackageMetadata()
|
||||
@ -87,7 +87,7 @@ void PackageMetadata::write(const QString &filename) const
|
||||
config.writeEntry("X-KDE-PluginInfo-Website", d->website);
|
||||
config.writeEntry("X-KDE-PluginInfo-License", d->license);
|
||||
config.writeEntry("X-KDE-PluginInfo-Category", d->type);
|
||||
config.writeEntry("X-Plasma-Language", d->language);
|
||||
config.writeEntry("X-Plasma-API", d->api);
|
||||
config.writeEntry("X-KDE-Plasmagik-ApplicationName", d->app);
|
||||
config.writeEntry("X-KDE-Plasmagik-RequiredVersion", d->requiredVersion);
|
||||
}
|
||||
@ -166,14 +166,14 @@ QString PackageMetadata::type() const
|
||||
return d->type;
|
||||
}
|
||||
|
||||
QString PackageMetadata::implementationLanguage() const
|
||||
QString PackageMetadata::implementationApi() const
|
||||
{
|
||||
return d->language;
|
||||
return d->api;
|
||||
}
|
||||
|
||||
void PackageMetadata::setImplementationLanguage(const QString& language)
|
||||
void PackageMetadata::setImplementationApi(const QString& api)
|
||||
{
|
||||
d->language = language;
|
||||
d->api = api;
|
||||
}
|
||||
|
||||
QString PackageMetadata::pluginName() const
|
||||
|
@ -76,7 +76,7 @@ public:
|
||||
QString application() const;
|
||||
QString requiredVersion() const;
|
||||
QString pluginName() const;
|
||||
QString implementationLanguage() const;
|
||||
QString implementationApi() const;
|
||||
|
||||
QString type() const;
|
||||
|
||||
@ -92,7 +92,7 @@ public:
|
||||
void setRequiredVersion(const QString &);
|
||||
void setType(const QString& type);
|
||||
void setPluginName(const QString& name);
|
||||
void setImplementationLanguage(const QString& language);
|
||||
void setImplementationApi(const QString& language);
|
||||
|
||||
private:
|
||||
class Private;
|
||||
|
Loading…
Reference in New Issue
Block a user