[totem/wip/hadess/fix-rotation-reset] rotation: Handle empty rotation metadata as absent




commit 6eb35fbf2bf551110825248023c2cea430085224
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Jan 27 11:19:08 2022 +0100

    rotation: Handle empty rotation metadata as absent
    
    Consider that empty rotation metadata is the same as absent rotation
    metadata. Useful as the "gio" utility doesn't have a way to unset
    metadata.

 src/plugins/rotation/totem-rotation.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/plugins/rotation/totem-rotation.c b/src/plugins/rotation/totem-rotation.c
index 199986a34..3402de98c 100644
--- a/src/plugins/rotation/totem-rotation.c
+++ b/src/plugins/rotation/totem-rotation.c
@@ -122,7 +122,7 @@ restore_state_cb (GObject      *source_object,
        pi = user_data;
 
        rotation_s = g_file_info_get_attribute_string (info, GIO_ROTATION_FILE_ATTRIBUTE);
-       if (!rotation_s)
+       if (!rotation_s || *rotation_s == '\0')
                goto out;
 
        rotation = atoi (rotation_s);


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