Commit 422d05cd authored by Paolo Bacchilega's avatar Paolo Bacchilega
Browse files

renamed the _g_file_attributes_matches_* functions

renamed to make it clear what the functions do.
parent fc24ccf1
......@@ -240,7 +240,7 @@ write_metadata_load_buffer_ready_cb (void *buffer,
return;
}
if (_g_file_attributes_matches (metadata_op->attributes, "sort::*"))
if (_g_file_attributes_matches_any (metadata_op->attributes, "sort::*"))
gth_catalog_set_order (metadata_op->catalog,
g_file_info_get_attribute_string (metadata_op->file_data->info, "sort::type"),
g_file_info_get_attribute_boolean (metadata_op->file_data->info, "sort::inverse"));
......@@ -367,7 +367,7 @@ read_metadata_info_ready_cb (GList *files,
update_file_info (read_metadata->file_source, read_metadata->file_data->file, read_metadata->file_data->info);
if (_g_file_attributes_matches (read_metadata->attributes, "sort::*")) {
if (_g_file_attributes_matches_any (read_metadata->attributes, "sort::*")) {
GFile *gio_file;
gio_file = gth_catalog_file_to_gio_file (read_metadata->file_data->file);
......
......@@ -582,7 +582,7 @@ g_directory_foreach_child (GFile *directory,
g_str_equal,
g_free,
NULL);
fec->metadata_attributes = ! _g_file_attributes_matches_mask (fec->attributes, GIO_ATTRIBUTES);
fec->metadata_attributes = ! _g_file_attributes_matches_any (fec->attributes, GIO_ATTRIBUTES);
g_file_query_info_async (fec->base_directory,
fec->attributes,
......
......@@ -2147,8 +2147,8 @@ attribute_matches_mask (const char *attribute,
gboolean
_g_file_attributes_matches_mask (const char *attributes,
const char *mask)
_g_file_attributes_matches_all (const char *attributes,
const char *mask)
{
gboolean matches_all_mask = TRUE;
char **attributes_v;
......@@ -2208,13 +2208,31 @@ _attributes_matches_mask (const char *attributes,
gboolean
_g_file_attributes_matches (const char *attributes,
const char *mask)
_g_file_attributes_matches_any (const char *attributes,
const char *mask)
{
return _attributes_matches_mask (attributes, mask) || _attributes_matches_mask (mask, attributes);
}
gboolean
_g_file_attributes_matches_any_v (const char *attributes,
char **attribute_v)
{
gboolean matches;
int i;
if (attributes == NULL)
return FALSE;
matches = FALSE;
for (i = 0; ! matches && (attribute_v[i] != NULL); i++)
matches = _g_file_attributes_matches_any (attributes, attribute_v[i]);
return matches;
}
/* -- _g_file_info_swap_attributes -- */
......
......@@ -253,10 +253,12 @@ GFile * _g_file_append_prefix (GFile *file,
const char *prefix);
GFile * _g_file_append_path (GFile *file,
const char *path);
gboolean _g_file_attributes_matches_mask (const char *attributes,
gboolean _g_file_attributes_matches_all (const char *attributes,
const char *mask);
gboolean _g_file_attributes_matches (const char *attributes,
gboolean _g_file_attributes_matches_any (const char *attributes,
const char *mask);
gboolean _g_file_attributes_matches_any_v (const char *attributes,
char **attribute_v);
void _g_file_info_swap_attributes (GFileInfo *info,
const char *attr1,
const char *attr2);
......
......@@ -1275,7 +1275,7 @@ attribute_list_reaload_required (const char *old_attributes,
new_attributes_len = g_strv_length (new_attributes_v);
for (i = 0; i < new_attributes_len; i++) {
if (_g_file_attributes_matches (new_attributes_v[i], GIO_ATTRIBUTES)) {
if (_g_file_attributes_matches_any (new_attributes_v[i], GIO_ATTRIBUTES)) {
g_free (new_attributes_v[i]);
new_attributes_v[i] = NULL;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment