Changeset 15
- Timestamp:
- 12/29/07 16:53:59 (4 years ago)
- Files:
-
- 4 edited
-
gui/playlisttablemodel.cpp (modified) (4 diffs)
-
gui/playlisttablemodel.h (modified) (2 diffs)
-
lib/song.cpp (modified) (1 diff)
-
lib/song.h (modified) (1 diff)
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++) { -
gui/playlisttablemodel.h
r9 r15 19 19 QVariant data(const QModelIndex &, int) const; 20 20 void updateCurrentSong(quint32 id); 21 q uint32 getIdByRow(quint32 row) const;21 qint32 getIdByRow(qint32 row) const; 22 22 23 23 public slots: … … 26 26 private: 27 27 QList<Song *> *songs; 28 q uint32 song_id;28 qint32 song_id; 29 29 30 qint32 songIdToRow(q uint32 id);30 qint32 songIdToRow(qint32 id); 31 31 }; 32 32 -
lib/song.cpp
r3 r15 3 3 Song::Song() 4 4 { 5 id = 0;5 id = -1; 6 6 time = 0; 7 7 track = 0; -
lib/song.h
r3 r15 8 8 { 9 9 public: 10 q uint32 id;10 qint32 id; 11 11 QString file; 12 12 quint32 time;
Note: See TracChangeset
for help on using the changeset viewer.
