diff options
author | rbuj <[email protected]> | 2021-02-03 12:18:38 +0100 |
---|---|---|
committer | Luke from DC <[email protected]> | 2021-02-21 19:34:34 +0000 |
commit | bae8a41d5a5966d99ad538d8fd1acf3654bf39ab (patch) | |
tree | 929ceb4628e08153931fcaa1e90c35b3a4bdad57 | |
parent | 6de5a2680760436fe15ee16ed530f23ef1ced33a (diff) | |
download | caja-bae8a41d5a5966d99ad538d8fd1acf3654bf39ab.tar.bz2 caja-bae8a41d5a5966d99ad538d8fd1acf3654bf39ab.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 5a093a5d..0c9a6ba7 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)); } } |