Re: [Rhythmbox-devel] DACP (iTunes remote) support added



On Sun, 2010-10-24 at 01:50 +0100, Peter wrote:
> 
> +       if (g_ascii_strncasecmp(uri, "file://", 7) == 0) {
> +               /* Need to remove file:// and unencode it, e.g. %20 to
> space */
> +               cover = g_strdup(g_filename_from_uri(uri, NULL,
> NULL));
> +       } 

This will leak the output of g_filename_from_uri(), and it's not the way
to get the URI.

Use:
file = g_file_new_for_uri (uri);
cover = g_file_get_path (file);
g_object_unref (file);

This will make sure that SMB URIs will get a local path, through the
gvfs fuse support.

Cheers



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]