summaryrefslogtreecommitdiffstats
path: root/src/libs
diff options
context:
space:
mode:
authorkh1 <karsten.heimrich@digia.com>2014-10-09 12:15:46 +0200
committerKarsten Heimrich <karsten.heimrich@digia.com>2014-10-09 13:07:01 +0200
commit9d4950068c3eb98f736b725d29395484b9aee6c6 (patch)
tree662c6667cb1933ce7b5608c35eb6d66433ca602a /src/libs
parent6ff29de7486afe9b6b58d0ea060100a7ba0b8c85 (diff)
Name the collection, otherwise leads to hangs or crashes.
Change-Id: I70302eb81479ced3bc8b6c15afd277ff5a1cc43a Reviewed-by: Jarek Kobus <jaroslaw.kobus@digia.com>
Diffstat (limited to 'src/libs')
-rw-r--r--src/libs/installer/binaryformatengine.cpp2
-rw-r--r--src/libs/installer/binaryformatenginehandler.cpp2
2 files changed, 4 insertions, 0 deletions
diff --git a/src/libs/installer/binaryformatengine.cpp b/src/libs/installer/binaryformatengine.cpp
index 9513d83c3..d493018ea 100644
--- a/src/libs/installer/binaryformatengine.cpp
+++ b/src/libs/installer/binaryformatengine.cpp
@@ -105,6 +105,7 @@ void BinaryFormatEngine::setFileName(const QString &file)
path.chop(1);
m_collection = m_collections.value(path.section(sep, 0, 0).toUtf8());
+ m_collection.setName(path.section(sep, 0, 0).toUtf8());
m_resource = m_collection.resourceByName(path.section(sep, 1, 1).toUtf8());
}
@@ -254,6 +255,7 @@ QStringList BinaryFormatEngine::entryList(QDir::Filters filters, const QStringLi
foreach (const ResourceCollection &collection, m_collections)
result.append(QString::fromUtf8(collection.name()));
}
+ result.removeAll(QString()); // Remove empty names, will crash while using directory iterator.
if (filterNames.isEmpty())
return result;
diff --git a/src/libs/installer/binaryformatenginehandler.cpp b/src/libs/installer/binaryformatenginehandler.cpp
index 8df9249bc..3388c5800 100644
--- a/src/libs/installer/binaryformatenginehandler.cpp
+++ b/src/libs/installer/binaryformatenginehandler.cpp
@@ -83,6 +83,8 @@ BinaryFormatEngineHandler::registerResource(const QString &fileName, const QStri
const QByteArray resourceName = path.section(sep, 1, 1).toUtf8();
const QByteArray collectionName = path.section(sep, 0, 0).toUtf8();
+
+ m_resources[collectionName].setName(collectionName);
m_resources[collectionName].appendResource(QSharedPointer<Resource>(new Resource(resourceName,
resourcePath)));
}