Skip to content

Use generic helpers for obtaining file attributes

Ondrej Holy requested to merge wip/oholy/criticals-attributes into master

It is not guaranteed that all GFileInfo attributes are always set when requested. They used to be silently set to NULL, FALSE, or 0 earlier when they were not provided by their implementations. However, some of the helper functions now print critical errors when the attributes are not set by their implementations even though they were requested. See the glib!3261 (merged) merge request for more details. So Nautilus now prints tons of critical errors when started. The unset attributes can be detected over the g_file_info_has_attribute function. But Nautilus doesn't care in most cases about the reason why the attribute is NULL, FALSE, or 0. There are also more generic helper functions that don't print these critical errors. Let's use them for the attributes that may not always be set to get rid of those critical errors. I suppose that the name, display_name, size, icon, and file_type attributes don't need this special handling, although it is not clearly stated anywhere...

Fixes: #2861 (closed)

Edited by Ondrej Holy

Merge request reports