Move the emission of the signal StopAfterToggled to MainWindow::StopAfterCurrent.

This commit is contained in:
Mattias Andersson 2014-01-07 11:46:39 +01:00
parent b0e6062a4a
commit 42b0ec73df
4 changed files with 7 additions and 10 deletions

View File

@ -1524,11 +1524,6 @@ void Playlist::StopAfter(int row) {
else
stop_after_ = index(row, 0);
// stop_after_.isValid() == true when there is a stop placed
// somewhere on the playlist. Emit a StopAfterToggled signal that
// reflects this.
emit StopAfterToggled(stop_after_.isValid());
if (old_stop_after.isValid())
emit dataChanged(old_stop_after, old_stop_after.sibling(old_stop_after.row(), ColumnCount-1));
if (stop_after_.isValid())

View File

@ -306,9 +306,6 @@ class Playlist : public QAbstractListModel {
void EditingFinished(const QModelIndex& index);
void PlayRequested(const QModelIndex& index);
// Signals that stop playing after track was toggled.
void StopAfterToggled(bool stop);
// Signals that the underlying list of items was changed, meaning that
// something was added to it, removed from it or the ordering changed.
void PlaylistChanged();

View File

@ -690,8 +690,8 @@ MainWindow::MainWindow(Application* app,
app_->playlist_manager()->Init(app_->library_backend(), app_->playlist_backend(),
ui_->playlist_sequence, ui_->playlist);
// This connection must be done after the playlist has been initialized.
connect(app_->playlist_manager()->current(), SIGNAL(StopAfterToggled(bool)),
// This connection must be done after the playlists have been initialized.
connect(this, SIGNAL(StopAfterToggled(bool)),
osd_, SLOT(StopAfterToggle(bool)));
// We need to connect these global shortcuts here after the playlist have been initialized
@ -1063,6 +1063,7 @@ void MainWindow::ToggleShowHide() {
void MainWindow::StopAfterCurrent() {
app_->playlist_manager()->current()->StopAfter(app_->playlist_manager()->current()->current_row());
emit StopAfterToggled(app_->playlist_manager()->current()->stop_after_current());
}
void MainWindow::closeEvent(QCloseEvent* event) {

View File

@ -134,6 +134,10 @@ class MainWindow : public QMainWindow, public PlatformInterface {
void Activate();
bool LoadUrl(const QString& url);
signals:
// Signals that stop playing after track was toggled.
void StopAfterToggled(bool stop);
private slots:
void FilePathChanged(const QString& path);