From a3ee26da6437dff2d065cc3fc2ad069447309ab6 Mon Sep 17 00:00:00 2001 From: Denis Krjuchkov Date: Thu, 24 Jan 2013 00:38:09 +0600 Subject: Mapper: improve usage of Path class --- src/InotifyUpdate.cxx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/InotifyUpdate.cxx') diff --git a/src/InotifyUpdate.cxx b/src/InotifyUpdate.cxx index bd018f5a3..ca6db6807 100644 --- a/src/InotifyUpdate.cxx +++ b/src/InotifyUpdate.cxx @@ -267,7 +267,7 @@ mpd_inotify_callback(int wd, unsigned mask, (mask & IN_ISDIR) != 0) { /* a sub directory was changed: register those in inotify */ - const char *root = mapper_get_music_directory_fs(); + const char *root = mapper_get_music_directory_fs().c_str(); const char *path_fs; char *allocated = NULL; @@ -309,8 +309,8 @@ mpd_inotify_init(unsigned max_depth) g_debug("initializing inotify"); - const char *path = mapper_get_music_directory_fs(); - if (path == NULL) { + const Path &path = mapper_get_music_directory_fs(); + if (path.IsNull()) { g_debug("no music directory configured"); return; } @@ -326,8 +326,9 @@ mpd_inotify_init(unsigned max_depth) inotify_max_depth = max_depth; - inotify_root.name = g_strdup(path); - inotify_root.descriptor = inotify_source->Add(path, IN_MASK, &error); + inotify_root.name = g_strdup(path.c_str()); + inotify_root.descriptor = inotify_source->Add(path.c_str(), + IN_MASK, &error); if (inotify_root.descriptor < 0) { g_warning("%s", error->message); g_error_free(error); @@ -339,7 +340,7 @@ mpd_inotify_init(unsigned max_depth) inotify_directories = g_tree_new(compare); tree_add_watch_directory(&inotify_root); - recursive_watch_subdirectories(&inotify_root, path, 0); + recursive_watch_subdirectories(&inotify_root, path.c_str(), 0); inotify_queue = new InotifyQueue(*main_loop); -- cgit v1.2.3