Commit 3c978830 authored by Sebastian Engel's avatar Sebastian Engel

Prevent possible Qt container detachment

clang analyzer detected a location where a QList element could be
detached. Following the example of KFileMetaData, qAsConst now
prevents detachment.

parent 423b0a36
......@@ -1451,8 +1451,9 @@ QMap<QString, QString> FileContent::toolTipInfos()
MetaDataExtractionResult result(fullPath(),;
KFileMetaData::ExtractorCollection extractorCollection;
QList<KFileMetaData::Extractor*> exList = extractorCollection.fetchExtractors(;
for (KFileMetaData::Extractor *ex : extractorCollection.fetchExtractors( {
for (KFileMetaData::Extractor *ex : qAsConst(exList)) {
const auto groups = result.preferredGroups();
DEBUG_WIN << "Metadata Extractor result has " << QString::number(groups.count()) << " groups";
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment