Skip to content

Commit 5f8e205

Browse files
committed
launch: fix XDG_DATA_DIRS default
previously, we defaulted to /usr/local/share:/usr/share if the key was not set the standard tells you do default if the key is not set _or is empty_ this fixes that
1 parent afa803c commit 5f8e205

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

src/launch/launch.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -196,13 +196,10 @@ int launch(const LaunchArgs& args, char** argv, QCoreApplication* coreApplicatio
196196
// This seems to be controlled by the QPA and qt6ct does not provide it.
197197
{
198198
QList<QString> dataPaths;
199-
200-
if (qEnvironmentVariableIsSet("XDG_DATA_DIRS")) {
201-
auto var = qEnvironmentVariable("XDG_DATA_DIRS");
202-
dataPaths = var.split(u':', Qt::SkipEmptyParts);
203-
} else {
204-
dataPaths.push_back("/usr/local/share");
205-
dataPaths.push_back("/usr/share");
199+
{
200+
auto dataDirs = qEnvironmentVariable("XDG_DATA_DIRS");
201+
if (dataDirs.isEmpty()) dataDirs = "/usr/local/share:/usr/share";
202+
dataPaths = dataDirs.split(u':', Qt::SkipEmptyParts);
206203
}
207204

208205
auto fallbackPaths = QIcon::fallbackSearchPaths();

0 commit comments

Comments
 (0)