aboutsummaryrefslogtreecommitdiffstats
path: root/src/UpdateDatabase.cxx
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/UpdateDatabase.cxx (renamed from src/update_db.c)30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/update_db.c b/src/UpdateDatabase.cxx
index 8982a53e2..984fb1be8 100644
--- a/src/update_db.c
+++ b/src/UpdateDatabase.cxx
@@ -18,23 +18,23 @@
*/
#include "config.h" /* must be first for large file support */
-#include "update_db.h"
-#include "update_remove.h"
-#include "directory.h"
+#include "UpdateDatabase.hxx"
+#include "UpdateRemove.hxx"
+#include "PlaylistVector.hxx"
+#include "Directory.hxx"
#include "song.h"
-#include "playlist_vector.h"
-#include "db_lock.h"
+#include "DatabaseLock.hxx"
#include <glib.h>
#include <assert.h>
void
-delete_song(struct directory *dir, struct song *del)
+delete_song(Directory *dir, struct song *del)
{
assert(del->parent == dir);
/* first, prevent traversers in main task from getting this */
- directory_remove_song(dir, del);
+ dir->RemoveSong(del);
db_unlock(); /* temporary unlock, because update_remove_song() blocks */
@@ -54,9 +54,9 @@ delete_song(struct directory *dir, struct song *del)
* Caller must lock the #db_mutex.
*/
static void
-clear_directory(struct directory *directory)
+clear_directory(Directory *directory)
{
- struct directory *child, *n;
+ Directory *child, *n;
directory_for_each_child_safe(child, n, directory)
delete_directory(child);
@@ -68,35 +68,35 @@ clear_directory(struct directory *directory)
}
void
-delete_directory(struct directory *directory)
+delete_directory(Directory *directory)
{
assert(directory->parent != NULL);
clear_directory(directory);
- directory_delete(directory);
+ directory->Delete();
}
bool
-delete_name_in(struct directory *parent, const char *name)
+delete_name_in(Directory *parent, const char *name)
{
bool modified = false;
db_lock();
- struct directory *directory = directory_get_child(parent, name);
+ Directory *directory = parent->FindChild(name);
if (directory != NULL) {
delete_directory(directory);
modified = true;
}
- struct song *song = directory_get_song(parent, name);
+ struct song *song = parent->FindSong(name);
if (song != NULL) {
delete_song(parent, song);
modified = true;
}
- playlist_vector_remove(&parent->playlists, name);
+ parent->playlists.erase(name);
db_unlock();