diff options
author | Denis Krjuchkov <denis@crazydev.net> | 2013-01-24 02:26:38 +0600 |
---|---|---|
committer | Denis Krjuchkov <denis@crazydev.net> | 2013-01-28 00:13:45 +0600 |
commit | 3c7cf94643bc45237d1e61c4e6015d498e4400b0 (patch) | |
tree | be93d9088f7b8199b0d07cce56017e6726a47f76 /src/PlaylistSong.cxx | |
parent | 3bd35d188320f20a98a1004c001b132fc0975437 (diff) | |
download | mpd-3c7cf94643bc45237d1e61c4e6015d498e4400b0.tar.gz mpd-3c7cf94643bc45237d1e61c4e6015d498e4400b0.tar.xz mpd-3c7cf94643bc45237d1e61c4e6015d498e4400b0.zip |
Path: convert fs_charset_to_utf8() to static method Path::ToUTF8()
Diffstat (limited to '')
-rw-r--r-- | src/PlaylistSong.cxx | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/PlaylistSong.cxx b/src/PlaylistSong.cxx index 6c59600f6..4df4d22d4 100644 --- a/src/PlaylistSong.cxx +++ b/src/PlaylistSong.cxx @@ -65,18 +65,15 @@ apply_song_metadata(struct song *dest, const struct song *src) return dest; if (song_in_database(dest)) { - char *path_fs = map_song_fs(dest).Steal(); - if (path_fs == nullptr) + const Path &path_fs = map_song_fs(dest); + if (path_fs.IsNull()) return dest; - char *path_utf8 = fs_charset_to_utf8(path_fs); - if (path_utf8 != NULL) - g_free(path_fs); - else - path_utf8 = path_fs; + std::string path_utf8 = path_fs.ToUTF8(); + if (path_utf8.empty()) + path_utf8 = path_fs.c_str(); - tmp = song_file_new(path_utf8, NULL); - g_free(path_utf8); + tmp = song_file_new(path_utf8.c_str(), NULL); merge_song_metadata(tmp, dest, src); } else { |