Merge pull request #4880 from Chocobozzz/master

Fix save state when the song was paused
This commit is contained in:
John Maguire 2015-06-02 18:14:27 +01:00
commit 4b332b8137
1 changed files with 20 additions and 17 deletions

View File

@ -422,7 +422,8 @@ MainWindow::MainWindow(Application* app, SystemTrayIcon* tray_icon, OSD* osd,
// Playlist view actions
ui_->action_next_playlist->setShortcuts(
QList<QKeySequence>() << QKeySequence::fromString("Ctrl+Tab")
QList<QKeySequence>()
<< QKeySequence::fromString("Ctrl+Tab")
#ifdef Q_OS_DARWIN
// On OS X "Ctrl+Tab" == Cmd + Tab but this shorcut
// is already used by default for switching between
@ -1190,13 +1191,15 @@ void MainWindow::LoadPlaybackStatus() {
void MainWindow::ResumePlayback() {
qLog(Debug) << "Resuming playback";
if (saved_playback_state_ == Engine::Paused) {
NewClosure(app_->player(), SIGNAL(Playing()), app_->player(),
SLOT(PlayPause()));
}
app_->player()->Play();
app_->player()->SeekTo(saved_playback_position_);
if (saved_playback_state_ == Engine::Paused) {
app_->player()->Pause();
}
}
void MainWindow::PlayIndex(const QModelIndex& index) {