GetBaseUTF8

This commit is contained in:
Max Kellermann
2013-10-21 10:26:53 +02:00
parent a0415f73d4
commit 83c726a34f
10 changed files with 98 additions and 47 deletions

View File

@@ -33,11 +33,10 @@
#include "Client.hxx"
#include "InputStream.hxx"
#include "Song.hxx"
#include "fs/Traits.hxx"
#include "util/Error.hxx"
#include "thread/Cond.hxx"
#include <glib.h>
void
playlist_print_uris(Client &client, const playlist &playlist)
{
@@ -150,11 +149,14 @@ static void
playlist_provider_print(Client &client, const char *uri,
SongEnumerator &e, bool detail)
{
Song *song;
char *base_uri = uri != nullptr ? g_path_get_dirname(uri) : nullptr;
const std::string base_uri = uri != nullptr
? PathTraits::GetParentUTF8(uri)
: std::string(".");
Song *song;
while ((song = e.NextSong()) != nullptr) {
song = playlist_check_translate_song(song, base_uri, false);
song = playlist_check_translate_song(song, base_uri.c_str(),
false);
if (song == nullptr)
continue;
@@ -165,8 +167,6 @@ playlist_provider_print(Client &client, const char *uri,
song->Free();
}
g_free(base_uri);
}
bool