Commit 6c2d9d4a authored by David Edmundson's avatar David Edmundson Committed by Nate Graham
Browse files

Move to runtime check of valid font DPI

The current code checks if we have an entry, but not that the entry is
sane.

BUG: 449918
FIXED-IN: 5.24.1


(cherry picked from commit 0bb68186)
parent ef454e9d
Pipeline #137487 passed with stage
in 11 minutes and 12 seconds
......@@ -19,11 +19,12 @@ Q_DECL_EXPORT void kcminit()
QString fontDpiKey = KWindowSystem::isPlatformWayland() ? QStringLiteral("forceFontDPIWayland") : QStringLiteral("forceFontDPI");
if (!fontsCfg.hasKey(fontDpiKey)) {
const int dpi = fontsCfg.readEntry(fontDpiKey, 0);
if (dpi <= 0) {
return;
}
const QByteArray input = "Xft.dpi: " + QByteArray::number(fontsCfg.readEntry(fontDpiKey, 0));
const QByteArray input = "Xft.dpi: " + QByteArray::number(dpi);
QProcess p;
p.start(QStringLiteral("xrdb"), {QStringLiteral("-quiet"), QStringLiteral("-merge"), QStringLiteral("-nocpp")});
p.setProcessChannelMode(QProcess::ForwardedChannels);
......
Supports Markdown
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