Bug 144675 - [Patch]"Small Star" Rating Bug
Summary: [Patch]"Small Star" Rating Bug
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-25 19:07 UTC by gnux
Modified: 2007-07-01 08:49 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Moves the title "Awful" to half star and sets "Bad" for one star (480 bytes, patch)
2007-06-21 22:43 UTC, Tuomas Nurmi
Details
Half star rating also shown for example in tag dialog... (794 bytes, patch)
2007-06-22 00:29 UTC, Tuomas Nurmi
Details
A better version, last version broke the tag dialog a bit, now it works. (3.88 KB, patch)
2007-06-22 13:49 UTC, Tuomas Nurmi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description gnux 2007-04-25 19:07:10 UTC
Version:           svn Build Date 22.April 2007 (using KDE KDE 3.5.6)
Installed from:    Gentoo Packages
Compiler:          gcc version 4.1.1 (Gentoo 4.1.1-r3) 
OS:                Linux

if i rate a song with only 1 small star and point with my mouse on the small star amarok says the song is not rated at all.
i tried this for several songs and it's always the same.
Comment 1 Tuomas Nurmi 2007-06-21 22:43:55 UTC
Created attachment 20924 [details]
Moves the title "Awful" to half star and sets "Bad" for one star
Comment 2 Tuomas Nurmi 2007-06-22 00:29:05 UTC
Created attachment 20926 [details]
Half star rating also shown for example in tag dialog...
Comment 3 Tuomas Nurmi 2007-06-22 13:49:37 UTC
Created attachment 20928 [details]
A better version, last version broke the tag dialog a bit, now it works.
Comment 4 Seb Ruiz 2007-07-01 08:49:52 UTC
SVN commit 682013 by seb:

A single half star also has a rating, so don't show "Not Rated" as the label. Now, 0: No rating, 0.5: Awful, 1: Bad.
Patch by Tuomas Nurmi (Thanks man!)
BUG: 144675


 M  +3 -2      metabundle.cpp  
 M  +6 -6      tagdialog.cpp  
 M  +3 -0      tagdialogbase.ui  


--- branches/stable/extragear/multimedia/amarok/src/metabundle.cpp #682012:682013
@@ -1246,7 +1246,8 @@
 {
     switch( r )
     {
-        case 2: return i18n( "Awful" );
+        case 1: return i18n( "Awful" );
+        case 2: return i18n( "Bad" );
         case 3: return i18n( "Barely tolerable" );
         case 4: return i18n( "Tolerable" );
         case 5: return i18n( "Okay" );
@@ -1266,7 +1267,7 @@
     QString s = i18n( "rating - description", "%1 - %2" );
     QStringList list;
     list += ratingDescription( 0 );
-    for ( int i = 2; i<=10; i++ )
+    for ( int i = 1; i<=10; i++ )
         list += s.arg( prettyRating( i, true ) ).arg( ratingDescription( i ) );
     return list;
 }
--- branches/stable/extragear/multimedia/amarok/src/tagdialog.cpp #682012:682013
@@ -652,7 +652,7 @@
     kComboBox_artist       ->setCurrentText( m_bundle.artist() );
     kComboBox_album        ->setCurrentText( m_bundle.album() );
     kComboBox_genre        ->setCurrentText( m_bundle.genre() );
-    kComboBox_rating       ->setCurrentItem( m_bundle.rating() ? m_bundle.rating() - 1 : 0 );
+    kComboBox_rating       ->setCurrentItem( m_bundle.rating() );
     kIntSpinBox_track      ->setValue( m_bundle.track() );
     kComboBox_composer     ->setCurrentText( m_bundle.composer() );
     kIntSpinBox_year       ->setValue( m_bundle.year() );
@@ -905,7 +905,7 @@
     }
     if (rating) {
         m_bundle.setRating( first.rating() );
-        kComboBox_rating->setCurrentItem( first.rating() ? first.rating() - 1 : 0 );
+        kComboBox_rating->setCurrentItem( first.rating() );
     }
 
     m_currentURL = m_urlList.begin();
@@ -1011,7 +1011,7 @@
 
     if (kIntSpinBox_score->value() != m_bundle.score())
         result |= TagDialog::SCORECHANGED;
-    if (kComboBox_rating->currentItem() != ( m_bundle.rating() ? m_bundle.rating() - 1 : 0 ) )
+    if (kComboBox_rating->currentItem() != ( m_bundle.rating() ) )
         result |= TagDialog::RATINGCHANGED;
 
     if (!m_urlList.count() || m_perTrack) { //ignore these on MultipleTracksMode
@@ -1056,7 +1056,7 @@
     if( result & TagDialog::SCORECHANGED )
         storedScores.replace( url, kIntSpinBox_score->value() );
     if( result & TagDialog::RATINGCHANGED )
-        storedRatings.replace( url, kComboBox_rating->currentItem() ? kComboBox_rating->currentItem() + 1 : 0 );
+        storedRatings.replace( url, kComboBox_rating->currentItem() );
     if( result & TagDialog::LYRICSCHANGED ) {
         if ( kTextEdit_lyrics->text().isEmpty() )
             storedLyrics.replace( url, QString::null );
@@ -1299,10 +1299,10 @@
             changed |= TagDialog::SCORECHANGED;
         }
 
-        if( kComboBox_rating->currentItem() && kComboBox_rating->currentItem() != m_bundle.rating() - 1 ||
+        if( kComboBox_rating->currentItem() && kComboBox_rating->currentItem() != m_bundle.rating() ||
                 !kComboBox_rating->currentItem() && m_bundle.rating() )
         {
-            mb.setRating( kComboBox_rating->currentItem() ? kComboBox_rating->currentItem() + 1 : 0 );
+            mb.setRating( kComboBox_rating->currentItem() );
             changed |= TagDialog::RATINGCHANGED;
         }
         storeTags( *it, changed, mb );
--- branches/stable/extragear/multimedia/amarok/src/tagdialogbase.ui #682012:682013
@@ -718,6 +718,9 @@
                         <property name="name">
                             <cstring>kComboBox_rating</cstring>
                         </property>
+                        <property name="sizeLimit">
+                            <number>11</number>
+                        </property>
                     </widget>
                 </grid>
             </widget>