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 {
QVector<AbstractResourcesBackend*> newInstance(QObject* parent, const QString &/*name*/) const override
{
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);
for(; dirIt.hasNext(); ) {
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