Commit 0e56e381 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Ensure resource providers are not listed twice.

BUG: 460060
parent 1d5824b0
Pipeline #243501 passed with stage
in 5 minutes and 27 seconds
......@@ -45,13 +45,18 @@ void ProvidersRepository::refresh(bool fullRefresh)
};
QStringList profilesFiles;
QStringList addedProviders;
// list providers
QStringList customProfilesDir =
QStandardPaths::locateAll(QStandardPaths::AppDataLocation, QStringLiteral("resourceproviders"), QStandardPaths::LocateDirectory);
for (const auto &dir : qAsConst(customProfilesDir)) {
QStringList files = QDir(dir).entryList(QDir::Files);
for (const auto &file : qAsConst(files)) {
profilesFiles << QDir(dir).absoluteFilePath(file);
// Ensure we don't add the same file from different locations (for example Appimage reads its own and the system's resourceproviders folder
if (!addedProviders.contains(QFileInfo(file).fileName())) {
profilesFiles << QDir(dir).absoluteFilePath(file);
addedProviders << QFileInfo(file).fileName();
}
}
}
......
Supports Markdown
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