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.
This commit is contained in:
Aaron Seigo 2011-07-13 18:04:29 +02:00
parent 05834d8144
commit 97682614dd
2 changed files with 0 additions and 64 deletions

View File

@ -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)

View File

@ -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;