From eff294a7c75ada16d9c71f694896e38bcbefce23 Mon Sep 17 00:00:00 2001 From: Anna Schumaker Date: Sun, 12 Jan 2014 13:04:16 -0500 Subject: [PATCH] library: Added an update_all() function To update all paths in a library. Signed-off-by: Anna Schumaker --- lib/library.cpp | 7 +++++++ tests/library/library.cpp | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/library.cpp b/lib/library.cpp index aa7a610d..4420abeb 100644 --- a/lib/library.cpp +++ b/lib/library.cpp @@ -464,6 +464,13 @@ void library :: update_path(unsigned int id) do_update_library(id); } +void library :: update_all() +{ + unsigned int i; + for (i = library_db.first(); i < library_db.num_rows(); i = library_db.next(i)) + update_path(i); +} + void library :: lookup(unsigned int id, library :: Song *song) { if (id >= track_db.num_rows()) diff --git a/tests/library/library.cpp b/tests/library/library.cpp index af4034b9..7af1216b 100644 --- a/tests/library/library.cpp +++ b/tests/library/library.cpp @@ -233,7 +233,7 @@ void test_6() fflush(stdout); gen_library(); fflush(stdout); - library :: update_path(0); + library :: update_all(); run_idle_tasks(); library :: print_db(library :: DB_TRACK); print("\n");