[totem] main: Fix error handling when deleting items



commit aeafb7619e62214ba51ab7548cec145d871d0804
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Mar 14 14:13:16 2014 +0100

    main: Fix error handling when deleting items
    
    First, the check for success when removing using grilo was reversed,
    then the success variable could be used unassigned when no URI
    was set for a particular GrlMedia.

 src/totem-grilo.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/totem-grilo.c b/src/totem-grilo.c
index e02b8a4..d0afbab 100644
--- a/src/totem-grilo.c
+++ b/src/totem-grilo.c
@@ -2054,12 +2054,13 @@ delete_foreach (gpointer data,
                g_debug ("Removing item '%s' through Grilo",
                         grl_media_get_id (media));
                grl_source_remove_sync (source, media, &error);
-               success = (error != NULL);
+               success = (error == NULL);
        } else {
                const char *uri;
 
                uri = grl_media_get_url (media);
                if (!uri) {
+                       success = FALSE;
                        g_set_error_literal (&error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
                                             "Item cannot be removed through Grilo and doesn't have a URI, 
please file a bug");
                } else {


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