summaryrefslogtreecommitdiffstats
path: root/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
diff options
context:
space:
mode:
authorJiDe Zhang <zccrs@live.com>2018-11-06 15:29:03 +0800
committerShawn Rutledge <shawn.rutledge@qt.io>2019-02-25 20:12:59 +0000
commitc93670c5a03cecbca9bb43aff65ceea3a401c7b1 (patch)
tree3e8d1e3e6db60f981916ffc51575c98aacf14d1c /src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
parent2f4c6582363d3fd2ece331913c4baedd6dae1061 (diff)
QGenericUnixTheme: use QStandardPaths get the xdg data path
The corresponding interface is already provided in QStandardPaths. We should use QStandardPaths::GenericDataLocation instead of the environment variable XDG_DATA_DIRS. Change-Id: I0e89e8c86d629585ec7d9a12989f24335aa6e3ba Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru> Reviewed-by: Dmitry Shachnev <mitya57@gmail.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'src/platformsupport/themes/genericunix/qgenericunixthemes.cpp')
-rw-r--r--src/platformsupport/themes/genericunix/qgenericunixthemes.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
index 1003812767..7b3f9b624a 100644
--- a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
+++ b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
@@ -172,15 +172,9 @@ QStringList QGenericUnixTheme::xdgIconThemePaths()
if (homeIconDir.isDir())
paths.prepend(homeIconDir.absoluteFilePath());
- QString xdgDirString = QFile::decodeName(qgetenv("XDG_DATA_DIRS"));
- if (xdgDirString.isEmpty())
- xdgDirString = QLatin1String("/usr/local/share/:/usr/share/");
- const auto xdgDirs = xdgDirString.splitRef(QLatin1Char(':'));
- for (const QStringRef &xdgDir : xdgDirs) {
- const QFileInfo xdgIconsDir(xdgDir + QLatin1String("/icons"));
- if (xdgIconsDir.isDir())
- paths.append(xdgIconsDir.absoluteFilePath());
- }
+ paths.append(QStandardPaths::locateAll(QStandardPaths::GenericDataLocation,
+ QStringLiteral("icons"),
+ QStandardPaths::LocateDirectory));
return paths;
}