diff options
Diffstat (limited to '')
-rw-r--r-- | src/UpdateGlue.cxx (renamed from src/update.c) | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/src/update.c b/src/UpdateGlue.cxx index 12eec40c4..22a33ade9 100644 --- a/src/update.c +++ b/src/UpdateGlue.cxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2011 The Music Player Daemon Project + * Copyright (C) 2003-2013 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify @@ -18,19 +18,21 @@ */ #include "config.h" -#include "update.h" -#include "update_queue.h" -#include "update_walk.h" -#include "update_remove.h" -#include "update.h" -#include "database.h" -#include "mapper.h" -#include "playlist.h" -#include "event_pipe.h" -#include "update.h" -#include "idle.h" +#include "UpdateGlue.hxx" +#include "UpdateQueue.hxx" +#include "UpdateWalk.hxx" +#include "UpdateRemove.hxx" +#include "Mapper.hxx" +#include "DatabaseSimple.hxx" +#include "Idle.hxx" +#include "GlobalEvents.hxx" + +extern "C" { #include "stats.h" -#include "main.h" +} + +#include "Main.hxx" +#include "Partition.hxx" #include "mpd_error.h" #include <glib.h> @@ -65,7 +67,7 @@ isUpdatingDB(void) static void * update_task(void *_path) { - const char *path = _path; + const char *path = (const char *)_path; if (path != NULL && *path != 0) g_debug("starting: %s", path); @@ -90,7 +92,7 @@ static void * update_task(void *_path) g_free(_path); progress = UPDATE_PROGRESS_DONE; - event_pipe_emit(PIPE_EVENT_UPDATE); + GlobalEvents::Emit(GlobalEvents::UPDATE); return NULL; } @@ -118,7 +120,7 @@ update_enqueue(const char *path, bool _discard) { assert(g_thread_self() == main_task); - if (!mapper_has_music_directory()) + if (!db_is_simple() || !mapper_has_music_directory()) return 0; if (progress != UPDATE_PROGRESS_IDLE) { @@ -153,7 +155,7 @@ static void update_finished_event(void) if (modified) { /* send "idle" events */ - playlist_increment_version_all(&g_playlist); + global_partition->playlist.FullIncrementVersions(); idle_add(IDLE_DATABASE); } @@ -171,7 +173,7 @@ static void update_finished_event(void) void update_global_init(void) { - event_pipe_register(PIPE_EVENT_UPDATE, update_finished_event); + GlobalEvents::Register(GlobalEvents::UPDATE, update_finished_event); update_remove_global_init(); update_walk_global_init(); |