mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-09-07 00:18:44 +02:00
glocalfile: Set various file attributes if their value is FALSE
Following on from #2907, set various boolean attributes if they have been requested, or are known for sure, and their value is `FALSE`. Previously the `FALSE` value would have been implicitly returned by the getter function, but now doing that without the attribute being explicitly set will trigger a critical warning. *Don’t* set these attributes if their value is unknown or there was an error querying it. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Fixes: #2934
This commit is contained in:
@@ -845,10 +845,10 @@ get_mount_info (GFileInfo *fs_info,
|
||||
G_UNLOCK (mount_info_hash);
|
||||
}
|
||||
|
||||
if (mount_info & MOUNT_INFO_READONLY &&
|
||||
g_file_attribute_matcher_matches (matcher,
|
||||
if (g_file_attribute_matcher_matches (matcher,
|
||||
G_FILE_ATTRIBUTE_FILESYSTEM_READONLY))
|
||||
g_file_info_set_attribute_boolean (fs_info, G_FILE_ATTRIBUTE_FILESYSTEM_READONLY, TRUE);
|
||||
g_file_info_set_attribute_boolean (fs_info, G_FILE_ATTRIBUTE_FILESYSTEM_READONLY,
|
||||
(mount_info & MOUNT_INFO_READONLY));
|
||||
|
||||
if (g_file_attribute_matcher_matches (matcher,
|
||||
G_FILE_ATTRIBUTE_FILESYSTEM_REMOTE))
|
||||
|
Reference in New Issue
Block a user