Commit abbdd998 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

kns: Don't add several knsrc files called the same

It usually will happen because plasma is installed in /usr and in a dev
parent a4b6d2d5
......@@ -70,11 +70,16 @@ class KNSBackendFactory : public AbstractResourcesBackendFactory {
QStringList locations = QStandardPaths::standardLocations(QStandardPaths::GenericConfigLocation);
QSet<QString> files;
for (const QString &path: locations) {
QDirIterator dirIt(path, {QStringLiteral("*.knsrc")}, QDir::Files);
for(; dirIt.hasNext(); ) {;
if (files.contains(dirIt.fileName()))
files << dirIt.fileName();
auto bk = new KNSBackend(parent, QStringLiteral("plasma"), dirIt.filePath());
if (bk->isValid())
ret += bk;
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