Changeset View
Changeset View
Standalone View
Standalone View
src/platformtheme/khintssettings.cpp
Show All 28 Lines | |||||
29 | #include <QToolBar> | 29 | #include <QToolBar> | ||
30 | #include <QPalette> | 30 | #include <QPalette> | ||
31 | #include <QToolButton> | 31 | #include <QToolButton> | ||
32 | #include <QMainWindow> | 32 | #include <QMainWindow> | ||
33 | #include <QApplication> | 33 | #include <QApplication> | ||
34 | #include <QGuiApplication> | 34 | #include <QGuiApplication> | ||
35 | #include <QDialogButtonBox> | 35 | #include <QDialogButtonBox> | ||
36 | #include <QScreen> | 36 | #include <QScreen> | ||
37 | #include <QStandardPaths> | ||||
37 | 38 | | |||
38 | #include <QDBusConnection> | 39 | #include <QDBusConnection> | ||
39 | #include <QDBusInterface> | 40 | #include <QDBusInterface> | ||
40 | 41 | | |||
41 | #include <kiconloader.h> | 42 | #include <kiconloader.h> | ||
42 | #include <kconfiggroup.h> | 43 | #include <kconfiggroup.h> | ||
43 | #include <ksharedconfig.h> | 44 | #include <ksharedconfig.h> | ||
44 | #include <kcolorscheme.h> | 45 | #include <kcolorscheme.h> | ||
▲ Show 20 Lines • Show All 117 Lines • ▼ Show 20 Line(s) | 138 | { | |||
162 | 163 | | |||
163 | return defaultValue; | 164 | return defaultValue; | ||
164 | } | 165 | } | ||
165 | 166 | | |||
166 | QStringList KHintsSettings::xdgIconThemePaths() const | 167 | QStringList KHintsSettings::xdgIconThemePaths() const | ||
167 | { | 168 | { | ||
168 | QStringList paths; | 169 | QStringList paths; | ||
169 | 170 | | |||
171 | // make sure we have ~/.local/share/icons in paths if it exists | ||||
172 | paths << QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("icons"), QStandardPaths::LocateDirectory); | ||||
173 | | ||||
170 | const QFileInfo homeIconDir(QDir::homePath() + QStringLiteral("/.icons")); | 174 | const QFileInfo homeIconDir(QDir::homePath() + QStringLiteral("/.icons")); | ||
171 | if (homeIconDir.isDir()) { | 175 | if (homeIconDir.isDir()) { | ||
172 | paths << homeIconDir.absoluteFilePath(); | 176 | paths << homeIconDir.absoluteFilePath(); | ||
173 | } | 177 | } | ||
174 | 178 | | |||
175 | QString xdgDirString = QFile::decodeName(qgetenv("XDG_DATA_DIRS")); | | |||
176 | | ||||
177 | if (xdgDirString.isEmpty()) { | | |||
178 | xdgDirString = QStringLiteral("/usr/local/share:/usr/share"); | | |||
179 | } | | |||
180 | | ||||
181 | foreach (const QString &xdgDir, xdgDirString.split(QLatin1Char(':'))) { | | |||
182 | const QFileInfo xdgIconsDir(xdgDir + QStringLiteral("/icons")); | | |||
183 | if (xdgIconsDir.isDir()) { | | |||
184 | paths << xdgIconsDir.absoluteFilePath(); | | |||
185 | } | | |||
186 | } | | |||
187 | | ||||
188 | return paths; | 179 | return paths; | ||
189 | } | 180 | } | ||
190 | 181 | | |||
191 | void KHintsSettings::delayedDBusConnects() | 182 | void KHintsSettings::delayedDBusConnects() | ||
192 | { | 183 | { | ||
193 | QDBusConnection::sessionBus().connect(QString(), QStringLiteral("/KToolBar"), QStringLiteral("org.kde.KToolBar"), | 184 | QDBusConnection::sessionBus().connect(QString(), QStringLiteral("/KToolBar"), QStringLiteral("org.kde.KToolBar"), | ||
194 | QStringLiteral("styleChanged"), this, SLOT(toolbarStyleChanged())); | 185 | QStringLiteral("styleChanged"), this, SLOT(toolbarStyleChanged())); | ||
195 | QDBusConnection::sessionBus().connect(QString(), QStringLiteral("/KGlobalSettings"), QStringLiteral("org.kde.KGlobalSettings"), | 186 | QDBusConnection::sessionBus().connect(QString(), QStringLiteral("/KGlobalSettings"), QStringLiteral("org.kde.KGlobalSettings"), | ||
▲ Show 20 Lines • Show All 231 Lines • Show Last 20 Lines |