summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Eisenmann <p3732@getgoogleoff.me>2021-11-17 00:21:05 +0100
committerAntónio Fernandes <antoniof@gnome.org>2022-01-02 19:22:17 +0000
commitdbbcd8b7c54b635731d9f3315e408c7e5cc64ceb (patch)
treeaad0be4a59b469ff6a0eb6bcf7bb4abf421e2a4c
parent3761ca6f79c78820901d0c9b9cf60fc6dbd3ee4b (diff)
downloadnautilus-dbbcd8b7c54b635731d9f3315e408c7e5cc64ceb.tar.gz
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.
-rw-r--r--src/nautilus-properties-window.c9
1 files 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);
}