diff --git a/src/mediaplaylist.cpp b/src/mediaplaylist.cpp --- a/src/mediaplaylist.cpp +++ b/src/mediaplaylist.cpp @@ -985,14 +985,18 @@ void MediaPlayList::setRandomPlay(bool value) { - d->mRandomPlay = value; - Q_EMIT randomPlayChanged(); + if (d->mRandomPlay != value) { + d->mRandomPlay = value; + Q_EMIT randomPlayChanged(); + } } void MediaPlayList::setRepeatPlay(bool value) { - d->mRepeatPlay = value; - Q_EMIT repeatPlayChanged(); + if (d->mRepeatPlay != value) { + d->mRepeatPlay = value; + Q_EMIT repeatPlayChanged(); + } } void MediaPlayList::displayOrHideUndoInline(bool value) @@ -1167,16 +1171,14 @@ auto randomPlayStoredValue = d->mPersistentState.find(QStringLiteral("randomPlay")); if (randomPlayStoredValue != d->mPersistentState.end()) { setRandomPlay(randomPlayStoredValue->toBool()); - d->mPersistentState.erase(randomPlayStoredValue); } } void MediaPlayList::restoreRepeatPlay() { auto repeatPlayStoredValue = d->mPersistentState.find(QStringLiteral("repeatPlay")); if (repeatPlayStoredValue != d->mPersistentState.end()) { setRepeatPlay(repeatPlayStoredValue->toBool()); - d->mPersistentState.erase(repeatPlayStoredValue); } } diff --git a/src/qml/ElisaMainWindow.qml b/src/qml/ElisaMainWindow.qml --- a/src/qml/ElisaMainWindow.qml +++ b/src/qml/ElisaMainWindow.qml @@ -96,9 +96,6 @@ property double playControlItemVolume : 100.0 property bool playControlItemMuted : false - property bool playControlItemRepeat : false - property bool playControlItemShuffle : false - property bool expandedFilterView: false property bool showPlaylist: true @@ -126,8 +123,6 @@ persistentSettings.playControlItemVolume = headerBar.playerControl.volume persistentSettings.playControlItemMuted = headerBar.playerControl.muted - persistentSettings.playControlItemRepeat = headerBar.playerControl.repeat - persistentSettings.playControlItemShuffle = headerBar.playerControl.shuffle persistentSettings.showPlaylist = contentView.showPlaylist persistentSettings.headerBarIsMaximized = headerBar.isMaximized @@ -216,8 +211,8 @@ playerControl.playEnabled: elisa.playerControl.playControlEnabled playerControl.isPlaying: elisa.playerControl.musicPlaying - playerControl.repeat: persistentSettings.playControlItemRepeat - playerControl.shuffle: persistentSettings.playControlItemShuffle + playerControl.repeat: elisa.mediaPlayList.repeatPlay + playerControl.shuffle: elisa.mediaPlayList.randomPlay playerControl.onSeek: elisa.audioPlayer.seek(position) @@ -332,18 +327,17 @@ { elisa.initialize() - elisa.mediaPlayList.randomPlay = Qt.binding(function() { return headerBar.playerControl.shuffle }) - elisa.mediaPlayList.repeatPlay = Qt.binding(function() { return headerBar.playerControl.repeat }) - elisa.playerControl.randomOrContinuePlay = Qt.binding(function() { return headerBar.playerControl.shuffle || headerBar.playerControl.repeat}) - if (persistentSettings.playListState) { elisa.mediaPlayList.persistentState = persistentSettings.playListState } if (persistentSettings.audioPlayerState) { elisa.audioControl.persistentState = persistentSettings.audioPlayerState } + elisa.mediaPlayList.randomPlay = Qt.binding(function() { return headerBar.playerControl.shuffle }) + elisa.mediaPlayList.repeatPlay = Qt.binding(function() { return headerBar.playerControl.repeat }) + elisa.playerControl.randomOrContinuePlay = Qt.binding(function() { return headerBar.playerControl.shuffle || headerBar.playerControl.repeat}) elisa.audioPlayer.muted = Qt.binding(function() { return headerBar.playerControl.muted }) elisa.audioPlayer.volume = Qt.binding(function() { return headerBar.playerControl.volume })