Summary: | KFontChooser does not correctly save & load fonts | ||
---|---|---|---|
Product: | [Unmaintained] kdelibs | Reporter: | Davorin Učakar <davorin.ucakar> |
Component: | kdeui | Assignee: | kdelibs bugs <kdelibs-bugs> |
Status: | RESOLVED DUPLICATE | ||
Severity: | normal | CC: | cbo, dhaumann, irina, pbrown, travisgevans, wuebben |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Arch Linux | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 4.9.1 | |
Sentry Crash Report: | |||
Attachments: | test case to reproduce the bug |
Description
Davorin Učakar
2011-12-24 14:58:27 UTC
Confirmed in Kate on KDE 4.8.0, and I recall experiencing this in KDE 3.5 as well. To reproduce: 1. Install Bitstream Vera fonts 2. Go into KAte's settings dialog and set the font style to, e.g., Bitstream Vera Sans Mono, style Roman. 3. Click OK. 4. Later, go back into the settings dialog. The style incorrectly reverts back to Oblique without even touching anything. Another way to reproduce in dolphin: 1. "Configure Dolphin..." 2. switch to "View Modes" 3. Choose "Font: Custom Font" and click "Choose..." 4. Choose "Bitstream Very Sans Mono", "Roman", "10" 5. OK, Apply, Ok to close the settings again. 6. "Configure Dolphin..." 7. switch to "View Modes" and click "Choose..." again 8. selected is "Bitsream Vera Sans Mono", "Bold Oblique", "10". Instead of "Bold Oblique", it should be "Roman". In Kate, we use KConfigBase::writeEntry() to write the QFont to disk. The string is: "Bitstream Vera Sans Mono,11,-1,5,50,0,0,0,0,0" When loading it again with KConfigBase::readEntry(), the text is still "Bitstream Vera Sans Mono,11,-1,5,50,0,0,0,0,0" So saving & loading through the QVariant part seems to work correctly. The bug is probably somewhere after this step, maybe in KFontChooser itself? Created attachment 69334 [details]
test case to reproduce the bug
Attached is a small demo application. It basically does the following:
1. read the font as we do in Kate: KConfig -> QVariant -> QFont
2. call KFontChooser::setFont()
3. get font with KFontChooser::font()
The test app compares 2 and 3. And the font style in 3 is incorrect.
KFontChooser::setFont() calls d->setupDisplay(); which in turn calls style = dbase.styleString(selFont).toLower();
Maybe this is where the result is already wrong.
@Preston, Bernd: Since you are the authors, can you please have a look as soon as possible?
*** Bug 305747 has been marked as a duplicate of this bug. *** I and Chusslove have analysed this and he is working on a fix *** This bug has been marked as a duplicate of bug 305747 *** |