aboutsummaryrefslogtreecommitdiff
path: root/src/InotifyUpdate.cxx
diff options
context:
space:
mode:
authorDenis Krjuchkov <denis@crazydev.net>2013-01-24 00:38:09 +0600
committerMax Kellermann <max@duempel.org>2013-01-26 01:14:13 +0100
commita3ee26da6437dff2d065cc3fc2ad069447309ab6 (patch)
tree8efa8f78910da1528d333561eb3f48881c34c4c3 /src/InotifyUpdate.cxx
parenta9b62a2ece7f8b05bbb785edb47be8f37a19284e (diff)
Mapper: improve usage of Path class
Diffstat (limited to 'src/InotifyUpdate.cxx')
-rw-r--r--src/InotifyUpdate.cxx13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/InotifyUpdate.cxx b/src/InotifyUpdate.cxx
index bd018f5a..ca6db680 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);