remove registerPackage; the impl is broken (assume a plasmoid) and isn't used
This commit is contained in:
parent
bd2cb96e55
commit
0c847e15f0
37
package.cpp
37
package.cpp
@ -467,43 +467,6 @@ QStringList Package::listInstalledPaths(const QString &packageRoot) // static
|
|||||||
return packages;
|
return packages;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Package::registerPackage(const PackageMetadata &data, const QString &iconPath)
|
|
||||||
{
|
|
||||||
QString serviceName("plasma-applet-" + data.pluginName());
|
|
||||||
QString service = KStandardDirs::locateLocal("services", serviceName + ".desktop");
|
|
||||||
|
|
||||||
if (data.pluginName().isEmpty()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
data.write(service);
|
|
||||||
|
|
||||||
KDesktopFile config(service);
|
|
||||||
KConfigGroup cg = config.desktopGroup();
|
|
||||||
const QString type = data.type().isEmpty() ? "Service" : data.type();
|
|
||||||
cg.writeEntry("Type", type);
|
|
||||||
const QString serviceTypes = data.serviceType().isNull() ? "Plasma/Applet,Plasma/Containment" : data.serviceType();
|
|
||||||
cg.writeEntry("X-KDE-ServiceTypes", serviceTypes);
|
|
||||||
cg.writeEntry("X-KDE-PluginInfo-EnabledByDefault", true);
|
|
||||||
|
|
||||||
QFile icon(iconPath);
|
|
||||||
if (icon.exists()) {
|
|
||||||
//FIXME: the '/' search will break on non-UNIX. do we care?
|
|
||||||
QString installedIcon("plasma_applet_" + data.pluginName() +
|
|
||||||
iconPath.right(iconPath.length() - iconPath.lastIndexOf("/")));
|
|
||||||
cg.writeEntry("Icon", installedIcon);
|
|
||||||
installedIcon = KStandardDirs::locateLocal("icon", installedIcon);
|
|
||||||
#ifndef PLASMA_NO_KIO
|
|
||||||
KIO::FileCopyJob *job = KIO::file_copy(iconPath, installedIcon, -1, KIO::HideProgressInfo);
|
|
||||||
job->exec();
|
|
||||||
#else
|
|
||||||
QFile::copy(iconPath, installedIcon);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Package::createPackage(const PackageMetadata &metadata,
|
bool Package::createPackage(const PackageMetadata &metadata,
|
||||||
const QString &source,
|
const QString &source,
|
||||||
const QString &destination,
|
const QString &destination,
|
||||||
|
@ -177,14 +177,6 @@ class PLASMA_EXPORT Package
|
|||||||
**/
|
**/
|
||||||
static QStringList listInstalledPaths(const QString &packageRoot);
|
static QStringList listInstalledPaths(const QString &packageRoot);
|
||||||
|
|
||||||
/**
|
|
||||||
* Registers a package described by the given desktop file
|
|
||||||
*
|
|
||||||
* @arg the full path to the desktop file (must be KPluginInfo compatible)
|
|
||||||
* @return true on success, false on failure
|
|
||||||
*/
|
|
||||||
static bool registerPackage(const PackageMetadata &data, const QString &iconPath);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a package based on the metadata from the files contained
|
* Creates a package based on the metadata from the files contained
|
||||||
* in the source directory
|
* in the source directory
|
||||||
|
Loading…
x
Reference in New Issue
Block a user