[totem] main: Make local files removable even if the source has no support



commit 5b31835c129f02f115d965398813dc9e81f0b6a5
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Feb 14 19:05:04 2014 +0100

    main: Make local files removable even if the source has no support

 src/totem-grilo.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/src/totem-grilo.c b/src/totem-grilo.c
index 5cb49b0..0c3cd1b 100644
--- a/src/totem-grilo.c
+++ b/src/totem-grilo.c
@@ -304,12 +304,10 @@ can_remove (GrlSource *source,
        char *scheme;
        int ret;
 
-       if (!(grl_source_supported_operations (source) & GRL_OP_REMOVE))
-               return CAN_REMOVE_UNSUPPORTED;
        if (g_strcmp0 (grl_source_get_id (source), "grl-bookmarks") == 0)
                return CAN_REMOVE_TRUE;
        if (!media)
-               return CAN_REMOVE_FALSE;
+               goto fallback;
        if (GRL_IS_MEDIA_BOX (media))
                return CAN_REMOVE_FALSE;
        url = grl_media_get_url (media);
@@ -320,7 +318,14 @@ can_remove (GrlSource *source,
        ret = g_str_equal (scheme, "file") ? CAN_REMOVE_TRUE : CAN_REMOVE_FALSE;
        g_free (scheme);
 
-       return ret;
+       if (ret == CAN_REMOVE_TRUE)
+               return CAN_REMOVE_TRUE;
+
+fallback:
+       if (!(grl_source_supported_operations (source) & GRL_OP_REMOVE))
+               return CAN_REMOVE_UNSUPPORTED;
+
+       return CAN_REMOVE_FALSE;
 }
 
 static void


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