diff --git a/components/contentselector/model/contentmodel.cpp b/components/contentselector/model/contentmodel.cpp index a1959d59f7..f8d6264a8d 100644 --- a/components/contentselector/model/contentmodel.cpp +++ b/components/contentselector/model/contentmodel.cpp @@ -674,8 +674,12 @@ void ContentSelectorModel::ContentModel::setNonUserContent(const QStringList& fi int insertPosition = 0; - while (insertPosition < mFiles.size() && mFiles.at(insertPosition)->builtIn()) + for (auto* file : mFiles) + { + if (!file->builtIn()) + break; ++insertPosition; + } for (const auto& filepath : fileList) {