From 0be0498e94f72c57b8e03e458cdaba9e0848c67c Mon Sep 17 00:00:00 2001 From: Mattias Andersson Date: Sat, 24 May 2014 13:33:32 +0200 Subject: [PATCH] Reset the model during init of CddaDevice This ensures that the track list in the device tab is correctly updated when a disc is replaced with one that doesn't exist in the MusicBrainz database. --- src/devices/cddadevice.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/devices/cddadevice.cpp b/src/devices/cddadevice.cpp index c2cdb7382..dc7631e07 100644 --- a/src/devices/cddadevice.cpp +++ b/src/devices/cddadevice.cpp @@ -99,6 +99,10 @@ void CddaDevice::Init() { song_count_ = num_tracks; connect(this, SIGNAL(SongsDiscovered(const SongList&)), model_, SLOT(SongsDiscovered(const SongList&))); + // Reset the model before emitting the SongsDiscovered signal. This + // ensures that the model is updated properly even when a disc that + // doesn't exist in MusicBrainz is inserted. + model_->Reset(); emit SongsDiscovered(songs); // Generate MusicBrainz DiscId