diff options
author | rbuj <[email protected]> | 2021-02-03 12:18:38 +0100 |
---|---|---|
committer | raveit65 <[email protected]> | 2022-07-21 19:33:50 +0200 |
commit | 01f33f981f436b85d86e408bb64899abb6e6ca91 (patch) | |
tree | 99e5a10cee4b1c6a7afe581216b9da0dbe2fe3c6 | |
parent | 92f751b2ae5a3bf90e39434255fec503cf471be7 (diff) | |
download | caja-01f33f981f436b85d86e408bb64899abb6e6ca91.tar.bz2 caja-01f33f981f436b85d86e408bb64899abb6e6ca91.tar.xz |
caja-directory-async: drop istr_set_insert, use g_hash_table_add instead
-rw-r--r-- | libcaja-private/caja-directory-async.c | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/libcaja-private/caja-directory-async.c b/libcaja-private/caja-directory-async.c index bff999b0..c52e8db1 100644 --- a/libcaja-private/caja-directory-async.c +++ b/libcaja-private/caja-directory-async.c @@ -251,15 +251,6 @@ istr_set_new (void) } static void -istr_set_insert (GHashTable *table, const char *istr) -{ - char *key; - - key = g_strdup (istr); - g_hash_table_replace (table, key, key); -} - -static void add_istr_to_list (gpointer key, gpointer value, gpointer callback_data) { GList **list; @@ -978,17 +969,15 @@ dequeue_pending_idle_callback (gpointer callback_data) * moving this into the actual callback instead of * waiting for the idle function. */ - if (dir_load_state && - !should_skip_file (directory, file_info)) + if (dir_load_state && !should_skip_file (directory, file_info)) { dir_load_state->load_file_count += 1; /* Add the MIME type to the set. */ - mimetype = g_file_info_get_content_type (file_info); - if (mimetype != NULL) + if ((mimetype = g_file_info_get_content_type (file_info)) != NULL) { - istr_set_insert (dir_load_state->load_mime_list_hash, - mimetype); + g_hash_table_add (dir_load_state->load_mime_list_hash, + g_strdup (mimetype)); } } @@ -3272,7 +3261,7 @@ mime_list_done (MimeListState *state, gboolean success) static void mime_list_one (MimeListState *state, - GFileInfo *info) + GFileInfo *info) { const char *mime_type; @@ -3282,10 +3271,9 @@ mime_list_one (MimeListState *state, return; } - mime_type = g_file_info_get_content_type (info); - if (mime_type != NULL) + if ((mime_type = g_file_info_get_content_type (info)) != NULL) { - istr_set_insert (state->mime_list_hash, mime_type); + g_hash_table_add (state->mime_list_hash, g_strdup (mime_type)); } } |