Commit b161ab34 authored by Thomas Fischer's avatar Thomas Fischer 💬
Browse files

"QFontDatabase::FixedFont" instead of "Monospace"

File src/manager/walletwidget.ui specified font "Monospace" to use
when showing passwords. However, in case there is a font called
"Monospace" installed on the system, this font will be used instead
of the default/system fixed-width font.

If the "Monospace" font is broken or rendered incorrectly, passwords
cannot be read from within the wallet manager.

To fix this problem, this commit adds a line in the corresponding
C++ code in file src/manager/kwalleteditor.cpp which sets a fixed font
by invoking setFont(QFontDatabase::systemFont(QFontDatabase::FixedFont))
which uses the fixed-width font as configured by the user.

Differential Revision: https://phabricator.kde.org/D26288
parent c20ab5b9
...@@ -137,6 +137,8 @@ KWalletEditor::KWalletEditor(QWidget *parent, const QString &name) ...@@ -137,6 +137,8 @@ KWalletEditor::KWalletEditor(QWidget *parent, const QString &name)
connect(_showContents, &QToolButton::clicked, this, &KWalletEditor::showPasswordContents); connect(_showContents, &QToolButton::clicked, this, &KWalletEditor::showPasswordContents);
connect(_hideContents, &QToolButton::clicked, this, &KWalletEditor::hidePasswordContents); connect(_hideContents, &QToolButton::clicked, this, &KWalletEditor::hidePasswordContents);
_passwordValue->setFont(QFontDatabase::systemFont(QFontDatabase::FixedFont));
_binaryViewShow->setChecked(_alwaysShowContents); _binaryViewShow->setChecked(_alwaysShowContents);
// createActions(); // createActions();
// TODO: remove kwalleteditor.rc file // TODO: remove kwalleteditor.rc file
......
...@@ -169,11 +169,6 @@ ...@@ -169,11 +169,6 @@
</item> </item>
<item> <item>
<widget class="QTextEdit" name="_passwordValue"> <widget class="QTextEdit" name="_passwordValue">
<property name="font">
<font>
<family>Monospace</family>
</font>
</property>
<property name="acceptRichText"> <property name="acceptRichText">
<bool>false</bool> <bool>false</bool>
</property> </property>
......
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