aboutsummaryrefslogtreecommitdiff
path: root/src/PlaylistSong.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/PlaylistSong.cxx
parent3bd35d188320f20a98a1004c001b132fc0975437 (diff)
Path: convert fs_charset_to_utf8() to static method Path::ToUTF8()
Diffstat (limited to 'src/PlaylistSong.cxx')
-rw-r--r--src/PlaylistSong.cxx15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/PlaylistSong.cxx b/src/PlaylistSong.cxx
index 6c59600f..4df4d22d 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 {