Only search for metadata.desktop when necessary

This commit is contained in:
Sebastian Kügler 2014-02-02 02:25:08 +01:00
parent fa7ae03867
commit 9e491920e5

View File

@ -256,6 +256,7 @@ QString PackagePrivate::unpack(const QString& filePath)
tempRoot = tempdir.path() + '/';
source->copyTo(tempRoot);
if (!QFile::exists(tempdir.path()+"/metadata.desktop")) {
// search metadata.desktop, the zip file might have the package contents in a subdirectory
QDir unpackedPath(tempdir.path());
const QStringList &entries = unpackedPath.entryList(QDir::Dirs);
@ -265,6 +266,7 @@ QString PackagePrivate::unpack(const QString& filePath)
tempRoot = unpackedPath.absolutePath()+'/'+pack+'/';
}
}
}
createPackageMetadata(tempRoot);
} else {