Skip to content
Permalink
Browse files

search in the new location for knsrc files

Summary:
search in the new knsrc location, still fallback to the old one for
compatibility

Test Plan: tested with files in both locations

Reviewers: #plasma, leinir

Reviewed By: leinir

Subscribers: leinir, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D21183
  • Loading branch information...
notmart committed May 13, 2019
1 parent fd4e91e commit e0df1f28231c54d0f92213b2a62428df578e581a
Showing with 10 additions and 1 deletion.
  1. +10 −1 src/kpackage-install-handlers/kns/main.cpp
@@ -24,6 +24,7 @@
#include <QTimer>
#include <QDebug>
#include <QStandardPaths>
#include <QFile>

#include <KLocalizedString>

@@ -46,7 +47,15 @@ int main(int argc, char** argv)
Q_ASSERT(url.isValid());
Q_ASSERT(url.scheme() == QLatin1String("kns"));

const auto knsname = QStandardPaths::locate(QStandardPaths::GenericConfigLocation, url.host());
QString knsname;
for (const auto &location : KNSCore::Engine::configSearchLocations()) {
QString candidate = location + QLatin1Char('/') + url.host();
if (QFile::exists(candidate)) {
knsname = candidate;
break;
}
}

if (knsname.isEmpty()) {
qWarning() << "couldn't find knsrc file for" << url.host();
return 1;

0 comments on commit e0df1f2

Please sign in to comment.
You can’t perform that action at this time.