Commit 693a2ea3 authored by Alexander Lohnau's avatar Alexander Lohnau Committed by Nate Graham
Browse files

Do not set user-visible name as additional agent information

Instead we want the filename, which is more useful as an identifier anyways, because
we would otherwise have to check which user-visible names originate from which knsrc file.

BUG: 451165
parent f3429dbb
Pipeline #154275 passed with stage
in 1 minute and 11 seconds
......@@ -145,6 +145,7 @@ public:
QString busyMessage;
QString useLabel;
bool uploadEnabled = false;
QString configFileName;
};
Engine::Engine(QObject *parent)
......@@ -224,6 +225,7 @@ bool Engine::init(const QString &configfile)
conf.reset(new KConfig(configfile));
qCWarning(KNEWSTUFFCORE) << "Using a deprecated location for the knsrc file" << configfile
<< " - please contact the author of the software which provides this file to get it updated to use the new location";
configFileName = QFileInfo(configfile).baseName();
} else if (isRelativeConfig && actualConfig.isEmpty()) {
configFileName = QFileInfo(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("knsrcfiles/%1").arg(configfile))).baseName();
conf.reset(new KConfig(QStringLiteral("knsrcfiles/%1").arg(configfile), KConfig::FullConfig, QStandardPaths::GenericDataLocation));
......@@ -234,6 +236,7 @@ bool Engine::init(const QString &configfile)
configFileName = configFileInfo.baseName();
conf.reset(new KConfig(configfile));
}
d->configFileName = configFileName;
if (conf->accessMode() == KConfig::NoAccess) {
Q_EMIT signalErrorCode(KNSCore::ConfigFileError, i18n("Configuration file exists, but cannot be opened: \"%1\"", configfile), configfile);
......@@ -425,7 +428,7 @@ void Engine::slotProviderFileLoaded(const QDomDocument &doc)
QSharedPointer<KNSCore::Provider> provider;
if (isAtticaProviderFile || n.attribute(QStringLiteral("type")).toLower() == QLatin1String("rest")) {
provider.reset(new AtticaProvider(m_categories, d->name));
provider.reset(new AtticaProvider(m_categories, d->configFileName));
connect(provider.data(), &Provider::categoriesMetadataLoded, this, [this](const QList<Provider::CategoryMetadata> &categories) {
d->categoriesMetadata = categories;
Q_EMIT signalCategoriesMetadataLoded(categories);
......
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