From 0c847e15f04a59c9f518589c68da61877ef26184 Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Fri, 20 May 2011 10:45:22 +0200 Subject: [PATCH] remove registerPackage; the impl is broken (assume a plasmoid) and isn't used --- package.cpp | 37 ------------------------------------- package.h | 8 -------- 2 files changed, 45 deletions(-) diff --git a/package.cpp b/package.cpp index 316a42b41..894c843af 100644 --- a/package.cpp +++ b/package.cpp @@ -467,43 +467,6 @@ QStringList Package::listInstalledPaths(const QString &packageRoot) // static 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, const QString &source, const QString &destination, diff --git a/package.h b/package.h index e20a0cb98..2c45f0527 100644 --- a/package.h +++ b/package.h @@ -177,14 +177,6 @@ class PLASMA_EXPORT Package **/ 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 * in the source directory