diff options
Diffstat (limited to '')
-rw-r--r-- | src/PlaylistSave.cxx | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/PlaylistSave.cxx b/src/PlaylistSave.cxx index 29bf193fd..8eeab0f62 100644 --- a/src/PlaylistSave.cxx +++ b/src/PlaylistSave.cxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2013 The Music Player Daemon Project + * Copyright (C) 2003-2014 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify @@ -22,30 +22,30 @@ #include "PlaylistFile.hxx" #include "PlaylistError.hxx" #include "Playlist.hxx" -#include "Song.hxx" +#include "DetachedSong.hxx" #include "Mapper.hxx" #include "Idle.hxx" #include "fs/AllocatedPath.hxx" #include "fs/Traits.hxx" #include "fs/FileSystem.hxx" +#include "util/Alloc.hxx" #include "util/UriUtil.hxx" #include "util/Error.hxx" #include "Log.hxx" -#include <glib.h> - #include <string.h> void -playlist_print_song(FILE *file, const Song &song) +playlist_print_song(FILE *file, const DetachedSong &song) { - if (playlist_saveAbsolutePaths && song.IsInDatabase()) { + if (playlist_saveAbsolutePaths && + song.IsInDatabase() && song.IsFile()) { const auto path = map_song_fs(song); if (!path.IsNull()) fprintf(file, "%s\n", path.c_str()); } else { const auto uri_utf8 = song.GetURI(); - const auto uri_fs = AllocatedPath::FromUTF8(uri_utf8.c_str()); + const auto uri_fs = AllocatedPath::FromUTF8(uri_utf8); if (!uri_fs.IsNull()) fprintf(file, "%s\n", uri_fs.c_str()); @@ -56,7 +56,7 @@ void playlist_print_uri(FILE *file, const char *uri) { auto path = playlist_saveAbsolutePaths && !uri_has_scheme(uri) && - !PathTraits::IsAbsoluteUTF8(uri) + !PathTraitsUTF8::IsAbsolute(uri) ? map_uri_fs(uri) : AllocatedPath::FromUTF8(uri); @@ -127,7 +127,7 @@ playlist_load_spl(struct playlist &playlist, PlayerControl &pc, if ((playlist.AppendURI(pc, uri_utf8.c_str())) != PlaylistResult::SUCCESS) { /* for windows compatibility, convert slashes */ - char *temp2 = g_strdup(uri_utf8.c_str()); + char *temp2 = xstrdup(uri_utf8.c_str()); char *p = temp2; while (*p) { if (*p == '\\') @@ -139,7 +139,7 @@ playlist_load_spl(struct playlist &playlist, PlayerControl &pc, FormatError(playlist_domain, "can't add file \"%s\"", temp2); - g_free(temp2); + free(temp2); } } |