aboutsummaryrefslogtreecommitdiffstats
path: root/src/PlaylistSave.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/PlaylistSave.cxx')
-rw-r--r--src/PlaylistSave.cxx17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/PlaylistSave.cxx b/src/PlaylistSave.cxx
index 29bf193fd..5f5b3e20d 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,22 +22,21 @@
#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()) {
const auto path = map_song_fs(song);
@@ -45,7 +44,7 @@ playlist_print_song(FILE *file, const Song &song)
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 +55,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 +126,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 +138,7 @@ playlist_load_spl(struct playlist &playlist, PlayerControl &pc,
FormatError(playlist_domain,
"can't add file \"%s\"", temp2);
- g_free(temp2);
+ free(temp2);
}
}