diff options
author | Darin Adler <darin@src.gnome.org> | 2000-09-02 00:12:36 +0000 |
---|---|---|
committer | Darin Adler <darin@src.gnome.org> | 2000-09-02 00:12:36 +0000 |
commit | ee13aa809da7702fb2eeb8db65db60059697c7db (patch) | |
tree | 31cbafe1b04821c49402ddfaec7e763346ec254a | |
parent | 042f10b87b023765a11e22bcf03919f6175c963f (diff) | |
download | nautilus-ee13aa809da7702fb2eeb8db65db60059697c7db.tar.gz |
Made this function public because it's needed to get the assert right.
* libnautilus-extensions/nautilus-directory-private.h:
* libnautilus-extensions/nautilus-directory-async.c:
(nautilus_directory_is_anyone_monitoring_file_list):
Made this function public because it's needed to get the
assert right.
(start_or_stop_io): Use it by the new public name.
* libnautilus-extensions/nautilus-vfs-directory.c:
(vfs_is_not_empty): Use the new function to get the assert
right, which fixes bug 2706 (crash at startup with
bookmark for nonexistent trash file).
* libnautilus-extensions/nautilus-trash-directory.c:
(remove_trash_volume): Fix a NautilusDirectory leak.
* libnautilus-extensions/nautilus-glib-extensions.c:
(print_key_string), (free_hash_tables_at_exit):
Print keys before complaining about hash table so you
see them first if you have things set to drop into
the debugger on warnings.
-rw-r--r-- | ChangeLog | 22 | ||||
-rwxr-xr-x | check-FIXME.pl | 2 | ||||
-rw-r--r-- | libnautilus-extensions/nautilus-directory-async.c | 6 | ||||
-rw-r--r-- | libnautilus-extensions/nautilus-directory-private.h | 105 | ||||
-rw-r--r-- | libnautilus-extensions/nautilus-glib-extensions.c | 10 | ||||
-rw-r--r-- | libnautilus-extensions/nautilus-trash-directory.c | 1 | ||||
-rw-r--r-- | libnautilus-extensions/nautilus-vfs-directory.c | 4 | ||||
-rw-r--r-- | libnautilus-private/nautilus-directory-async.c | 6 | ||||
-rw-r--r-- | libnautilus-private/nautilus-directory-private.h | 105 | ||||
-rw-r--r-- | libnautilus-private/nautilus-glib-extensions.c | 10 | ||||
-rw-r--r-- | libnautilus-private/nautilus-trash-directory.c | 1 | ||||
-rw-r--r-- | libnautilus-private/nautilus-vfs-directory.c | 4 |
12 files changed, 155 insertions, 121 deletions
@@ -1,3 +1,25 @@ +2000-09-01 Darin Adler <darin@eazel.com> + + * libnautilus-extensions/nautilus-directory-private.h: + * libnautilus-extensions/nautilus-directory-async.c: + (nautilus_directory_is_anyone_monitoring_file_list): + Made this function public because it's needed to get the + assert right. + (start_or_stop_io): Use it by the new public name. + * libnautilus-extensions/nautilus-vfs-directory.c: + (vfs_is_not_empty): Use the new function to get the assert + right, which fixes bug 2706 (crash at startup with + bookmark for nonexistent trash file). + + * libnautilus-extensions/nautilus-trash-directory.c: + (remove_trash_volume): Fix a NautilusDirectory leak. + + * libnautilus-extensions/nautilus-glib-extensions.c: + (print_key_string), (free_hash_tables_at_exit): + Print keys before complaining about hash table so you + see them first if you have things set to drop into + the debugger on warnings. + 2000-09-01 John Sullivan <sullivan@eazel.com> Changed all nautilus dialog calls to take a window title diff --git a/check-FIXME.pl b/check-FIXME.pl index d7ce52f49..350fb4827 100755 --- a/check-FIXME.pl +++ b/check-FIXME.pl @@ -65,7 +65,7 @@ foreach my $file (@ARGV) while (<FILE>) { next if !/FIXME/; - if (/FIXME\s?:?\s?bugzilla.eazel.com\s+(\d+)/) + if (/FIXME\s*:?\s*bugzilla.eazel.com\s+(\d+)/) { $bug_lines{$1} .= "$file:$.:$_"; } diff --git a/libnautilus-extensions/nautilus-directory-async.c b/libnautilus-extensions/nautilus-directory-async.c index f1d5a22a3..41f1353d2 100644 --- a/libnautilus-extensions/nautilus-directory-async.c +++ b/libnautilus-extensions/nautilus-directory-async.c @@ -1534,8 +1534,8 @@ call_ready_callbacks (NautilusDirectory *directory) } /* This checks if there's a request for monitoring the file list. */ -static gboolean -is_anyone_monitoring_file_list (NautilusDirectory *directory) +gboolean +nautilus_directory_is_anyone_monitoring_file_list (NautilusDirectory *directory) { GList *p; ReadyCallback *callback; @@ -2414,7 +2414,7 @@ start_or_stop_io (NautilusDirectory *directory) } /* Start or stop reading files. */ - if (is_anyone_monitoring_file_list (directory)) { + if (nautilus_directory_is_anyone_monitoring_file_list (directory)) { start_monitoring_file_list (directory); } else { nautilus_directory_stop_monitoring_file_list (directory); diff --git a/libnautilus-extensions/nautilus-directory-private.h b/libnautilus-extensions/nautilus-directory-private.h index 008ee21f3..bbf177e10 100644 --- a/libnautilus-extensions/nautilus-directory-private.h +++ b/libnautilus-extensions/nautilus-directory-private.h @@ -96,61 +96,62 @@ struct NautilusDirectoryDetails }; /* async. interface */ -void nautilus_directory_async_state_changed (NautilusDirectory *directory); -void nautilus_directory_call_when_ready_internal (NautilusDirectory *directory, - NautilusFile *file, - GList *file_attributes, - gboolean monitor_metadata, - NautilusDirectoryCallback directory_callback, - NautilusFileCallback file_callback, - gpointer callback_data); -gboolean nautilus_directory_check_if_ready_internal (NautilusDirectory *directory, - NautilusFile *file, - GList *file_attributes); -void nautilus_directory_cancel_callback_internal (NautilusDirectory *directory, - NautilusFile *file, - NautilusDirectoryCallback directory_callback, - NautilusFileCallback file_callback, - gpointer callback_data); -void nautilus_directory_monitor_add_internal (NautilusDirectory *directory, - NautilusFile *file, - gconstpointer client, - GList *attributes, - gboolean monitor_metadata); -void nautilus_directory_monitor_remove_internal (NautilusDirectory *directory, - NautilusFile *file, - gconstpointer client); -void nautilus_directory_get_info_for_new_files (NautilusDirectory *directory, - GList *vfs_uris); -gboolean nautilus_directory_is_file_list_monitored (NautilusDirectory *directory); -void nautilus_directory_remove_file_monitor_link (NautilusDirectory *directory, - GList *link); -void nautilus_directory_request_read_metafile (NautilusDirectory *directory); -void nautilus_directory_request_write_metafile (NautilusDirectory *directory); -void nautilus_directory_schedule_dequeue_pending (NautilusDirectory *directory); -void nautilus_directory_stop_monitoring_file_list (NautilusDirectory *directory); -void nautilus_directory_cancel (NautilusDirectory *directory); -void nautilus_metafile_write_start (NautilusDirectory *directory); -void nautilus_async_destroying_file (NautilusFile *file); -void nautilus_directory_force_reload (NautilusDirectory *directory); +void nautilus_directory_async_state_changed (NautilusDirectory *directory); +void nautilus_directory_call_when_ready_internal (NautilusDirectory *directory, + NautilusFile *file, + GList *file_attributes, + gboolean monitor_metadata, + NautilusDirectoryCallback directory_callback, + NautilusFileCallback file_callback, + gpointer callback_data); +gboolean nautilus_directory_check_if_ready_internal (NautilusDirectory *directory, + NautilusFile *file, + GList *file_attributes); +void nautilus_directory_cancel_callback_internal (NautilusDirectory *directory, + NautilusFile *file, + NautilusDirectoryCallback directory_callback, + NautilusFileCallback file_callback, + gpointer callback_data); +void nautilus_directory_monitor_add_internal (NautilusDirectory *directory, + NautilusFile *file, + gconstpointer client, + GList *attributes, + gboolean monitor_metadata); +void nautilus_directory_monitor_remove_internal (NautilusDirectory *directory, + NautilusFile *file, + gconstpointer client); +void nautilus_directory_get_info_for_new_files (NautilusDirectory *directory, + GList *vfs_uris); +gboolean nautilus_directory_is_file_list_monitored (NautilusDirectory *directory); +gboolean nautilus_directory_is_anyone_monitoring_file_list (NautilusDirectory *directory); +void nautilus_directory_remove_file_monitor_link (NautilusDirectory *directory, + GList *link); +void nautilus_directory_request_read_metafile (NautilusDirectory *directory); +void nautilus_directory_request_write_metafile (NautilusDirectory *directory); +void nautilus_directory_schedule_dequeue_pending (NautilusDirectory *directory); +void nautilus_directory_stop_monitoring_file_list (NautilusDirectory *directory); +void nautilus_directory_cancel (NautilusDirectory *directory); +void nautilus_metafile_write_start (NautilusDirectory *directory); +void nautilus_async_destroying_file (NautilusFile *file); +void nautilus_directory_force_reload (NautilusDirectory *directory); /* Calls shared between directory, file, and async. code. */ -NautilusFile * nautilus_directory_find_file (NautilusDirectory *directory, - const char *file_name); -void nautilus_directory_emit_metadata_changed (NautilusDirectory *directory); -void nautilus_directory_emit_files_added (NautilusDirectory *directory, - GList *added_files); -void nautilus_directory_emit_files_changed (NautilusDirectory *directory, - GList *changed_files); -void nautilus_directory_emit_change_signals_deep (NautilusDirectory *directory, - GList *changed_files); -void nautilus_directory_emit_done_loading (NautilusDirectory *directory); -NautilusDirectory *nautilus_directory_get_internal (const char *uri, - gboolean create); +NautilusFile * nautilus_directory_find_file (NautilusDirectory *directory, + const char *file_name); +void nautilus_directory_emit_metadata_changed (NautilusDirectory *directory); +void nautilus_directory_emit_files_added (NautilusDirectory *directory, + GList *added_files); +void nautilus_directory_emit_files_changed (NautilusDirectory *directory, + GList *changed_files); +void nautilus_directory_emit_change_signals_deep (NautilusDirectory *directory, + GList *changed_files); +void nautilus_directory_emit_done_loading (NautilusDirectory *directory); +NautilusDirectory *nautilus_directory_get_internal (const char *uri, + gboolean create); /* debugging functions */ -int nautilus_directory_number_outstanding (void); +int nautilus_directory_number_outstanding (void); /* Shared functions not directly related to NautilusDirectory/File. */ -int nautilus_compare_file_with_name (gconstpointer a, - gconstpointer b); +int nautilus_compare_file_with_name (gconstpointer a, + gconstpointer b); diff --git a/libnautilus-extensions/nautilus-glib-extensions.c b/libnautilus-extensions/nautilus-glib-extensions.c index 1417dd031..4d719ed37 100644 --- a/libnautilus-extensions/nautilus-glib-extensions.c +++ b/libnautilus-extensions/nautilus-glib-extensions.c @@ -606,7 +606,7 @@ print_key_string (gpointer key, gpointer value, gpointer callback_data) { g_assert (callback_data == NULL); - g_print ("-> %s\n", (char *) key); + g_print ("--> %s\n", (char *) key); } static void @@ -621,13 +621,17 @@ free_hash_tables_at_exit (void) size = g_hash_table_size (hash_table_to_free->hash_table); if (size != 0) { - g_warning ("hash table %s still has %u elements at quit time", - hash_table_to_free->display_name, size); if (hash_table_to_free->keys_known_to_be_strings) { + g_print ("\n--- Hash table keys for warning below:\n"); g_hash_table_foreach (hash_table_to_free->hash_table, print_key_string, NULL); } + g_warning ("\"%s\" hash table still has %u element%s at quit time%s", + hash_table_to_free->display_name, size, + size == 1 ? "" : "s", + hash_table_to_free->keys_known_to_be_strings + ? " (keys above)" : ""); } g_hash_table_destroy (hash_table_to_free->hash_table); diff --git a/libnautilus-extensions/nautilus-trash-directory.c b/libnautilus-extensions/nautilus-trash-directory.c index 9e3f6ea70..b997b0730 100644 --- a/libnautilus-extensions/nautilus-trash-directory.c +++ b/libnautilus-extensions/nautilus-trash-directory.c @@ -172,6 +172,7 @@ remove_trash_volume (TrashVolume *trash_volume) nautilus_merged_directory_remove_real_directory (NAUTILUS_MERGED_DIRECTORY (trash_volume->trash), trash_volume->real_directory); + nautilus_directory_unref (trash_volume->real_directory); } g_free (trash_volume); } diff --git a/libnautilus-extensions/nautilus-vfs-directory.c b/libnautilus-extensions/nautilus-vfs-directory.c index e698ef339..71d3da16f 100644 --- a/libnautilus-extensions/nautilus-vfs-directory.c +++ b/libnautilus-extensions/nautilus-vfs-directory.c @@ -154,8 +154,8 @@ vfs_is_not_empty (NautilusDirectory *directory) char *public_metafile_uri; gboolean not_empty; - g_assert (NAUTILUS_IS_VFS_DIRECTORY (directory)); - g_assert (nautilus_directory_is_file_list_monitored (directory)); + g_return_val_if_fail (NAUTILUS_IS_VFS_DIRECTORY (directory), FALSE); + g_return_val_if_fail (nautilus_directory_is_anyone_monitoring_file_list (directory), FALSE); if (directory->details->public_metafile_vfs_uri == NULL) { not_empty = directory->details->files != NULL; diff --git a/libnautilus-private/nautilus-directory-async.c b/libnautilus-private/nautilus-directory-async.c index f1d5a22a3..41f1353d2 100644 --- a/libnautilus-private/nautilus-directory-async.c +++ b/libnautilus-private/nautilus-directory-async.c @@ -1534,8 +1534,8 @@ call_ready_callbacks (NautilusDirectory *directory) } /* This checks if there's a request for monitoring the file list. */ -static gboolean -is_anyone_monitoring_file_list (NautilusDirectory *directory) +gboolean +nautilus_directory_is_anyone_monitoring_file_list (NautilusDirectory *directory) { GList *p; ReadyCallback *callback; @@ -2414,7 +2414,7 @@ start_or_stop_io (NautilusDirectory *directory) } /* Start or stop reading files. */ - if (is_anyone_monitoring_file_list (directory)) { + if (nautilus_directory_is_anyone_monitoring_file_list (directory)) { start_monitoring_file_list (directory); } else { nautilus_directory_stop_monitoring_file_list (directory); diff --git a/libnautilus-private/nautilus-directory-private.h b/libnautilus-private/nautilus-directory-private.h index 008ee21f3..bbf177e10 100644 --- a/libnautilus-private/nautilus-directory-private.h +++ b/libnautilus-private/nautilus-directory-private.h @@ -96,61 +96,62 @@ struct NautilusDirectoryDetails }; /* async. interface */ -void nautilus_directory_async_state_changed (NautilusDirectory *directory); -void nautilus_directory_call_when_ready_internal (NautilusDirectory *directory, - NautilusFile *file, - GList *file_attributes, - gboolean monitor_metadata, - NautilusDirectoryCallback directory_callback, - NautilusFileCallback file_callback, - gpointer callback_data); -gboolean nautilus_directory_check_if_ready_internal (NautilusDirectory *directory, - NautilusFile *file, - GList *file_attributes); -void nautilus_directory_cancel_callback_internal (NautilusDirectory *directory, - NautilusFile *file, - NautilusDirectoryCallback directory_callback, - NautilusFileCallback file_callback, - gpointer callback_data); -void nautilus_directory_monitor_add_internal (NautilusDirectory *directory, - NautilusFile *file, - gconstpointer client, - GList *attributes, - gboolean monitor_metadata); -void nautilus_directory_monitor_remove_internal (NautilusDirectory *directory, - NautilusFile *file, - gconstpointer client); -void nautilus_directory_get_info_for_new_files (NautilusDirectory *directory, - GList *vfs_uris); -gboolean nautilus_directory_is_file_list_monitored (NautilusDirectory *directory); -void nautilus_directory_remove_file_monitor_link (NautilusDirectory *directory, - GList *link); -void nautilus_directory_request_read_metafile (NautilusDirectory *directory); -void nautilus_directory_request_write_metafile (NautilusDirectory *directory); -void nautilus_directory_schedule_dequeue_pending (NautilusDirectory *directory); -void nautilus_directory_stop_monitoring_file_list (NautilusDirectory *directory); -void nautilus_directory_cancel (NautilusDirectory *directory); -void nautilus_metafile_write_start (NautilusDirectory *directory); -void nautilus_async_destroying_file (NautilusFile *file); -void nautilus_directory_force_reload (NautilusDirectory *directory); +void nautilus_directory_async_state_changed (NautilusDirectory *directory); +void nautilus_directory_call_when_ready_internal (NautilusDirectory *directory, + NautilusFile *file, + GList *file_attributes, + gboolean monitor_metadata, + NautilusDirectoryCallback directory_callback, + NautilusFileCallback file_callback, + gpointer callback_data); +gboolean nautilus_directory_check_if_ready_internal (NautilusDirectory *directory, + NautilusFile *file, + GList *file_attributes); +void nautilus_directory_cancel_callback_internal (NautilusDirectory *directory, + NautilusFile *file, + NautilusDirectoryCallback directory_callback, + NautilusFileCallback file_callback, + gpointer callback_data); +void nautilus_directory_monitor_add_internal (NautilusDirectory *directory, + NautilusFile *file, + gconstpointer client, + GList *attributes, + gboolean monitor_metadata); +void nautilus_directory_monitor_remove_internal (NautilusDirectory *directory, + NautilusFile *file, + gconstpointer client); +void nautilus_directory_get_info_for_new_files (NautilusDirectory *directory, + GList *vfs_uris); +gboolean nautilus_directory_is_file_list_monitored (NautilusDirectory *directory); +gboolean nautilus_directory_is_anyone_monitoring_file_list (NautilusDirectory *directory); +void nautilus_directory_remove_file_monitor_link (NautilusDirectory *directory, + GList *link); +void nautilus_directory_request_read_metafile (NautilusDirectory *directory); +void nautilus_directory_request_write_metafile (NautilusDirectory *directory); +void nautilus_directory_schedule_dequeue_pending (NautilusDirectory *directory); +void nautilus_directory_stop_monitoring_file_list (NautilusDirectory *directory); +void nautilus_directory_cancel (NautilusDirectory *directory); +void nautilus_metafile_write_start (NautilusDirectory *directory); +void nautilus_async_destroying_file (NautilusFile *file); +void nautilus_directory_force_reload (NautilusDirectory *directory); /* Calls shared between directory, file, and async. code. */ -NautilusFile * nautilus_directory_find_file (NautilusDirectory *directory, - const char *file_name); -void nautilus_directory_emit_metadata_changed (NautilusDirectory *directory); -void nautilus_directory_emit_files_added (NautilusDirectory *directory, - GList *added_files); -void nautilus_directory_emit_files_changed (NautilusDirectory *directory, - GList *changed_files); -void nautilus_directory_emit_change_signals_deep (NautilusDirectory *directory, - GList *changed_files); -void nautilus_directory_emit_done_loading (NautilusDirectory *directory); -NautilusDirectory *nautilus_directory_get_internal (const char *uri, - gboolean create); +NautilusFile * nautilus_directory_find_file (NautilusDirectory *directory, + const char *file_name); +void nautilus_directory_emit_metadata_changed (NautilusDirectory *directory); +void nautilus_directory_emit_files_added (NautilusDirectory *directory, + GList *added_files); +void nautilus_directory_emit_files_changed (NautilusDirectory *directory, + GList *changed_files); +void nautilus_directory_emit_change_signals_deep (NautilusDirectory *directory, + GList *changed_files); +void nautilus_directory_emit_done_loading (NautilusDirectory *directory); +NautilusDirectory *nautilus_directory_get_internal (const char *uri, + gboolean create); /* debugging functions */ -int nautilus_directory_number_outstanding (void); +int nautilus_directory_number_outstanding (void); /* Shared functions not directly related to NautilusDirectory/File. */ -int nautilus_compare_file_with_name (gconstpointer a, - gconstpointer b); +int nautilus_compare_file_with_name (gconstpointer a, + gconstpointer b); diff --git a/libnautilus-private/nautilus-glib-extensions.c b/libnautilus-private/nautilus-glib-extensions.c index 1417dd031..4d719ed37 100644 --- a/libnautilus-private/nautilus-glib-extensions.c +++ b/libnautilus-private/nautilus-glib-extensions.c @@ -606,7 +606,7 @@ print_key_string (gpointer key, gpointer value, gpointer callback_data) { g_assert (callback_data == NULL); - g_print ("-> %s\n", (char *) key); + g_print ("--> %s\n", (char *) key); } static void @@ -621,13 +621,17 @@ free_hash_tables_at_exit (void) size = g_hash_table_size (hash_table_to_free->hash_table); if (size != 0) { - g_warning ("hash table %s still has %u elements at quit time", - hash_table_to_free->display_name, size); if (hash_table_to_free->keys_known_to_be_strings) { + g_print ("\n--- Hash table keys for warning below:\n"); g_hash_table_foreach (hash_table_to_free->hash_table, print_key_string, NULL); } + g_warning ("\"%s\" hash table still has %u element%s at quit time%s", + hash_table_to_free->display_name, size, + size == 1 ? "" : "s", + hash_table_to_free->keys_known_to_be_strings + ? " (keys above)" : ""); } g_hash_table_destroy (hash_table_to_free->hash_table); diff --git a/libnautilus-private/nautilus-trash-directory.c b/libnautilus-private/nautilus-trash-directory.c index 9e3f6ea70..b997b0730 100644 --- a/libnautilus-private/nautilus-trash-directory.c +++ b/libnautilus-private/nautilus-trash-directory.c @@ -172,6 +172,7 @@ remove_trash_volume (TrashVolume *trash_volume) nautilus_merged_directory_remove_real_directory (NAUTILUS_MERGED_DIRECTORY (trash_volume->trash), trash_volume->real_directory); + nautilus_directory_unref (trash_volume->real_directory); } g_free (trash_volume); } diff --git a/libnautilus-private/nautilus-vfs-directory.c b/libnautilus-private/nautilus-vfs-directory.c index e698ef339..71d3da16f 100644 --- a/libnautilus-private/nautilus-vfs-directory.c +++ b/libnautilus-private/nautilus-vfs-directory.c @@ -154,8 +154,8 @@ vfs_is_not_empty (NautilusDirectory *directory) char *public_metafile_uri; gboolean not_empty; - g_assert (NAUTILUS_IS_VFS_DIRECTORY (directory)); - g_assert (nautilus_directory_is_file_list_monitored (directory)); + g_return_val_if_fail (NAUTILUS_IS_VFS_DIRECTORY (directory), FALSE); + g_return_val_if_fail (nautilus_directory_is_anyone_monitoring_file_list (directory), FALSE); if (directory->details->public_metafile_vfs_uri == NULL) { not_empty = directory->details->files != NULL; |