Bug 184304 - [PATCH] Dynamic playlists: weight values not saved correctly
Summary: [PATCH] Dynamic playlists: weight values not saved correctly
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: Playlists/Dynamic Playlists (show other bugs)
Version: 2.0.1
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-14 13:49 UTC by Georg Hennig
Modified: 2009-02-14 17:06 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Patch against 2.0.1.1 (561 bytes, patch)
2009-02-14 13:51 UTC, Georg Hennig
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Georg Hennig 2009-02-14 13:49:42 UTC
Version:           2.0.1.1 (using KDE 4.2.0)
OS:                Linux
Installed from:    Compiled From Sources

Symptom: Weight percentages of dynamic playlists aren't loaded (all entries are set to 0%) after saving them and re-opening amarok. Using LANG=de_DE.UTF-8@euro.

Reason: When saving the dynamic playlist (~/.kde4.2/share/apps/amarok/dynamic.xml), double float values are saved locale dependend:
<weight value="0,4" />
instead of
<weight value="0.4" />
(note the comma!)

This is a bug/feature of
QDomElement setAttribute ( const QString & name, double value )
Refer to
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=483289
for details.

Instead of using
weight.setAttribute( "value", m_weight );
you can use
weight.setAttribute( "value", QString::number( m_weight, 'f', 16 ) );
Comment 1 Georg Hennig 2009-02-14 13:51:14 UTC
Created attachment 31290 [details]
Patch against 2.0.1.1

This patch fixes this issue, however there might be other invalid usage of
QDomElement setAttribute
that I didn't find.
Comment 2 Mark Kretschmann 2009-02-14 16:15:40 UTC
SVN commit 925963 by markey:

Save dynamic playlist weight values correctly with both "," and "." as
decimal separator.

Big thanks for the patch go to Georg Hennig <georg298@gmx.de>.

BUG: 184304

 M  +1 -1      Bias.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=925963
Comment 3 Dan Meltzer 2009-02-14 17:06:41 UTC
SVN commit 926058 by dmeltzer:

Save dynamic playlist weight values correctly with both "," and "." as
decimal separator.

Big thanks for the patch go to Georg Hennig <georg298@gmx.de>.

BUG: 184304

 M  +1 -1      Bias.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=926058