Ticket #800: lcdmusictime.patch

File lcdmusictime.patch, 1.3 KB (added by eskil <myth@…>, 18 years ago)

patch, eliminate whitespace on long strings

  • mythplugins/mythmusic/mythmusic/playbackbox.cpp

     
    16571657                {
    16581658                    float percent_heard = maxTime<=0?0.0:((float)rs /
    16591659                                                          (float)curMeta->Length()) * 1000.0;
    1660                     lcd->setMusicProgress(time_string, percent_heard);
     1660                    QString lcd_time_string = time_string;
     1661                   
     1662                    // if the string is longer than the LCD, remove all
     1663                    // internal whitespace
     1664                    if (time_string.length() > lcd->getLCDWidth()) {
     1665                        QString new_lcd_time_string;
     1666                        for (uint cc = 0; cc < lcd_time_string.length(); cc++) {
     1667                            if (time_string[cc].isSpace())
     1668                                continue;
     1669                            new_lcd_time_string.append(time_string[cc]);
     1670                        }
     1671                        lcd_time_string = new_lcd_time_string;
     1672                    }
     1673                   
     1674                    lcd->setMusicProgress(lcd_time_string, percent_heard);
    16611675                }
    16621676            }
    16631677