[nautilus/wip/antoniof/modernize-properties-dialog: 7/19] properties-window: add PERMISSION_NONE for readability




commit def0b3c322db0fd98ed3c3d13f0cfe8932b750ec
Author: Peter Eisenmann <p3732 getgoogleoff me>
Date:   Wed Nov 17 00:21:05 2021 +0100

    properties-window: add PERMISSION_NONE for readability
    
    Add PERMISSION_NONE to PermissionValue enum and use it instead of `0`
    for clearer naming of passed parameters.

 src/nautilus-properties-window.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/src/nautilus-properties-window.c b/src/nautilus-properties-window.c
index 60f6d49f4..dd2c2652e 100644
--- a/src/nautilus-properties-window.c
+++ b/src/nautilus-properties-window.c
@@ -2897,6 +2897,7 @@ enum
 
 typedef enum
 {
+    PERMISSION_NONE = (0),
     PERMISSION_READ = (1 << 0),
     PERMISSION_WRITE = (1 << 1),
     PERMISSION_EXEC = (1 << 2)
@@ -2945,10 +2946,10 @@ static PermissionValue
 permission_from_vfs (PermissionType type,
                      guint32        vfs_perm)
 {
-    PermissionValue perm;
+    PermissionValue perm = PERMISSION_NONE;
+
     g_assert (type >= 0 && type < 3);
 
-    perm = 0;
     if (vfs_perm & vfs_perms[type][0])
     {
         perm |= PERMISSION_READ;
@@ -3273,7 +3274,7 @@ setup_permissions_combo_box (GtkComboBox    *combo,
                                  * the user has in a directory.
                                  */
                                 COLUMN_NAME, _("None"),
-                                COLUMN_VALUE, 0,
+                                COLUMN_VALUE, PERMISSION_NONE,
                                 COLUMN_ID, "none",
                                 -1);
         }
@@ -3303,7 +3304,7 @@ setup_permissions_combo_box (GtkComboBox    *combo,
             gtk_list_store_append (store, &iter);
             gtk_list_store_set (store, &iter,
                                 COLUMN_NAME, _("None"),
-                                COLUMN_VALUE, 0,
+                                COLUMN_VALUE, PERMISSION_NONE,
                                 COLUMN_ID, "none",
                                 -1);
         }


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