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:
parent
05834d8144
commit
97682614dd
46
package.cpp
46
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)
|
||||
|
18
package.h
18
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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user