diff options
author | Arno <arno@disconnect.de> | 2017-03-05 03:09:42 +0100 |
---|---|---|
committer | Arno <arno@disconnect.de> | 2017-03-05 03:09:42 +0100 |
commit | 4126723a86bfa09a830c1e41fb1b49e6a114218a (patch) | |
tree | da0d37c399e3d42514f8f49841831f9bf60e3b69 | |
parent | 81c4a6dd76dc60c8cc51e1dec1cec71874363f56 (diff) | |
download | BeetPlayer-4126723a86bfa09a830c1e41fb1b49e6a114218a.tar.gz BeetPlayer-4126723a86bfa09a830c1e41fb1b49e6a114218a.tar.bz2 BeetPlayer-4126723a86bfa09a830c1e41fb1b49e6a114218a.zip |
Ensure that Length: is only printed once
-rw-r--r-- | playerwidget.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/playerwidget.cpp b/playerwidget.cpp index cc95433..1bd8ac6 100644 --- a/playerwidget.cpp +++ b/playerwidget.cpp @@ -707,6 +707,11 @@ void PlayerWidget::setDuration(qint64 dur){ mSongSlider->setMaximum(mDurSecs); int minutes = mDurSecs / 60; int seconds = mDurSecs % 60; + QTextCursor cur = mCurrentTE->document()->find(QRegExp("^Length:")); + if(!cur.isNull()){ + cur.select(QTextCursor::BlockUnderCursor); + cur.removeSelectedText(); + } mCurrentTE->append(QString("%1 %2:%3").arg(tr("Length:"), -20).arg(minutes, 2, 10, QChar('0')).arg(seconds, 2, 10, QChar('0'))); } |