Summary: | Lyrics applet font settings not saved properly | ||
---|---|---|---|
Product: | [Applications] amarok | Reporter: | perrantrevan |
Component: | Context View | Assignee: | Amarok Developers <amarok-bugs-dist> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | lfranchi, simon.esneault, stuffcorpse |
Priority: | NOR | ||
Version: | 2.2.2 | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: |
Description
perrantrevan
2010-01-11 20:29:39 UTC
Confirmed with current git. commit 112929450a0192a54353f52d5405f54c7cb399bd Author: Rick W. Chen <stuffcorpse@archlinux.us> Date: Wed Jan 13 18:14:08 2010 +1300 Fix lyrics applet settings not saving and restoring font styles BUG: 222277 diff --git a/src/context/applets/lyrics/LyricsApplet.cpp b/src/context/applets/lyrics/LyricsApplet.cpp index b932f8f..0529b4c 100644 --- a/src/context/applets/lyrics/LyricsApplet.cpp +++ b/src/context/applets/lyrics/LyricsApplet.cpp @@ -148,9 +148,10 @@ void LyricsApplet::init() // Read config KConfigGroup config = Amarok::config("Lyrics Applet"); - QFont font( config.readEntry( "Font", QString() ), - config.readEntry( "Size", -1 ) ); - m_lyrics->setFont( font ); + QFont font; + bool fontGood = font.fromString( config.readEntry( "Font", QString() ) ); + if( fontGood ) + m_lyrics->setFont( font ); connect( m_suggested, SIGNAL( anchorClicked( const QUrl& ) ), this, SLOT( suggestionChosen( const QUrl& ) ) ); connect( dataEngine( "amarok-lyrics" ), SIGNAL( sourceAdded( const QString& ) ), this, SLOT( connectSource( const QString& ) ) ); @@ -401,8 +402,7 @@ LyricsApplet::changeLyricsFont() m_lyrics->setFont( font ); KConfigGroup config = Amarok::config("Lyrics Applet"); - config.writeEntry( "Font", font.family() ); - config.writeEntry( "Size", font.pointSize() ); + config.writeEntry( "Font", font.toString() ); debug() << "Setting Lyrics Applet font: " << font.family() << " " << font.pointSize(); // resize with new font |