summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--playerwidget.cpp5
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')));
}