* check the write attribute in the service for the Package type

* set the path of the loaded PackageStructure
* more verbose failure messages

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=780461
This commit is contained in:
Aaron J. Seigo 2008-02-29 08:11:45 +00:00
parent 331d163253
commit 427c61de9b

View File

@ -121,7 +121,7 @@ public:
applet->setAcceptsHoverEvents(true); applet->setAcceptsHoverEvents(true);
if (!appletDescription.isValid()) { if (!appletDescription.isValid()) {
applet->setFailedToLaunch(true); applet->setFailedToLaunch(true, i18n("Invalid applet description"));
return; return;
} }
@ -140,12 +140,14 @@ public:
} else { } else {
// create the package and see if we have something real // create the package and see if we have something real
//kDebug() << "trying for" << path; //kDebug() << "trying for" << path;
QString packageFormat = appletDescription.property("X-Plasma-PackageFormat").toString(); QString packageFormat = appletDescription.property("X-Plasma-Language").toString();
if (packageFormat.isEmpty()) { if (packageFormat.isEmpty()) {
package = new Package(path, PackageStructure::Ptr(new PlasmoidPackage())); package = new Package(path, PackageStructure::Ptr(new PlasmoidPackage()));
} else { } else {
package = new Package(path, PackageStructure::load(packageFormat)); PackageStructure::Ptr structure = PackageStructure::load(packageFormat);
structure->setPath(path);
package = new Package(path, structure);
} }
if (package->isValid()) { if (package->isValid()) {
@ -358,7 +360,7 @@ PackageStructure::Ptr Applet::packageStructure()
void Applet::init() void Applet::init()
{ {
if (d->script && !d->script->init()) { if (d->script && !d->script->init()) {
setFailedToLaunch(true); setFailedToLaunch(true, i18n("Script initialization failed"));
} }
} }