Commit c5fef402 authored by Harald Sitter's avatar Harald Sitter 🏳️‍🌈
Browse files

unbreak XDG_CONFIG_DIRS and by extension autostart

"If $XDG_CONFIG_DIRS is either not set or empty, a value equal to
/etc/xdg should be used."

If XDG_CONFIG_DIRS was not set prior to startplasma, which it ordinarily
would not be, then the previous code would set the value to "$newdir:"
which was silly and also wrong as per the spec quoted above. Instead
default to /etc/xdg/.

Also camelCase the variables to follow our coding style.
parent 220c7258
......@@ -330,9 +330,12 @@ void setupPlasmaEnvironment()
qputenv("KDE_APPLICATIONS_AS_SCOPE", "1");
// Add kdedefaults dir to allow config defaults overriding from a writable location
const auto current_xdg_config_dirs = qgetenv("XDG_CONFIG_DIRS");
const auto new_xdg_dir = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation).toUtf8() + "/kdedefaults";
qputenv("XDG_CONFIG_DIRS", new_xdg_dir + ":" + current_xdg_config_dirs);
QByteArray currentConfigDirs = qgetenv("XDG_CONFIG_DIRS");
if (currentConfigDirs.isEmpty()) {
currentConfigDirs = "/etc/xdg";
}
const auto extraConfigDir = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation).toUtf8() + "/kdedefaults";
qputenv("XDG_CONFIG_DIRS", extraConfigDir + ":" + currentConfigDirs);
}
void setupX11()
......
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