This commit is contained in:
Marco Martin 2014-09-01 16:26:34 +02:00
parent 325ea71a2e
commit 5db7db4ae2

View File

@ -820,7 +820,9 @@ PackagePrivate &PackagePrivate::operator=(const PackagePrivate &rhs)
structure = rhs.structure; structure = rhs.structure;
if (rhs.fallbackPackage) { if (rhs.fallbackPackage) {
(*fallbackPackage) = (*rhs.fallbackPackage); fallbackPackage = new Package(*rhs.fallbackPackage);
} else {
fallbackPackage = 0;
} }
path = rhs.path; path = rhs.path;
contentsPrefixPaths = rhs.contentsPrefixPaths; contentsPrefixPaths = rhs.contentsPrefixPaths;
@ -904,7 +906,7 @@ void PackagePrivate::createPackageMetadata(const QString &path)
QString PackagePrivate::fallbackFilePath(const char *key, const QString &filename) const QString PackagePrivate::fallbackFilePath(const char *key, const QString &filename) const
{ {
//don't fallback if the package isn't valid and never fallback the metadata file //don't fallback if the package isn't valid and never fallback the metadata file
if (fallbackPackage && fallbackPackage->isValid() && strcmp(key, "metadata") != 0) { if (qstrcmp(key, "metadata") != 0 && fallbackPackage && fallbackPackage->isValid()) {
return fallbackPackage->filePath(key, filename); return fallbackPackage->filePath(key, filename);
} else { } else {
return QString(); return QString();