Commit 3e8020b0 authored by Alexander Lohnau's avatar Alexander Lohnau 💬
Browse files

Deprecate Scope property

This property is completely unused. Also it seems like
a really bad idea to install third-party files in the system scope.
parent f9607abd
......@@ -129,6 +129,25 @@ bool Installation::readConfig(const KConfigGroup &group)
if (customName) {
qWarning(KNEWSTUFFCORE) << "The CustomName property is deprecated and will be removed in KF6";
}
QString scopeString = group.readEntry("Scope");
if (!scopeString.isEmpty()) {
qWarning(KNEWSTUFFCORE) << "Setting the scope is deprecated, it will default to user";
if (scopeString == QLatin1String("user")) {
scope = ScopeUser;
} else if (scopeString == QLatin1String("system")) {
scope = ScopeSystem;
} else {
qCCritical(KNEWSTUFFCORE) << QStringLiteral("The scope '") + scopeString + QStringLiteral("' is unknown.");
return false;
}
if (scope == ScopeSystem) {
if (!installPath.isEmpty()) {
qCCritical(KNEWSTUFFCORE) << "System installation cannot be mixed with InstallPath.";
return false;
}
}
}
#endif
installPath = group.readEntry("InstallPath");
......@@ -171,25 +190,6 @@ bool Installation::readConfig(const KConfigGroup &group)
return false;
}
}
QString scopeString = group.readEntry("Scope");
if (!scopeString.isEmpty()) {
if (scopeString == QLatin1String("user")) {
scope = ScopeUser;
} else if (scopeString == QLatin1String("system")) {
scope = ScopeSystem;
} else {
qCCritical(KNEWSTUFFCORE) << QStringLiteral("The scope '") + scopeString + QStringLiteral("' is unknown.");
return false;
}
if (scope == ScopeSystem) {
if (!installPath.isEmpty()) {
qCCritical(KNEWSTUFFCORE) << "System installation cannot be mixed with InstallPath.";
return false;
}
}
}
return true;
}
......
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