Changeset 15 for gui/playlisttablemodel.cpp
- Timestamp:
- 12/29/07 16:53:59 (4 years ago)
- File:
-
- 1 edited
-
gui/playlisttablemodel.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
gui/playlisttablemodel.cpp
r9 r15 6 6 { 7 7 songs = new QList<Song *>; 8 song_id = 0;8 song_id = -1; 9 9 } 10 10 … … 77 77 void PlaylistTableModel::updateCurrentSong(quint32 id) 78 78 { 79 q uint32 oldIndex = 0;79 qint32 oldIndex = -1; 80 80 81 81 oldIndex = song_id; 82 82 song_id = id; 83 83 84 if(oldIndex != 0)84 if(oldIndex != -1) 85 85 emit dataChanged(index(songIdToRow(oldIndex), 0), index(songIdToRow(oldIndex), 2)); 86 86 … … 91 91 { 92 92 // Update song list and refresh model 93 while(this->songs->size()) 94 delete this->songs->takeLast(); 95 93 96 delete this->songs; 97 94 98 this->songs = songs; 95 99 reset(); 96 100 } 97 101 98 q uint32 PlaylistTableModel::getIdByRow(quint32 row) const102 qint32 PlaylistTableModel::getIdByRow(qint32 row) const 99 103 { 100 104 if(songs->size() <= row) { … … 105 109 } 106 110 107 qint32 PlaylistTableModel::songIdToRow(q uint32 id)111 qint32 PlaylistTableModel::songIdToRow(qint32 id) 108 112 { 109 113 for(qint32 i = 0; i < songs->size(); i++) {
Note: See TracChangeset
for help on using the changeset viewer.
