API review: remove icon as parameter in write()
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=801424
This commit is contained in:
parent
dc044b79c2
commit
b21b9380de
@ -311,7 +311,7 @@ bool Package::installPackage(const QString& package,
|
|||||||
QFile icon(packageRoot + cg.readEntry("Icon"));
|
QFile icon(packageRoot + cg.readEntry("Icon"));
|
||||||
if (icon.exists()) {
|
if (icon.exists()) {
|
||||||
QString installedIcon("plasma_applet_" + meta.pluginName() + cg.readEntry("Icon"));
|
QString installedIcon("plasma_applet_" + meta.pluginName() + cg.readEntry("Icon"));
|
||||||
meta.write(targetName, installedIcon);
|
meta.write(targetName);
|
||||||
installedIcon = KStandardDirs::locateLocal("icon", installedIcon);
|
installedIcon = KStandardDirs::locateLocal("icon", installedIcon);
|
||||||
job = KIO::file_copy(icon.fileName(), installedIcon, -1, KIO::HideProgressInfo);
|
job = KIO::file_copy(icon.fileName(), installedIcon, -1, KIO::HideProgressInfo);
|
||||||
job->exec();
|
job->exec();
|
||||||
@ -373,7 +373,7 @@ bool Package::createPackage(const PackageMetadata &metadata,
|
|||||||
if (!metadataFile.open()) {
|
if (!metadataFile.open()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
metadata.write(metadataFile.fileName(), icon);
|
metadata.write(metadataFile.fileName());
|
||||||
|
|
||||||
// put everything into a zip archive
|
// put everything into a zip archive
|
||||||
KZip creation(destination);
|
KZip creation(destination);
|
||||||
|
@ -71,7 +71,7 @@ bool PackageMetadata::isValid() const
|
|||||||
d->type.isEmpty());
|
d->type.isEmpty());
|
||||||
}
|
}
|
||||||
|
|
||||||
void PackageMetadata::write(const QString &filename, const QString &icon) const
|
void PackageMetadata::write(const QString &filename) const
|
||||||
{
|
{
|
||||||
KDesktopFile cfg(filename);
|
KDesktopFile cfg(filename);
|
||||||
KConfigGroup config = cfg.desktopGroup();
|
KConfigGroup config = cfg.desktopGroup();
|
||||||
@ -79,9 +79,6 @@ void PackageMetadata::write(const QString &filename, const QString &icon) const
|
|||||||
|
|
||||||
config.writeEntry("Name", d->name);
|
config.writeEntry("Name", d->name);
|
||||||
config.writeEntry("Comment", d->description);
|
config.writeEntry("Comment", d->description);
|
||||||
if (!icon.isNull()) {
|
|
||||||
config.writeEntry("Icon", icon);
|
|
||||||
}
|
|
||||||
config.writeEntry("X-KDE-ServiceTypes", d->serviceType);
|
config.writeEntry("X-KDE-ServiceTypes", d->serviceType);
|
||||||
config.writeEntry("X-KDE-PluginInfo-Name", d->pluginName);
|
config.writeEntry("X-KDE-PluginInfo-Name", d->pluginName);
|
||||||
config.writeEntry("X-KDE-PluginInfo-Author", d->author);
|
config.writeEntry("X-KDE-PluginInfo-Author", d->author);
|
||||||
|
@ -52,9 +52,8 @@ public:
|
|||||||
* @see KPluginInfo
|
* @see KPluginInfo
|
||||||
*
|
*
|
||||||
* @arg filename path to the file to write to
|
* @arg filename path to the file to write to
|
||||||
* @arg icon path to the package icon
|
|
||||||
**/
|
**/
|
||||||
void write(const QString& filename, const QString &icon = QString()) const;
|
void write(const QString& filename) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reads in metadata from a file, which should be a .desktop
|
* Reads in metadata from a file, which should be a .desktop
|
||||||
|
Loading…
x
Reference in New Issue
Block a user