diff --git a/applet.cpp b/applet.cpp index 22b9bd6ea..c55a2471b 100644 --- a/applet.cpp +++ b/applet.cpp @@ -671,12 +671,10 @@ ConfigLoader *Applet::configScheme() const DataEngine *Applet::dataEngine(const QString &name) const { - if (!d->remoteLocation.isEmpty()) { - return d->remoteDataEngine(KUrl(d->remoteLocation), name); - } else if (!package() || package()->metadata().remoteLocation().isEmpty()) { + if (d->remoteLocation.isEmpty()) { return d->dataEngine(name); } else { - return d->remoteDataEngine(KUrl(package()->metadata().remoteLocation()), name); + return d->remoteDataEngine(d->remoteLocation, name); } } @@ -2317,7 +2315,7 @@ Applet *Applet::loadPlasmoid(const QString &path, uint appletId, const QVariantL { if (QFile::exists(path + "/metadata.desktop")) { KService service(path + "/metadata.desktop"); - const QStringList& types = service.serviceTypes(); + const QStringList &types = service.serviceTypes(); if (types.contains("Plasma/Containment")) { return new Containment(path, appletId, args); diff --git a/private/applet_p.h b/private/applet_p.h index bd3c1e9e9..c5990128a 100644 --- a/private/applet_p.h +++ b/private/applet_p.h @@ -196,7 +196,7 @@ public: KKeySequenceWidget *shortcutEditor; //TODO: subclass KConfigDialog and encapsulate this in there ItemStatus itemStatus; - QString remoteLocation; + KUrl remoteLocation; Ui::publishWidget publishUI; // the applet can change size policy by itself, so save the old one for eventual restore diff --git a/remote/accessappletjob.cpp b/remote/accessappletjob.cpp index ca4f9a553..a356a3c2b 100644 --- a/remote/accessappletjob.cpp +++ b/remote/accessappletjob.cpp @@ -76,7 +76,7 @@ public: applet = Applet::load(pluginName); if (applet) { - applet->d->remoteLocation = location.prettyUrl(); + applet->d->remoteLocation = location; } else { q->setError(-1); q->setErrorText(i18n("The \"%1\" widget is not installed.", pluginName)); @@ -129,7 +129,6 @@ public: int answer = KMessageBox::createKMessageBox(dialog, KIcon(iconName), message, QStringList(), QString(), 0, KMessageBox::Dangerous); - //int answer = KMessageBox::questionYesNo(0, message, i18n("Remote Widget")); if (answer!=KDialog::Yes) { q->setError(-1); @@ -138,17 +137,9 @@ public: return; } - /** - QString metadataFilename = path + "/metadata.desktop"; - KDesktopFile cfg(metadataFilename); - KConfigGroup config = cfg.desktopGroup(); - config.writeEntry("EngineLocation", location.prettyUrl()); - config.sync(); - */ - applet = Applet::loadPlasmoid(path); if (applet) { - applet->d->remoteLocation = location.prettyUrl(); + applet->d->remoteLocation = location; } else { q->setError(-1); }