From 97682614dd3882d6145f4ccb33af43a43e13c840 Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Wed, 13 Jul 2011 18:04:29 +0200 Subject: [PATCH] these list methods, while theoretically useful, were not actually used. out they go. if we ever need something like this, it should be provided by the plugin itself so as to be plugin neutral. --- package.cpp | 46 ---------------------------------------------- package.h | 18 ------------------ 2 files changed, 64 deletions(-) diff --git a/package.cpp b/package.cpp index f781c0be1..d61a68d2d 100644 --- a/package.cpp +++ b/package.cpp @@ -394,52 +394,6 @@ QString Package::contentsHash() const return hash.result(); } -//TODO: provide a version of this that allows one to ask for certain types of packages, etc? -// should we be using KService here instead/as well? -QStringList Package::listInstalled(const QString &packageRoot) // static -{ - QDir dir(packageRoot); - - if (!dir.exists()) { - return QStringList(); - } - - QStringList packages; - - foreach (const QString &sdir, dir.entryList(QDir::AllDirs | QDir::Readable)) { - QString metadata = packageRoot + '/' + sdir + "/metadata.desktop"; - if (QFile::exists(metadata)) { - const KPluginInfo info(metadata); - const QString plugin = info.pluginName(); - if (!plugin.isEmpty()) { - packages << plugin; - } - } - } - - return packages; -} - -QStringList Package::listInstalledPaths(const QString &packageRoot) // static -{ - QDir dir(packageRoot); - - if (!dir.exists()) { - return QStringList(); - } - - QStringList packages; - - foreach (const QString &sdir, dir.entryList(QDir::AllDirs | QDir::Readable)) { - QString metadata = packageRoot + '/' + sdir + "/metadata.desktop"; - if (QFile::exists(metadata)) { - packages << sdir; - } - } - - return packages; -} - PackagePrivate::PackagePrivate(const PackageStructure::Ptr st, const QString &p) : structure(st), service(0) diff --git a/package.h b/package.h index ab7e9266d..0227c166d 100644 --- a/package.h +++ b/package.h @@ -156,24 +156,6 @@ class PLASMA_EXPORT Package */ QString contentsHash() const; - /** - * Returns a list of all installed packages by name - * - * @param packageRoot path to the directory where Plasmagik packages - * have been installed to - * @return a list of installed Plasmagik packages - **/ - static QStringList listInstalled(const QString &packageRoot); - - /** - * Returns a list of all paths of installed packages in the given root - * - * @param packageRoot path to the directory where Plasmagik packages - * have been installed to - * @return a list of installed Plasmagik packages by path - **/ - static QStringList listInstalledPaths(const QString &packageRoot); - private: PackagePrivate * const d;