Export icon information to package metadata for remote service

Get the original package metadata's icon and inject this information
into the package metadata that is going to be sent to the remote targets.

This way we are able to use the icon in several UIs which makes things
more beautiful ;)

CCMAIL:ervin@kde.org
Signed-off-by: Artur Duque de Souza <asouza@kde.org>
This commit is contained in:
Artur Duque de Souza 2011-04-28 18:48:55 -03:00
parent fa109eaaf9
commit 97b37637fa
3 changed files with 3 additions and 0 deletions

View File

@ -1666,6 +1666,7 @@ void Applet::publish(AnnouncementMethods methods, const QString &resourceName)
PackageMetadata pm; PackageMetadata pm;
pm.setName(d->appletDescription.name()); pm.setName(d->appletDescription.name());
pm.setDescription(d->appletDescription.comment()); pm.setDescription(d->appletDescription.comment());
pm.setIcon(d->appletDescription.icon());
d->service->d->publish(methods, resourceName, pm); d->service->d->publish(methods, resourceName, pm);
} else { } else {
kDebug() << "Can not publish invalid applets."; kDebug() << "Can not publish invalid applets.";

View File

@ -151,6 +151,7 @@ void AccessManagerPrivate::slotAddService(DNSSD::RemoteService::Ptr service)
QMap<QString, QByteArray> textData = service->textData(); QMap<QString, QByteArray> textData = service->textData();
metadata.setName(textData["name"]); metadata.setName(textData["name"]);
metadata.setDescription(textData["description"]); metadata.setDescription(textData["description"]);
metadata.setIcon(textData["icon"]);
metadata.setRemoteLocation(url.prettyUrl()); metadata.setRemoteLocation(url.prettyUrl());
} else { } else {
kDebug() << "no textdata?"; kDebug() << "no textdata?";

View File

@ -112,6 +112,7 @@ void ServicePrivate::publish(AnnouncementMethods methods, const QString &name, c
textData["name"] = name.toUtf8(); textData["name"] = name.toUtf8();
textData["plasmoidname"] = metadata.name().toUtf8(); textData["plasmoidname"] = metadata.name().toUtf8();
textData["description"] = metadata.description().toUtf8(); textData["description"] = metadata.description().toUtf8();
textData["icon"] = metadata.icon().toUtf8();
publicService->setTextData(textData); publicService->setTextData(textData);
kDebug() << "about to publish"; kDebug() << "about to publish";