libsaria: Send track updated notifications after sorting
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
This commit is contained in:
parent
671dd7eb3a
commit
0744aaad45
|
@ -63,26 +63,20 @@ namespace libsaria
|
|||
|
||||
void Playlist::push_front(Track *track)
|
||||
{
|
||||
unsigned int index = 0;
|
||||
plist.insert(plist.begin(), track);
|
||||
add_track(track, 0);
|
||||
|
||||
if (get_sorted()) {
|
||||
if (get_sorted())
|
||||
do_sort();
|
||||
index = find_index(track);
|
||||
}
|
||||
|
||||
add_track(track, index);
|
||||
}
|
||||
|
||||
void Playlist::push_back(Track *track)
|
||||
{
|
||||
unsigned int index = plist.size() + 1;
|
||||
plist.push_back(track);
|
||||
if (get_sorted()) {
|
||||
add_track(track, plist.size());
|
||||
|
||||
if (get_sorted())
|
||||
do_sort();
|
||||
index = find_index(track);
|
||||
}
|
||||
add_track(track, index);
|
||||
}
|
||||
|
||||
void Playlist::push_back(list<Track *> &tracks)
|
||||
|
@ -93,15 +87,14 @@ namespace libsaria
|
|||
add_track(*it, plist.size());
|
||||
}
|
||||
|
||||
if (get_sorted()) {
|
||||
if (get_sorted())
|
||||
do_sort();
|
||||
notify_update_all();
|
||||
}
|
||||
}
|
||||
|
||||
void Playlist::do_sort()
|
||||
{
|
||||
sort(plist.begin(), plist.end(), compare_tracks);
|
||||
notify_update_all();
|
||||
}
|
||||
|
||||
}; /* namespace: libsaria */
|
||||
|
|
Loading…
Reference in New Issue