diff options
author | Darin Adler <darin@src.gnome.org> | 2001-01-15 23:45:04 +0000 |
---|---|---|
committer | Darin Adler <darin@src.gnome.org> | 2001-01-15 23:45:04 +0000 |
commit | daee7ca55208f6e01db5f5be0839d146e7fb5c18 (patch) | |
tree | 40ef6d6f97f367e99a784951bb0f31e2d6056f03 /libnautilus-private/nautilus-merged-directory.c | |
parent | 9ed2f40a2b8ca7d4af5f5bd4bcf79372181aa07d (diff) | |
download | nautilus-daee7ca55208f6e01db5f5be0839d146e7fb5c18.tar.gz |
Fix bug 5557 (Intermittent crash in
Nautilus_View_history_changed):
* src/nautilus-view-frame.c: (send_history): Added a check for
NULL so we don't try to send a NULL history list through the
history machinery.
Fix bug 5360 ("menthos's Home" string is hard to translate):
* src/file-manager/fm-desktop-icon-view.c:
(update_home_link_and_delete_copies): Added comment to help
translators understand what to do with "%s's Home".
Fix bug 5641 ("xfree" does not work with newer versions of RPM 4
headers):
* components/services/install/lib/eazel-package-system-rpm3.c:
(eazel_package_system_rpm3_packagedata_fill_from_header): Just
use "free" instead of "xfree".
Fix bug 5631 (Tear-offs of right-click menus don't work):
* src/nautilus-shell-ui.xml:
* src/file-manager/nautilus-directory-view-ui.xml:
* src/file-manager/nautilus-icon-view-ui.xml:
Mark popups and submenus of the popups with tearoff="0" so they
don't have tear-off menu items.
More work on bug 2147 (NautilusFile for trash needs non-empty
values for more properties).
* libnautilus-extensions/nautilus-file.h:
* libnautilus-extensions/nautilus-file.c:
(nautilus_file_new_from_relative_uri),
(nautilus_file_new_from_info), (nautilus_file_monitor_add),
(nautilus_file_monitor_remove),
(nautilus_file_get_directory_item_count),
(nautilus_file_get_deep_counts), (nautilus_file_check_if_ready),
(nautilus_file_call_when_ready),
(nautilus_file_cancel_call_when_ready):
Put more of the machinery in place to make enough of NautilusFile
virtual so that we can implement the trash case.
* libnautilus-extensions/nautilus-merged-directory.h:
* libnautilus-extensions/nautilus-merged-directory.c:
(merged_add_real_directory),
(nautilus_merged_directory_add_real_directory),
(merged_remove_real_directory),
(nautilus_merged_directory_remove_real_directory),
(remove_all_real_directories),
(nautilus_merged_directory_initialize_class):
Make adding and removing directories use signals so we can share
this list with the NautilusTrashFile.
* libnautilus-extensions/nautilus-trash-file.c:
(add_directory_callback), (remove_directory_callback),
(nautilus_trash_file_initialize), (trash_destroy):
Use a NautilusTrashDirectory object for the list of directories.
* libnautilus-extensions/nautilus-vfs-file.c:
(vfs_file_monitor_add), (vfs_file_monitor_remove),
(vfs_file_call_when_ready), (vfs_file_cancel_call_when_ready),
(vfs_file_check_if_ready), (vfs_file_get_item_count),
(vfs_file_get_deep_counts), (nautilus_vfs_file_initialize_class):
Move the guts of these functions into the "VFS" subclass.
Other stuff:
* libnautilus-extensions/nautilus-trash-directory.c:
(find_directory_start), (find_directory_end),
(find_directory_callback), (add_volume), (remove_trash_volume):
Fix bug in the recently-added timed-wait, to handle the case where
the call is cancelled as well as the case where it succeeds or
fails.
* src/file-manager/fm-directory-view.c:
(zoomable_set_zoom_level_callback): Formatting tweak.
* src/nautilus-main.c: (main): Fix the FIXME.
Diffstat (limited to 'libnautilus-private/nautilus-merged-directory.c')
-rw-r--r-- | libnautilus-private/nautilus-merged-directory.c | 130 |
1 files changed, 94 insertions, 36 deletions
diff --git a/libnautilus-private/nautilus-merged-directory.c b/libnautilus-private/nautilus-merged-directory.c index 91f0fe93b..2bea0815a 100644 --- a/libnautilus-private/nautilus-merged-directory.c +++ b/libnautilus-private/nautilus-merged-directory.c @@ -60,6 +60,14 @@ typedef struct { gboolean force_reload; } MergedMonitor; +enum { + ADD_REAL_DIRECTORY, + REMOVE_REAL_DIRECTORY, + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL]; + static void nautilus_merged_directory_initialize (gpointer object, gpointer klass); static void nautilus_merged_directory_initialize_class (gpointer klass); @@ -408,26 +416,6 @@ merged_is_not_empty (NautilusDirectory *directory) } static void -nautilus_merged_directory_initialize_class (gpointer klass) -{ - GtkObjectClass *object_class; - NautilusDirectoryClass *directory_class; - - object_class = GTK_OBJECT_CLASS (klass); - directory_class = NAUTILUS_DIRECTORY_CLASS (klass); - - object_class->destroy = merged_destroy; - - directory_class->contains_file = merged_contains_file; - directory_class->call_when_ready = merged_call_when_ready; - directory_class->cancel_callback = merged_cancel_callback; - directory_class->file_monitor_add = merged_file_monitor_add; - directory_class->file_monitor_remove = merged_file_monitor_remove; - directory_class->are_all_files_seen = merged_are_all_files_seen; - directory_class->is_not_empty = merged_is_not_empty; -} - -static void forward_files_added_cover (NautilusDirectory *real_directory, GList *files, NautilusMergedDirectory *merged) @@ -470,18 +458,14 @@ monitor_add_directory (gpointer key, monitor->force_reload); } -void -nautilus_merged_directory_add_real_directory (NautilusMergedDirectory *merged, - NautilusDirectory *real_directory) +static void +merged_add_real_directory (NautilusMergedDirectory *merged, + NautilusDirectory *real_directory) { g_return_if_fail (NAUTILUS_IS_MERGED_DIRECTORY (merged)); g_return_if_fail (NAUTILUS_IS_DIRECTORY (real_directory)); g_return_if_fail (!NAUTILUS_IS_MERGED_DIRECTORY (real_directory)); - - /* Quietly do nothing if asked to add something that's already there. */ - if (g_list_find (merged->details->directories, real_directory) != NULL) { - return; - } + g_return_if_fail (g_list_find (merged->details->directories, real_directory) == NULL); /* Add to our list of directories. */ nautilus_directory_ref (real_directory); @@ -515,6 +499,24 @@ nautilus_merged_directory_add_real_directory (NautilusMergedDirectory *merged, /* FIXME bugzilla.eazel.com 2541: Do we need to add the directory to callbacks too? */ } +void +nautilus_merged_directory_add_real_directory (NautilusMergedDirectory *merged, + NautilusDirectory *real_directory) +{ + g_return_if_fail (NAUTILUS_IS_MERGED_DIRECTORY (merged)); + g_return_if_fail (NAUTILUS_IS_DIRECTORY (real_directory)); + g_return_if_fail (!NAUTILUS_IS_MERGED_DIRECTORY (real_directory)); + + /* Quietly do nothing if asked to add something that's already there. */ + if (g_list_find (merged->details->directories, real_directory) != NULL) { + return; + } + + gtk_signal_emit (GTK_OBJECT (merged), + signals[ADD_REAL_DIRECTORY], + real_directory); +} + static void merged_callback_remove_directory_cover (gpointer key, gpointer value, @@ -533,17 +535,13 @@ monitor_remove_directory (gpointer key, (NAUTILUS_DIRECTORY (callback_data), value); } -void -nautilus_merged_directory_remove_real_directory (NautilusMergedDirectory *merged, - NautilusDirectory *real_directory) +static void +merged_remove_real_directory (NautilusMergedDirectory *merged, + NautilusDirectory *real_directory) { g_return_if_fail (NAUTILUS_IS_MERGED_DIRECTORY (merged)); g_return_if_fail (NAUTILUS_IS_DIRECTORY (real_directory)); - - /* Quietly do nothing if asked to remove something that's not there. */ - if (g_list_find (merged->details->directories, real_directory) == NULL) { - return; - } + g_return_if_fail (g_list_find (merged->details->directories, real_directory) != NULL); /* Remove this directory from callbacks and monitors. */ nautilus_g_hash_table_safe_for_each @@ -566,6 +564,22 @@ nautilus_merged_directory_remove_real_directory (NautilusMergedDirectory *merged nautilus_directory_unref (real_directory); } +void +nautilus_merged_directory_remove_real_directory (NautilusMergedDirectory *merged, + NautilusDirectory *real_directory) +{ + g_return_if_fail (NAUTILUS_IS_MERGED_DIRECTORY (merged)); + + /* Quietly do nothing if asked to remove something that's not there. */ + if (g_list_find (merged->details->directories, real_directory) == NULL) { + return; + } + + gtk_signal_emit (GTK_OBJECT (merged), + signals[REMOVE_REAL_DIRECTORY], + real_directory); +} + static void remove_all_real_directories (NautilusMergedDirectory *merged) { @@ -574,3 +588,47 @@ remove_all_real_directories (NautilusMergedDirectory *merged) (merged, merged->details->directories->data); } } + +static void +nautilus_merged_directory_initialize_class (gpointer klass) +{ + GtkObjectClass *object_class; + NautilusDirectoryClass *directory_class; + NautilusMergedDirectoryClass *merged_directory_class; + + object_class = GTK_OBJECT_CLASS (klass); + directory_class = NAUTILUS_DIRECTORY_CLASS (klass); + merged_directory_class = NAUTILUS_MERGED_DIRECTORY_CLASS (klass); + + object_class->destroy = merged_destroy; + + directory_class->contains_file = merged_contains_file; + directory_class->call_when_ready = merged_call_when_ready; + directory_class->cancel_callback = merged_cancel_callback; + directory_class->file_monitor_add = merged_file_monitor_add; + directory_class->file_monitor_remove = merged_file_monitor_remove; + directory_class->are_all_files_seen = merged_are_all_files_seen; + directory_class->is_not_empty = merged_is_not_empty; + + merged_directory_class->add_real_directory = merged_add_real_directory; + merged_directory_class->remove_real_directory = merged_remove_real_directory; + + signals[ADD_REAL_DIRECTORY] + = gtk_signal_new ("add_real_directory", + GTK_RUN_LAST, + object_class->type, + GTK_SIGNAL_OFFSET (NautilusMergedDirectoryClass, + add_real_directory), + gtk_marshal_NONE__POINTER, + GTK_TYPE_NONE, 1, GTK_TYPE_POINTER); + signals[REMOVE_REAL_DIRECTORY] + = gtk_signal_new ("remove_real_directory", + GTK_RUN_LAST, + object_class->type, + GTK_SIGNAL_OFFSET (NautilusMergedDirectoryClass, + remove_real_directory), + gtk_marshal_NONE__POINTER, + GTK_TYPE_NONE, 1, GTK_TYPE_POINTER); + + gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL); +} |