From 4126723a86bfa09a830c1e41fb1b49e6a114218a Mon Sep 17 00:00:00 2001 From: Arno Date: Sun, 5 Mar 2017 03:09:42 +0100 Subject: Ensure that Length: is only printed once --- playerwidget.cpp | 5 +++++ 1 file changed, 5 insertions(+) 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'))); } -- cgit v1.2.3-70-g09d2