Changeset View
Changeset View
Standalone View
Standalone View
src/appearancegtk2.cpp
Show All 37 Lines | 35 | { | |||
---|---|---|---|---|---|
38 | if (!configFile.open(QIODevice::ReadOnly | QIODevice::Text)) | 38 | if (!configFile.open(QIODevice::ReadOnly | QIODevice::Text)) | ||
39 | return false; | 39 | return false; | ||
40 | 40 | | |||
41 | const QMap<QString, QString> foundSettings = readSettingsTuples(&configFile); | 41 | const QMap<QString, QString> foundSettings = readSettingsTuples(&configFile); | ||
42 | 42 | | |||
43 | for(auto it = foundSettings.constBegin(), itEnd = foundSettings.constEnd(); it!=itEnd; ++it) { | 43 | for(auto it = foundSettings.constBegin(), itEnd = foundSettings.constEnd(); it!=itEnd; ++it) { | ||
44 | if (it.key() == "gtk-theme-name") | 44 | if (it.key() == "gtk-theme-name") | ||
45 | m_settings["theme"] = *it; | 45 | m_settings["theme"] = *it; | ||
46 | else if (it.key() == "gtk-primary-button-warps-slider") | | |||
47 | m_settings["primary_button_warps_slider"] = *it; | | |||
48 | } | 46 | } | ||
49 | return true; | 47 | return true; | ||
50 | } | 48 | } | ||
51 | 49 | | |||
52 | QString AppearanceGTK2::themesGtkrcFile(const QString& themeName) const | 50 | QString AppearanceGTK2::themesGtkrcFile(const QString& themeName) const | ||
53 | { | 51 | { | ||
54 | QStringList themes=installedThemes(); | 52 | QStringList themes=installedThemes(); | ||
55 | themes=themes.filter(QRegExp("/"+themeName+"/?$")); | 53 | themes=themes.filter(QRegExp("/"+themeName+"/?$")); | ||
▲ Show 20 Lines • Show All 84 Lines • ▼ Show 20 Line(s) | 124 | { | |||
140 | // widget_class "*" style "user-font" | 138 | // widget_class "*" style "user-font" | ||
141 | 139 | | |||
142 | static const QRegularExpression userFontStyleRegexp(QStringLiteral("style(.|\n)*{(.|\n)*}\nwidget_class.*\"user-font\"")); | 140 | static const QRegularExpression userFontStyleRegexp(QStringLiteral("style(.|\n)*{(.|\n)*}\nwidget_class.*\"user-font\"")); | ||
143 | fileContents.remove(userFontStyleRegexp); | 141 | fileContents.remove(userFontStyleRegexp); | ||
144 | } | 142 | } | ||
145 | 143 | | |||
146 | void AppearanceGTK2::reset() | 144 | void AppearanceGTK2::reset() | ||
147 | { | 145 | { | ||
148 | m_settings = QMap<QString, QString> { | 146 | m_settings = QMap<QString, QString> {}; | ||
apol: Should be m_settings.clear().
Not a big deal, it does the same, just FYI. | |||||
149 | {"toolbar_style", "GTK_TOOLBAR_ICONS"}, | | |||
150 | {"show_icons_buttons", "0"}, | | |||
151 | {"show_icons_menus", "0"}, | | |||
152 | {"primary_button_warps_slider", "false"} | | |||
153 | }; | | |||
154 | } | 147 | } | ||
155 | 148 | | |||
156 | QString AppearanceGTK2::defaultConfigFile() const | 149 | QString AppearanceGTK2::defaultConfigFile() const | ||
157 | { | 150 | { | ||
158 | return QDir::homePath()+"/.gtkrc-2.0"; | 151 | return QDir::homePath()+"/.gtkrc-2.0"; | ||
159 | } | 152 | } | ||
160 | 153 | | |||
161 | QStringList AppearanceGTK2::installedThemes() const | 154 | QStringList AppearanceGTK2::installedThemes() const | ||
▲ Show 20 Lines • Show All 48 Lines • Show Last 20 Lines |
Should be m_settings.clear().
Not a big deal, it does the same, just FYI.