remove createPackage as well; it's a bit impl-specific and isn't used anywhere
This commit is contained in:
parent
0c847e15f0
commit
89c7e9b726
31
package.cpp
31
package.cpp
@ -467,37 +467,6 @@ QStringList Package::listInstalledPaths(const QString &packageRoot) // static
|
||||
return packages;
|
||||
}
|
||||
|
||||
bool Package::createPackage(const PackageMetadata &metadata,
|
||||
const QString &source,
|
||||
const QString &destination,
|
||||
const QString &icon) // static
|
||||
{
|
||||
Q_UNUSED(icon)
|
||||
if (!metadata.isValid()) {
|
||||
kWarning() << "Metadata file is not complete";
|
||||
return false;
|
||||
}
|
||||
|
||||
// write metadata in a temporary file
|
||||
KTemporaryFile metadataFile;
|
||||
if (!metadataFile.open()) {
|
||||
return false;
|
||||
}
|
||||
metadata.write(metadataFile.fileName());
|
||||
|
||||
// put everything into a zip archive
|
||||
KZip creation(destination);
|
||||
creation.setCompression(KZip::NoCompression);
|
||||
if (!creation.open(QIODevice::WriteOnly)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
creation.addLocalFile(metadataFile.fileName(), "metadata.desktop");
|
||||
creation.addLocalDirectory(source, "contents");
|
||||
creation.close();
|
||||
return true;
|
||||
}
|
||||
|
||||
PackagePrivate::PackagePrivate(const PackageStructure::Ptr st, const QString &p)
|
||||
: structure(st),
|
||||
service(0)
|
||||
|
15
package.h
15
package.h
@ -177,21 +177,6 @@ class PLASMA_EXPORT Package
|
||||
**/
|
||||
static QStringList listInstalledPaths(const QString &packageRoot);
|
||||
|
||||
/**
|
||||
* Creates a package based on the metadata from the files contained
|
||||
* in the source directory
|
||||
*
|
||||
* @arg metadata description of the package to create
|
||||
* @arg source path to local directory containing the individual
|
||||
* files to be added to the package
|
||||
* @arg destination path to the package that should be created
|
||||
* @arg icon path to the package icon
|
||||
**/
|
||||
static bool createPackage(const PackageMetadata &metadata,
|
||||
const QString &source,
|
||||
const QString &destination,
|
||||
const QString &icon = QString());
|
||||
|
||||
private:
|
||||
PackagePrivate * const d;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user