Bug 178605 - Akregator does not remember font size settings because there are two conflicting default values
Summary: Akregator does not remember font size settings because there are two conflict...
Status: RESOLVED FIXED
Alias: None
Product: akregator
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-23 21:55 UTC by Frank Reininghaus
Modified: 2009-01-27 09:00 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frank Reininghaus 2008-12-23 21:55:45 UTC
Version:            (using KDE 4.1.3)
OS:                Linux
Installed from:    Ubuntu Packages

The symptoms of the bug (found in 4.1.3, but still applies to today's trunk):

I've tried to set the medium font size in the Akregator settings from 10 to 12, but Akregator does not remember this setting, i.e., it gets lost and reset to 10 after closing and reopening Akregator (in fact, no line 'MediumFontSize=12' is added to akregatorrc in this case). It works for any other font size, but not 12.

My analysis of the problem:

In akregator/configuration/settings_advancedbase.ui, the default medium font size is set to 12. The consequence is that if I set the medium font size to 12 in the settings, the settings module thinks it's the default and therefore does not store the setting in akregatorrc.

But unfortunately, there's also another default setting: If no 'MediumFontSize=...' setting is found in akregatorrc on startup (or there is no akregatorrc file at all), Part::initFonts() in akregator_part.cpp sets the medium font size to Konqueror's font size or KGlobalSettings::generalFont().pointSize(), which turns out to be 10.

So the problem is that there are 2 conflicting default settings for the font size (also for the minimal one: 7 and 10). I think it might be better to only have one default value, i.e., the one in settings_advancedbase.ui. If no font size settings are found in akregatorrc, one could just use that value. The disadvantage is that Konqueror's settings are never used, but I think this is more than outweighed by the advantage that users (like me) don't have to wonder why their preferred settings are not stored ;-)
Comment 1 Frank Osterfeld 2009-01-10 23:52:34 UTC
SVN commit 909069 by osterfeld:

don't set default values for font sizes but rely on initFonts() find sensible defaults
fixes the case if the user-defined font size equals the default size.
BUG: 178605


 _M            . (directory)  
 M  +3 -7      akregator/src/akregator_part.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=909069
Comment 2 Frank Reininghaus 2009-01-11 12:13:46 UTC
It seems that the bug is not fixed: I'm still unable to set the medium font size to 12 in trunk rev. 909208. It still gets reset to 10 if I close and reopen Akregator.

I can't see how the patch could actually fix the issue: In the initialisation of the medium font size,

if (konq.hasKey("MediumFontSize"))
  medfs = konq.readEntry("MediumFontSize", 0);

was replaced by

if (konq.hasKey("MediumFontSize"))
  medfs = konq.readEntry("MediumFontSize", 12);

i.e., only the default to be used if no "MediumFontSize" key is found in the Konqueror settings was changed, but because that statement is only executed if konq.hasKey("MediumFontSize") is true, the change does not have any effect.
Comment 3 Frank Osterfeld 2009-01-14 17:55:58 UTC
SVN commit 911030 by osterfeld:

backport:
don't set default values for font sizes but rely on initFonts() find sensible defaults
fixes the case if the user-defined font size equals the default size.
CCBUG: 178605


 M  +0 -2      interfaces/akregator.kcfg  
 M  +3 -7      src/akregator_part.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=911030
Comment 4 Frank Osterfeld 2009-01-14 17:57:14 UTC
Please retry now, I committed an additional change in 909639 (but put the wrong bug in CCBUG)
Comment 5 Frank Reininghaus 2009-01-14 23:36:00 UTC
Yes, 909639 fixes it. Thanks!
Comment 6 Frank Osterfeld 2009-01-27 09:00:25 UTC
Ok, fixed now. The original commit broke the font sizes though when starting akregator the first time. That's fixed now, too.