[grilo-plugins/fremantle: 16/27] Migrated shoutcast plugin to use utils instead of GIO



commit c00476756368df00f98cb13ea11fcb8d5f819ff6
Author: Xabier Rodriguez Calvar <xrcalvar igalia com>
Date:   Mon Apr 19 16:49:42 2010 +0200

    Migrated shoutcast plugin to use utils instead of GIO

 src/shoutcast/grl-shoutcast.c |   26 ++++++--------------------
 1 files changed, 6 insertions(+), 20 deletions(-)
---
diff --git a/src/shoutcast/grl-shoutcast.c b/src/shoutcast/grl-shoutcast.c
index ea1ddc5..163cbc8 100644
--- a/src/shoutcast/grl-shoutcast.c
+++ b/src/shoutcast/grl-shoutcast.c
@@ -34,6 +34,7 @@
 #include <string.h>
 #include <stdlib.h>
 
+#include "util/gnomevfs.h"
 #include "grl-shoutcast.h"
 
 /* --------- Logging  -------- */
@@ -442,25 +443,16 @@ xml_parse_result (const gchar *str, OperationData *op_data)
 }
 
 static void
-read_done_cb (GObject *source_object,
-              GAsyncResult *res,
+read_done_cb (gchar *content,
               gpointer user_data)
 {
   GError *error = NULL;
-  GError *vfs_error = NULL;
   OperationData *op_data = (OperationData *) user_data;
-  gchar *content = NULL;
-
-  if (!g_file_load_contents_finish (G_FILE (source_object),
-                                    res,
-                                    &content,
-                                    NULL,
-                                    NULL,
-                                    &vfs_error)) {
+
+  if (!content) {
     error = g_error_new (GRL_ERROR,
                          op_data->error_code,
-                         "Failed to connect SHOUTcast: '%s'",
-                         vfs_error->message);
+                         "Failed to connect SHOUTcast");
     op_data->result_cb (op_data->source,
                         op_data->operation_id,
                         NULL,
@@ -480,14 +472,8 @@ read_done_cb (GObject *source_object,
 static void
 read_url_async (const gchar *url, gpointer user_data)
 {
-  GVfs *vfs;
-  GFile *uri;
-
-  vfs = g_vfs_get_default ();
-
   g_debug ("Opening '%s'", url);
-  uri = g_vfs_get_file_for_uri (vfs, url);
-  g_file_load_contents_async (uri, NULL, read_done_cb, user_data);
+  grl_plugins_gnome_vfs_read_url_async (url, read_done_cb, user_data);
 }
 
 /* ================== API Implementation ================ */



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