Commit d617dd8e authored by Dan Leinir Turthra Jensen's avatar Dan Leinir Turthra Jensen 🌈

Search new knsrc locations

Using the search location getter added in D19338, ensure we get
all locations which KNSCore::Engine will search for knsrc files, without
making assumptions about where that might be.

Differential Revision: https://phabricator.kde.org/D19340
parent 3a8b8ebe
...@@ -65,7 +65,12 @@ class KNSBackendFactory : public AbstractResourcesBackendFactory { ...@@ -65,7 +65,12 @@ class KNSBackendFactory : public AbstractResourcesBackendFactory {
QVector<AbstractResourcesBackend*> newInstance(QObject* parent, const QString &/*name*/) const override QVector<AbstractResourcesBackend*> newInstance(QObject* parent, const QString &/*name*/) const override
{ {
QVector<AbstractResourcesBackend*> ret; QVector<AbstractResourcesBackend*> ret;
for (const QString &path: QStandardPaths::standardLocations(QStandardPaths::GenericConfigLocation)) { #if KNEWSTUFFCORE_VERSION_MAJOR==5 && KNEWSTUFFCORE_VERSION_MINOR>=57
QStringList locations = KNSCore::Engine::configSearchLocations();
#else
QStringList locations = QStandardPaths::standardLocations(QStandardPaths::GenericConfigLocation);
#endif
for (const QString &path: locations) {
QDirIterator dirIt(path, {QStringLiteral("*.knsrc")}, QDir::Files); QDirIterator dirIt(path, {QStringLiteral("*.knsrc")}, QDir::Files);
for(; dirIt.hasNext(); ) { for(; dirIt.hasNext(); ) {
dirIt.next(); dirIt.next();
......
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