summaryrefslogtreecommitdiff
path: root/libnautilus-private/nautilus-glib-extensions.h
diff options
context:
space:
mode:
authorDarin Adler <darin@src.gnome.org>2000-08-09 20:42:57 +0000
committerDarin Adler <darin@src.gnome.org>2000-08-09 20:42:57 +0000
commit39d0bf45867f213d1861beb57bda2d03c189f1d3 (patch)
tree377133c76541c4e397a8136cbd138938f149b838 /libnautilus-private/nautilus-glib-extensions.h
parentc33cedc829e0174457d70a5a093e7fd561597223 (diff)
downloadnautilus-39d0bf45867f213d1861beb57bda2d03c189f1d3.tar.gz
After this change, you will get a warning each time you exit
unless you get the new Bonobo with my destroy-notify bug fix. Fixed the "metafile read fails" bug. Fixed a bunch of memory leaks that I found because I added a new function to get rid of hash tables at quit time and there's a hash table with all the NautilusDirectory objects in there. I'm only 1/2 done with what I'm working on, but people need the "read fails" bug fix. * components/help/help-method.c: (escape_for_shell), (help_uri_to_string): Improve code that constructs URIs so it doesn't to excessive escaping. * libnautilus-extensions/nautilus-directory-async.c: (metafile_read_failed): Fixed a bug that caused it to fail to read "public" metafiles. (new_files_callback): Redid the fix for "NULL names" to check the result from the call instead of checking the name for NULL. * libnautilus-extensions/nautilus-directory-background.c: (nautilus_connect_background_to_directory_metadata): Got rid of the dummy callback so the NautilusDirectory code knows that only the metadata needs to be monitored. * libnautilus-extensions/nautilus-directory.c: (nautilus_directory_get): Got rid of silly ref and sink code. We don't use the floating feature, so we should just ignore it. Use the new function that creates a hash table that should be empty and freed on exit. This helps us detect leaks. (nautilus_directory_file_monitor_add): Got rid of incorrect code that would reject a caller that didn't supply a callback. Callers might want to monitor metadata only, not files. * libnautilus-extensions/nautilus-file.c: (nautilus_file_new_from_name): Got rid of silly ref and sink code. We don't use the floating feature, so we should just ignore it. (modify_link_hash_table), (add_to_link_hash_table_list), (add_to_link_hash_table), (remove_from_link_hash_table_list), (remove_from_link_hash_table): Maintain a hash table to map from a URI to links to that URI. (nautilus_file_new_from_info): Got rid of silly ref and sink code. We don't use the floating feature, so we should just ignore it. To share more code, call nautilus_file_update_info as part of the implementation here. (nautilus_file_update_info): Maintain the hash table entries as the symlink_name field changes. * libnautilus-extensions/nautilus-glib-extensions.h: * libnautilus-extensions/nautilus-glib-extensions.c: (free_hash_tables_at_exit), (nautilus_g_hash_table_new_free_at_exit): Added new function to create a hash table that should be empty on exit, check that is is empty, and free it at exit time. * libnautilus-extensions/nautilus-global-preferences.c: Got rid of some function-pointer casting. * libnautilus-extensions/nautilus-icon-container.h: * libnautilus-extensions/nautilus-icon-container.c: (call_icon_callback), (nautilus_icon_container_for_each): Added a new call to iterate all the icons in the container. Needed so we can unref all the files when we empty it. * libnautilus-extensions/nautilus-glib-extensions.h: * libnautilus-extensions/nautilus-mime-actions.c: (nautilus_mime_get_short_list_applications_for_uri), (nautilus_mime_get_short_list_components_for_uri): Updated for name change: NautilusGPredicateFunc -> NautilusPredicateFunction. * src/file-manager/fm-directory-view.c: (fm_directory_view_destroy), (done_loading): Added code to stop and clear when destroying the directory view. * src/file-manager/fm-icon-view.c: (unref_cover), (fm_icon_view_clear): Added code to get rid of the refs on all the files when the icon view is cleared. * src/file-manager/fm-list-view.c: (fm_list_view_clear): Added code to get rid of the refs on all the files when the icon view is cleared. * src/file-manager/nautilus-trash-monitor.h: * src/file-manager/nautilus-trash-monitor.c: (nautilus_trash_monitor_initialize_class), (destroy), (unref_trash_monitor), (nautilus_trash_monitor_get), (nautilus_trash_monitor_is_empty): Added code to destroy the trash monitor on exit. * src/nautilus-bookmark-list.c: (nautilus_bookmark_list_initialize_class), (stop_monitoring_one), (clear), (destroy), (nautilus_bookmark_list_load_file): Added code to clear out the list at destroy time the same way we already did before loading a file. * src/nautilus-window-menus.c: (free_bookmark_list), (get_bookmark_list): Add code to free the global bookmark list on exit to help with leak checking. (refresh_go_menu): Changed to use GList instead of GSList. * src/nautilus-window-private.h: * src/nautilus-window.c: (nautilus_window_destroy): Unref the current_location_bookmark and last_location_bookmark to fix a leak. (free_history_list), (nautilus_add_to_history_list): Free the history list at exit time to make it easier to spot leaks. (nautilus_window_get_history_list_callback): Change the history list to be a GList instead of GSList.
Diffstat (limited to 'libnautilus-private/nautilus-glib-extensions.h')
-rw-r--r--libnautilus-private/nautilus-glib-extensions.h97
1 files changed, 51 insertions, 46 deletions
diff --git a/libnautilus-private/nautilus-glib-extensions.h b/libnautilus-private/nautilus-glib-extensions.h
index 85b20394a..65dadb562 100644
--- a/libnautilus-private/nautilus-glib-extensions.h
+++ b/libnautilus-private/nautilus-glib-extensions.h
@@ -37,63 +37,68 @@ typedef guint nautilus_boolean_bit;
#define NAUTILUS_N_ELEMENTS(array) (sizeof (array) / sizeof ((array)[0]))
/* Callback functions that have user data. */
-typedef int (* NautilusCompareFunction) (gconstpointer a,
- gconstpointer b,
- gpointer callback_data);
-typedef int (* NautilusSearchFunction) (gconstpointer item,
- gpointer callback_data);
+typedef int (* NautilusCompareFunction) (gconstpointer a,
+ gconstpointer b,
+ gpointer callback_data);
+typedef int (* NautilusSearchFunction) (gconstpointer item,
+ gpointer callback_data);
+
+/* Predicate. */
+typedef gboolean (* NautilusPredicateFunction) (gpointer data,
+ gpointer callback_data);
/* Date & time functions. */
-GDate * nautilus_g_date_new_tm (struct tm *time_pieces);
-char * nautilus_strdup_strftime (const char *format,
- struct tm *time_pieces);
-
-/* List functions. */
-typedef gboolean (*NautilusGPredicateFunc) (gpointer data,
- gpointer user_data);
-
-
-gboolean nautilus_g_list_exactly_one_item (GList *list);
-gboolean nautilus_g_list_more_than_one_item (GList *list);
-gboolean nautilus_g_list_equal (GList *list_a,
- GList *list_b);
-GList * nautilus_g_list_copy (GList *list);
-void nautilus_g_list_safe_for_each (GList *list,
- GFunc function,
- gpointer user_data);
-GList * nautilus_g_list_partition (GList *list,
- NautilusGPredicateFunc predicate,
- gpointer user_data,
- GList **removed);
-void nautilus_g_list_free_deep_custom (GList *list,
- GFunc element_free_func,
- gpointer user_data);
+GDate * nautilus_g_date_new_tm (struct tm *time_pieces);
+char * nautilus_strdup_strftime (const char *format,
+ struct tm *time_pieces);
+
+/* GList functions. */
+gboolean nautilus_g_list_exactly_one_item (GList *list);
+gboolean nautilus_g_list_more_than_one_item (GList *list);
+gboolean nautilus_g_list_equal (GList *list_a,
+ GList *list_b);
+GList * nautilus_g_list_copy (GList *list);
+void nautilus_g_list_safe_for_each (GList *list,
+ GFunc function,
+ gpointer user_data);
+GList * nautilus_g_list_partition (GList *list,
+ NautilusPredicateFunction predicate,
+ gpointer user_data,
+ GList **removed);
+void nautilus_g_list_free_deep_custom (GList *list,
+ GFunc element_free_func,
+ gpointer user_data);
/* List functions for lists of g_free'able objects. */
-void nautilus_g_list_free_deep (GList *list);
+void nautilus_g_list_free_deep (GList *list);
/* List functions for lists of C strings. */
-gboolean nautilus_g_str_list_equal (GList *str_list_a,
- GList *str_list_b);
-GList * nautilus_g_str_list_copy (GList *str_list);
-GList * nautilus_g_str_list_sort (GList *str_list);
-GList * nautilus_g_str_list_sort_case_insensitive (GList *str_list);
+gboolean nautilus_g_str_list_equal (GList *str_list_a,
+ GList *str_list_b);
+GList * nautilus_g_str_list_copy (GList *str_list);
+GList * nautilus_g_str_list_sort (GList *str_list);
+GList * nautilus_g_str_list_sort_case_insensitive (GList *str_list);
+
+/* GHashTable functions */
+GHashTable *nautilus_g_hash_table_new_free_at_exit (GHashFunc hash_func,
+ GCompareFunc key_compare_func,
+ const char *display_name);
/* GPtrArray functions */
-GPtrArray *nautilus_g_ptr_array_new_from_list (GList *list);
-void nautilus_g_ptr_array_sort (GPtrArray *array,
- NautilusCompareFunction compare_callback,
- gpointer callback_data);
-int nautilus_g_ptr_array_search (GPtrArray *array,
- NautilusSearchFunction search_callback,
- gpointer callback_data,
- gboolean match_only);
+GPtrArray * nautilus_g_ptr_array_new_from_list (GList *list);
+void nautilus_g_ptr_array_sort (GPtrArray *array,
+ NautilusCompareFunction compare_callback,
+ gpointer callback_data);
+int nautilus_g_ptr_array_search (GPtrArray *array,
+ NautilusSearchFunction search_callback,
+ gpointer callback_data,
+ gboolean match_only);
/* NULL terminated string arrays (strv). */
-int nautilus_g_strv_find (char **strv,
- const char *find_me);
+int nautilus_g_strv_find (char **strv,
+ const char *find_me);
/* return the time in microseconds since the machine was started */
-gint64 nautilus_get_system_time (void);
+gint64 nautilus_get_system_time (void);
#endif /* NAUTILUS_GLIB_EXTENSIONS_H */