From fad486922aa8ac8a4e55bd154bd8817f759d7ebd Mon Sep 17 00:00:00 2001 From: Arno Date: Tue, 7 Mar 2017 08:32:53 +0100 Subject: Set correct window title when changing from pause to play --- playerwidget.cpp | 5 +++-- playerwidget.h | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/playerwidget.cpp b/playerwidget.cpp index d32d383..b454908 100644 --- a/playerwidget.cpp +++ b/playerwidget.cpp @@ -559,6 +559,7 @@ void PlayerWidget::doPlay(){ mPlayer->play(); mPlayA->setChecked(true); emit playModeChanged(tr("Playing")); + emit setWinTitle(mCurWinTitle); return; } int playListCount = mPlayListModel->rowCount(); @@ -849,8 +850,8 @@ void PlayerWidget::play(const QString &fullPath){ mCurrentTE->append(QString("%1 %2:%3").arg(tr("Length:"), -20).arg(minutes, 2, 10, QChar('0')).arg(seconds, 2, 10, QChar('0'))); QString msg = QString("File: %1").arg(fullPath); emit message(msg); - QString winTitle = QString(tr("%1 [%2 - %3 - %4]")).arg(qApp->applicationName()).arg(artist).arg(album).arg(title); - emit setWinTitle(winTitle); + mCurWinTitle = QString(tr("%1 [%2 - %3 - %4]")).arg(qApp->applicationName()).arg(artist).arg(album).arg(title); + emit setWinTitle(mCurWinTitle); mPlayer->play(); mPlayA->setChecked(true); emit playModeChanged(tr("Playing")); diff --git a/playerwidget.h b/playerwidget.h index 45c81ad..0218fde 100644 --- a/playerwidget.h +++ b/playerwidget.h @@ -102,6 +102,7 @@ class PlayerWidget : public QWidget { qint64 mDurSecs; quint64 mPlayListLength; QString mCurDir; + QString mCurWinTitle; }; #endif // PLAYERWIDGET_H -- cgit v1.2.3-70-g09d2