diff options
author | Daniel Schürmann <daschuer@mixxx.org> | 2019-07-22 00:07:54 +0200 |
---|---|---|
committer | Daniel Schürmann <daschuer@mixxx.org> | 2019-07-22 00:07:54 +0200 |
commit | a0b263fe2ebc5d789de9c89d492a2e71af4f3144 (patch) | |
tree | 0d62738f34a119375b025ba7d252cf25c8be1e76 /src/library/setlogfeature.cpp | |
parent | 3498726228460e637202e1ea750597defae24197 (diff) |
fix some naming and code duplication issues
Diffstat (limited to 'src/library/setlogfeature.cpp')
-rw-r--r-- | src/library/setlogfeature.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/library/setlogfeature.cpp b/src/library/setlogfeature.cpp index d37fbcb34b..53f30046ea 100644 --- a/src/library/setlogfeature.cpp +++ b/src/library/setlogfeature.cpp @@ -145,7 +145,7 @@ void SetlogFeature::buildPlaylistList() { } } -void SetlogFeature::updatePlaylistList(int playlist_id) { +void SetlogFeature::reloadPlaylistInPlaylistList(int playlist_id) { // Setup the sidebar playlist model QSqlTableModel playlistTableModel(this, m_pTrackCollection->database()); playlistTableModel.setTable("Playlists"); @@ -158,9 +158,10 @@ void SetlogFeature::updatePlaylistList(int playlist_id) { QSqlRecord record = playlistTableModel.record(); int nameColumn = record.indexOf("name"); - for (int row = 0; row < playlistTableModel.rowCount(); ++row) { + DEBUG_ASSERT(playlistTableModel.rowCount() <= 1); + if (playlistTableModel.rowCount() > 0) { QString name = playlistTableModel.data( - playlistTableModel.index(row, nameColumn)).toString(); + playlistTableModel.index(0, nameColumn)).toString(); for (auto it = m_playlistList.begin(); it != m_playlistList.end(); ++it) { if (it->first == playlist_id) { @@ -168,7 +169,6 @@ void SetlogFeature::updatePlaylistList(int playlist_id) { break; } } - break; } } |