Do something more sensible with negative times.

This commit is contained in:
David Sansome 2010-03-08 14:13:22 +00:00
parent c9ddf09869
commit d15fffc802
1 changed files with 4 additions and 0 deletions

View File

@ -70,6 +70,10 @@ void TrackSlider::SetStopped() {
}
QString TrackSlider::PrettyTime(int seconds) {
// last.fm sometimes gets the track length wrong, so you end up with
// negative times.
seconds = qAbs(seconds);
int hours = seconds / (60*60);
int minutes = (seconds / 60) % 60;
seconds %= 60;