summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2020-08-27 18:01:12 +0100
committerAlexander Larsson <alexander.larsson@gmail.com>2020-08-28 11:00:49 +0200
commit5a83c73ed859fe3e4bd93a228a4bc8981d649c5e (patch)
treeab2eaa426d9046cf1844d91b9ae593f338ecd90f
parente55dcf5e2bc066b5c2521ad82ca65efa126040a2 (diff)
downloadflatpak-5a83c73ed859fe3e4bd93a228a4bc8981d649c5e.tar.gz
context: Implement MODE_NONE in unparse_filesystem_flags
flatpak doesn't yet use -Wswitch-enum, but perhaps it should at some point. Now that FLATPAK_FILESYSTEM_MODE_NONE is a member of the enum, it should be handled; and if we're doing that, we might as well make the same function fully responsible for it. Signed-off-by: Simon McVittie <smcv@collabora.com>
-rw-r--r--common/flatpak-context.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/common/flatpak-context.c b/common/flatpak-context.c
index cafdd3d1..c40ec61f 100644
--- a/common/flatpak-context.c
+++ b/common/flatpak-context.c
@@ -701,6 +701,10 @@ unparse_filesystem_flags (const char *path,
case FLATPAK_FILESYSTEM_MODE_READ_WRITE:
break;
+ case FLATPAK_FILESYSTEM_MODE_NONE:
+ g_string_insert_c (s, 0, '!');
+ break;
+
default:
g_warning ("Unexpected filesystem mode %d", mode);
break;
@@ -1721,10 +1725,7 @@ flatpak_context_save_metadata (FlatpakContext *context,
{
FlatpakFilesystemMode mode = GPOINTER_TO_INT (value);
- if (mode != FLATPAK_FILESYSTEM_MODE_NONE)
- g_ptr_array_add (array, unparse_filesystem_flags (key, mode));
- else
- g_ptr_array_add (array, g_strconcat ("!", key, NULL));
+ g_ptr_array_add (array, unparse_filesystem_flags (key, mode));
}
g_key_file_set_string_list (metakey,