From 79b7a3717c563664a6c08017269b7382a1d7a854 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Sun, 14 Sep 2014 12:04:16 +0200 Subject: [PATCH] GUI: use .clear() for clearing lists .empty() is just a compatibility function for stdlib and doesn't clear the list. It's the equivalent of .isEmpty(). This fixes clearing the lists when loading/resetting configs. --- src/mkvtoolnix-gui/merge_widget/mux_config.cpp | 8 ++++---- .../merge_widget/select_playlist_dialog.cpp | 2 +- src/mkvtoolnix-gui/merge_widget/source_file.cpp | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/mkvtoolnix-gui/merge_widget/mux_config.cpp b/src/mkvtoolnix-gui/merge_widget/mux_config.cpp index 59e9039c3..3e30889d9 100644 --- a/src/mkvtoolnix-gui/merge_widget/mux_config.cpp +++ b/src/mkvtoolnix-gui/merge_widget/mux_config.cpp @@ -49,7 +49,7 @@ fixMappings(SourceFile *oldFile, assert((!!newTrack->m_file == !!oldTrack->m_file) && (!!newTrack->m_appendedTo == !!newTrack->m_appendedTo)); - newTrack->m_appendedTracks.empty(); + newTrack->m_appendedTracks.clear(); for (auto const &oldAppendedTrack : oldTrack->m_appendedTracks) { auto newAppendedTrack = trackMap[oldAppendedTrack]; assert(!!newAppendedTrack); @@ -103,9 +103,9 @@ MuxConfig::operator =(MuxConfig const &other) { m_linkFiles = other.m_linkFiles; m_webmMode = other.m_webmMode; - m_files.empty(); - m_tracks.empty(); - m_attachments.empty(); + m_files.clear(); + m_tracks.clear(); + m_attachments.clear(); for (auto const &attachment : other.m_attachments) m_attachments << std::make_shared(*attachment); diff --git a/src/mkvtoolnix-gui/merge_widget/select_playlist_dialog.cpp b/src/mkvtoolnix-gui/merge_widget/select_playlist_dialog.cpp index 53b25445d..0f70e724b 100644 --- a/src/mkvtoolnix-gui/merge_widget/select_playlist_dialog.cpp +++ b/src/mkvtoolnix-gui/merge_widget/select_playlist_dialog.cpp @@ -161,7 +161,7 @@ SelectPlaylistDialog::onScannedFileSelected(QTreeWidgetItem *current, ui->tracks->insertTopLevelItems(0, newItems); - newItems.empty(); + newItems.clear(); for (auto const &playlistFile : file.m_playlistFiles) newItems << createPlaylistItemItem(playlistFile); diff --git a/src/mkvtoolnix-gui/merge_widget/source_file.cpp b/src/mkvtoolnix-gui/merge_widget/source_file.cpp index 120cba29c..7935f0808 100644 --- a/src/mkvtoolnix-gui/merge_widget/source_file.cpp +++ b/src/mkvtoolnix-gui/merge_widget/source_file.cpp @@ -72,10 +72,10 @@ SourceFile::operator =(SourceFile const &other) { m_playlistFiles = other.m_playlistFiles; m_appendedTo = nullptr; - m_tracks.empty(); - m_additionalParts.empty(); - m_appendedFiles.empty(); - m_playlistFiles.empty(); + m_tracks.clear(); + m_additionalParts.clear(); + m_appendedFiles.clear(); + m_playlistFiles.clear(); for (auto const &track : other.m_tracks) m_tracks << std::make_shared(*track);