Only search for metadata.desktop when necessary
This commit is contained in:
parent
fa7ae03867
commit
9e491920e5
@ -256,13 +256,15 @@ QString PackagePrivate::unpack(const QString& filePath)
|
||||
tempRoot = tempdir.path() + '/';
|
||||
source->copyTo(tempRoot);
|
||||
|
||||
// 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);
|
||||
foreach (const QString pack, entries) {
|
||||
if ((pack != "." && pack != "..") &&
|
||||
(QFile::exists(unpackedPath.absolutePath()+'/'+pack+"/metadata.desktop"))) {
|
||||
tempRoot = unpackedPath.absolutePath()+'/'+pack+'/';
|
||||
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);
|
||||
foreach (const QString pack, entries) {
|
||||
if ((pack != "." && pack != "..") &&
|
||||
(QFile::exists(unpackedPath.absolutePath()+'/'+pack+"/metadata.desktop"))) {
|
||||
tempRoot = unpackedPath.absolutePath()+'/'+pack+'/';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user