libsaria: Report the library size as the play_list size

This is simpler than looping over all library paths and adding up their
individual sizes.
This commit is contained in:
Bryan Schumaker 2011-11-06 12:39:13 -05:00
parent 637ea47a60
commit cdcaaeb8c8
2 changed files with 7 additions and 9 deletions

View File

@ -70,15 +70,6 @@ namespace libsaria
return found;
}
unsigned int library::size()
{
unsigned int size = 0;
list<LibraryPath>::iterator it;
for (it = path_list.begin(); it != path_list.end(); it++)
size += it->size();
return size;
}
void library::refresh()
{
rebuild_list();

View File

@ -15,6 +15,8 @@ namespace libsaria
list<LibraryPath>::iterator it;
list<TrackTag> *tag_list;
play_list.clear();
for (it = path_list->begin(); it != path_list->end(); it++) {
tag_list = it->get_list();
play_list.insert(play_list.end(), tag_list->begin(), tag_list->end());
@ -22,4 +24,9 @@ namespace libsaria
println("Rebuilding play list");
}
unsigned int library::size()
{
return play_list.size();
}
}; /* Namespace: libsaria */