aboutsummaryrefslogtreecommitdiff
path: root/src/InotifyUpdate.cxx
diff options
context:
space:
mode:
authorDenis Krjuchkov <denis@crazydev.net>2013-01-24 02:26:38 +0600
committerDenis Krjuchkov <denis@crazydev.net>2013-01-28 00:13:45 +0600
commit3c7cf94643bc45237d1e61c4e6015d498e4400b0 (patch)
treebe93d9088f7b8199b0d07cce56017e6726a47f76 /src/InotifyUpdate.cxx
parent3bd35d188320f20a98a1004c001b132fc0975437 (diff)
Path: convert fs_charset_to_utf8() to static method Path::ToUTF8()
Diffstat (limited to 'src/InotifyUpdate.cxx')
-rw-r--r--src/InotifyUpdate.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/InotifyUpdate.cxx b/src/InotifyUpdate.cxx
index ca6db680..94bff9d4 100644
--- a/src/InotifyUpdate.cxx
+++ b/src/InotifyUpdate.cxx
@@ -289,14 +289,14 @@ mpd_inotify_callback(int wd, unsigned mask,
(mask & (IN_CREATE|IN_ISDIR)) == (IN_CREATE|IN_ISDIR))) {
/* a file was changed, or a directory was
moved/deleted: queue a database update */
- char *uri_utf8 = uri_fs != NULL
- ? fs_charset_to_utf8(uri_fs)
- : g_strdup("");
- if (uri_utf8 != NULL) {
- inotify_queue->Enqueue(uri_utf8);
- g_free(uri_utf8);
+ if (uri_fs != nullptr) {
+ const std::string uri_utf8 = Path::ToUTF8(uri_fs);
+ if (!uri_utf8.empty())
+ inotify_queue->Enqueue(uri_utf8.c_str());
}
+ else
+ inotify_queue->Enqueue("");
}
g_free(uri_fs);