[nautilus/wip/antoniof/new_open_with: 11/31] properties-window: add PERMISSION_NONE for readability
- From: António Fernandes <antoniof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/antoniof/new_open_with: 11/31] properties-window: add PERMISSION_NONE for readability
- Date: Thu, 28 Jul 2022 18:21:25 +0000 (UTC)
commit 226adfeae289669fa5eb2554201030483469481c
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 57e3b2abe..6c08e225a 100644
--- a/src/nautilus-properties-window.c
+++ b/src/nautilus-properties-window.c
@@ -2766,6 +2766,7 @@ enum
typedef enum
{
+ PERMISSION_NONE = (0),
PERMISSION_READ = (1 << 0),
PERMISSION_WRITE = (1 << 1),
PERMISSION_EXEC = (1 << 2)
@@ -2814,10 +2815,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;
@@ -3142,7 +3143,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);
}
@@ -3172,7 +3173,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]