[grilo-plugins] [apple-trailers] Notify remaining==0 when user cancels operation



commit c758dc8fb610a03f7cde8802d75c6cc255c2a298
Author: Juan A. Suarez Romero <jasuarez igalia com>
Date:   Wed Jun 2 18:08:04 2010 +0200

    [apple-trailers] Notify remaining==0 when user cancels operation
    
    When user cancels browse() operation, invoke the callback for last time, with
    remaining as 0, so UI knows that cancel was in fact done.

 src/apple-trailers/grl-apple-trailers.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/src/apple-trailers/grl-apple-trailers.c b/src/apple-trailers/grl-apple-trailers.c
index f771801..2e1d0df 100644
--- a/src/apple-trailers/grl-apple-trailers.c
+++ b/src/apple-trailers/grl-apple-trailers.c
@@ -257,6 +257,12 @@ send_movie_info (OperationData *op_data)
   gboolean last = FALSE;
 
   if (op_data->cancelled) {
+    op_data->bs->callback (op_data->bs->source,
+                           op_data->bs->browse_id,
+                           NULL,
+                           0,
+                           op_data->bs->user_data,
+                           NULL);
     last = TRUE;
   } else {
     media = build_media_from_movie (op_data->xml_entries);
@@ -289,12 +295,7 @@ xml_parse_result (const gchar *str, OperationData *op_data)
   GError *error = NULL;
   xmlNodePtr node;
 
-  if (op_data->cancelled) {
-    g_slice_free (OperationData, op_data);
-    return;
-  }
-
-  if (op_data->bs->count == 0) {
+  if (op_data->cancelled || op_data->bs->count == 0) {
     goto finalize;
   }
 



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