| Summary: | [Patch]"Small Star" Rating Bug | ||
|---|---|---|---|
| Product: | [Applications] amarok | Reporter: | gnux <_dennismueller_> | 
| Component: | general | Assignee: | Amarok Bugs <amarok-bugs-null> | 
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Gentoo Packages | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: | 
              Moves the title "Awful" to half star and sets "Bad" for one star
               Half star rating also shown for example in tag dialog... A better version, last version broke the tag dialog a bit, now it works.  | 
      ||
| 
 
        
          Description
        
        
          gnux
        
        
        
        
          2007-04-25 19:07:10 UTC
        
       
    Created attachment 20924 [details]
Moves the title "Awful" to half star and sets "Bad" for one star
    Created attachment 20926 [details]
Half star rating also shown for example in tag dialog...
    Created attachment 20928 [details]
A better version, last version broke the tag dialog a bit, now it works.
    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>
     |