rely on AppletPrivate::remoteLocation (removing the need for PackageMetadata) and make it a proper KUrl
This commit is contained in:
parent
be8b64f95c
commit
b01348aa84
@ -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);
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user