Skip to content
Permalink
Browse files

libcaja-private: remove redundant prefs application to hash table

These preferences are all applied elsewhere and all work without this. Removing it stops the g_hash_table_foreach warnings with GTK 3.23.0
  • Loading branch information...
lukefromdc committed Jul 7, 2018
1 parent 78d9182 commit 191aa3992171c84134f0359a960e5bebc7bfeca4
Showing with 0 additions and 47 deletions.
  1. +0 −47 libcaja-private/caja-directory.c
@@ -226,17 +226,6 @@ invalidate_one_count (gpointer key, gpointer value, gpointer user_data)
caja_directory_invalidate_count_and_mime_list (directory);
}

static void
filtering_changed_callback (gpointer callback_data)
{
g_assert (callback_data == NULL);

/* Preference about which items to show has changed, so we
* can't trust any of our precomputed directory counts.
*/
g_hash_table_foreach (directories, invalidate_one_count, NULL);
}

void
emit_change_signals_for_all_files (CajaDirectory *directory)
{
@@ -302,40 +291,7 @@ async_state_changed_one (gpointer key, gpointer value, gpointer user_data)
emit_change_signals_for_all_files (directory);
}

static void
async_data_preference_changed_callback (gpointer callback_data)
{
g_assert (callback_data == NULL);

/* Preference involving fetched async data has changed, so
* we have to kick off refetching all async data, and tell
* each file that it (might have) changed.
*/
g_hash_table_foreach (directories, async_state_changed_one, NULL);
}

static void
add_preferences_callbacks (void)
{
caja_global_preferences_init ();

g_signal_connect_swapped (caja_preferences,
"changed::" CAJA_PREFERENCES_SHOW_HIDDEN_FILES,
G_CALLBACK(filtering_changed_callback),
NULL);
g_signal_connect_swapped (caja_preferences,
"changed::" CAJA_PREFERENCES_SHOW_TEXT_IN_ICONS,
G_CALLBACK (async_data_preference_changed_callback),
NULL);
g_signal_connect_swapped (caja_preferences,
"changed::" CAJA_PREFERENCES_SHOW_DIRECTORY_ITEM_COUNTS,
G_CALLBACK (async_data_preference_changed_callback),
NULL);
g_signal_connect_swapped (caja_preferences,
"changed::" CAJA_PREFERENCES_DATE_FORMAT,
G_CALLBACK(async_data_preference_changed_callback),
NULL);
}

/**
* caja_directory_get_by_uri:
@@ -354,7 +310,6 @@ caja_directory_get_internal (GFile *location, gboolean create)
/* Create the hash table first time through. */
if (directories == NULL) {
directories = g_hash_table_new (g_file_hash, (GCompareFunc) g_file_equal);
add_preferences_callbacks ();
}

/* If the object is already in the hash table, look it up. */
@@ -1055,7 +1010,6 @@ caja_directory_notify_files_changed (GList *files)
file);
}
}

/* Now send out the changed signals. */
g_hash_table_foreach (changed_lists, call_files_changed_unref_free_list, NULL);
g_hash_table_destroy (changed_lists);
@@ -1102,7 +1056,6 @@ caja_directory_notify_files_removed (GList *files)
}
caja_file_unref (file);
}

/* Now send out the changed signals. */
g_hash_table_foreach (changed_lists, call_files_changed_unref_free_list, NULL);
g_hash_table_destroy (changed_lists);

0 comments on commit 191aa39

Please sign in to comment.
You can’t perform that action at this time.