Commit 978700d9 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇

[KRDB] Read kdeglobals font and fallback to hardcoded default if neccessary

kcminit is non-desktopSettingsAware (for performance) which will keep it from loading
our platform theme. This also means that QFontDatabase also won't know our font settings.

Based on a patch by jingyu9575, thanks.

BUG: 378262
parent 8b2de1f2
......@@ -177,8 +177,19 @@ static void applyQtColors( KSharedConfigPtr kglobalcfg, QSettings& settings, QPa
static void applyQtSettings( KSharedConfigPtr kglobalcfg, QSettings& settings )
/* export font settings */
settings.setValue(QStringLiteral("/qt/font"), QFontDatabase::systemFont(QFontDatabase::GeneralFont).toString());
/* export font settings */
// NOTE keep this in sync with kfontsettingsdata in plasma-integration (cf. also Bug 378262)
QFont defaultFont(QStringLiteral("Noto Sans"), 10, -1);
const KConfigGroup configGroup(KSharedConfig::openConfig(), QStringLiteral("General"));
const QString fontInfo = configGroup.readEntry(QStringLiteral("font"), QString());
if (!fontInfo.isEmpty()) {
settings.setValue(QStringLiteral("/qt/font"), defaultFont.toString());
/* export effects settings */
KConfigGroup kdeCfgGroup(kglobalcfg, "General");
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment