Changeset View
Changeset View
Standalone View
Standalone View
src/advanceconfig.cpp
Show First 20 Lines • Show All 155 Lines • ▼ Show 20 Line(s) | 149 | { | |||
---|---|---|---|---|---|
156 | KConfigGroup dpiConfigGroup(&dpiConfig, "General"); | 156 | KConfigGroup dpiConfigGroup(&dpiConfig, "General"); | ||
157 | QString dpiValue = dpiConfigGroup.readEntry("forceFontDPI"); | 157 | QString dpiValue = dpiConfigGroup.readEntry("forceFontDPI"); | ||
158 | QString dpiArgument = QStringLiteral("-dpi ") + dpiValue; | 158 | QString dpiArgument = QStringLiteral("-dpi ") + dpiValue; | ||
159 | 159 | | |||
160 | KConfig numLockConfig(QStringLiteral("kcminputrc")); | 160 | KConfig numLockConfig(QStringLiteral("kcminputrc")); | ||
161 | KConfigGroup numLockConfigGroup(&numLockConfig, "Keyboard"); | 161 | KConfigGroup numLockConfigGroup(&numLockConfig, "Keyboard"); | ||
162 | QString numLock = numLockConfigGroup.readEntry("NumLock"); | 162 | QString numLock = numLockConfigGroup.readEntry("NumLock"); | ||
163 | 163 | | |||
164 | KConfig plasmaFontConfig(QStringLiteral("kdeglobals")); | ||||
165 | KConfigGroup plasmaFontGroup(&plasmaFontConfig, "General"); | ||||
166 | QString plasmaFont = plasmaFontGroup.readEntry("font"); | ||||
167 | | ||||
164 | // define paths | 168 | // define paths | ||
165 | const QString fontconfigPath = QStandardPaths::locate(QStandardPaths::GenericConfigLocation, QStringLiteral("fontconfig"), QStandardPaths::LocateDirectory); | 169 | const QString fontconfigPath = QStandardPaths::locate(QStandardPaths::GenericConfigLocation, QStringLiteral("fontconfig"), QStandardPaths::LocateDirectory); | ||
166 | const QString kdeglobalsPath = QStandardPaths::locate(QStandardPaths::GenericConfigLocation, QStringLiteral("kdeglobals")); | 170 | const QString kdeglobalsPath = QStandardPaths::locate(QStandardPaths::GenericConfigLocation, QStringLiteral("kdeglobals")); | ||
167 | const QString plasmarcPath = QStandardPaths::locate(QStandardPaths::GenericConfigLocation, QStringLiteral("plasmarc")); | 171 | const QString plasmarcPath = QStandardPaths::locate(QStandardPaths::GenericConfigLocation, QStringLiteral("plasmarc")); | ||
168 | const QString sddmUserConfigPath = KUser("sddm").homeDir() + QStringLiteral("/.config"); | 172 | const QString sddmUserConfigPath = KUser("sddm").homeDir() + QStringLiteral("/.config"); | ||
169 | 173 | | |||
170 | // send values and paths to helper, debug if it fails | 174 | // send values and paths to helper, debug if it fails | ||
171 | QVariantMap args; | 175 | QVariantMap args; | ||
Show All 26 Lines | 195 | if (!numLock.isEmpty()) { | |||
198 | else if (numLock == QStringLiteral("2")) { | 202 | else if (numLock == QStringLiteral("2")) { | ||
199 | args[QStringLiteral("kde_settings.conf/General/Numlock")] = QStringLiteral("none"); | 203 | args[QStringLiteral("kde_settings.conf/General/Numlock")] = QStringLiteral("none"); | ||
200 | } | 204 | } | ||
201 | } | 205 | } | ||
202 | else { | 206 | else { | ||
203 | qDebug() << "Cannot find NumLock value."; | 207 | qDebug() << "Cannot find NumLock value."; | ||
204 | } | 208 | } | ||
205 | 209 | | |||
210 | if (!plasmaFont.isEmpty()) { | ||||
211 | args[QStringLiteral("kde_settings.conf/Theme/Font")] = plasmaFont; | ||||
212 | } | ||||
213 | else { | ||||
214 | qDebug() << "Cannot find Plasma font value."; | ||||
215 | } | ||||
216 | | ||||
206 | if (!fontconfigPath.isEmpty()) { | 217 | if (!fontconfigPath.isEmpty()) { | ||
207 | args[QStringLiteral("fontconfig")] = fontconfigPath; | 218 | args[QStringLiteral("fontconfig")] = fontconfigPath; | ||
208 | } | 219 | } | ||
209 | else { | 220 | else { | ||
210 | qDebug() << "Cannot find fontconfig folder."; | 221 | qDebug() << "Cannot find fontconfig folder."; | ||
211 | } | 222 | } | ||
212 | 223 | | |||
213 | if (!kdeglobalsPath.isEmpty()) { | 224 | if (!kdeglobalsPath.isEmpty()) { | ||
▲ Show 20 Lines • Show All 52 Lines • ▼ Show 20 Line(s) | 264 | { | |||
266 | args[QStringLiteral("sddmUserConfig")] = sddmUserConfigPath; | 277 | args[QStringLiteral("sddmUserConfig")] = sddmUserConfigPath; | ||
267 | 278 | | |||
268 | args[QStringLiteral("kde_settings.conf/Theme/CursorTheme")] = QVariant(); | 279 | args[QStringLiteral("kde_settings.conf/Theme/CursorTheme")] = QVariant(); | ||
269 | 280 | | |||
270 | args[QStringLiteral("kde_settings.conf/X11/ServerArguments")] = QVariant(); | 281 | args[QStringLiteral("kde_settings.conf/X11/ServerArguments")] = QVariant(); | ||
271 | 282 | | |||
272 | args[QStringLiteral("kde_settings.conf/General/Numlock")] = QVariant(); | 283 | args[QStringLiteral("kde_settings.conf/General/Numlock")] = QVariant(); | ||
273 | 284 | | |||
285 | args[QStringLiteral("kde_settings.conf/Theme/Font")] = QVariant(); | ||||
286 | | ||||
274 | KAuth::Action resetAction(QStringLiteral("org.kde.kcontrol.kcmsddm.reset")); | 287 | KAuth::Action resetAction(QStringLiteral("org.kde.kcontrol.kcmsddm.reset")); | ||
275 | resetAction.setHelperId(QStringLiteral("org.kde.kcontrol.kcmsddm")); | 288 | resetAction.setHelperId(QStringLiteral("org.kde.kcontrol.kcmsddm")); | ||
276 | resetAction.setArguments(args); | 289 | resetAction.setArguments(args); | ||
277 | 290 | | |||
278 | auto job = resetAction.execute(); | 291 | auto job = resetAction.execute(); | ||
279 | job->exec(); | 292 | job->exec(); | ||
280 | 293 | | |||
281 | if (job->error()){ | 294 | if (job->error()){ | ||
Show All 9 Lines |