summaryrefslogtreecommitdiff
path: root/libnautilus-private/nautilus-vfs-directory.c
diff options
context:
space:
mode:
authorMike Engber <engber@src.gnome.org>2001-03-26 23:42:55 +0000
committerMike Engber <engber@src.gnome.org>2001-03-26 23:42:55 +0000
commit79f27024906630a9211add0c739287df47a4fb8f (patch)
treeea06bc1e3a430b0d32ffc52e03af4fd6ba22eeb5 /libnautilus-private/nautilus-vfs-directory.c
parentbf68fef5dcec3eab96890236c4f1e91f4fc8a849 (diff)
downloadnautilus-79f27024906630a9211add0c739287df47a4fb8f.tar.gz
reviewed by: Darin Adler <darin@eazel.com>
reviewed by: Darin Adler <darin@eazel.com> * libnautilus-extensions/nautilus-directory-async.c: (is_anyone_waiting_for_metafile), (call_ready_callbacks), (start_or_stop_io), (nautilus_directory_cancel): * libnautilus-extensions/nautilus-directory-metafile-monitor.c: (corba_metafile_ready): * libnautilus-extensions/nautilus-directory-metafile.c: (get_metafile), (nautilus_directory_rename_file_metadata), (nautilus_directory_rename_directory_metadata): * libnautilus-extensions/nautilus-directory-metafile.h: * libnautilus-extensions/nautilus-directory-private.h: * libnautilus-extensions/nautilus-directory.c: (nautilus_directory_initialize), (nautilus_directory_destroy), (set_directory_uri), (change_directory_uri), (nautilus_self_check_directory): * libnautilus-extensions/nautilus-directory.h: * libnautilus-extensions/nautilus-file-utilities.c: (nautilus_file_name_matches_backup_pattern), (nautilus_file_name_matches_metafile_pattern): * libnautilus-extensions/nautilus-file-utilities.h: * libnautilus-extensions/nautilus-file.c: (nautilus_file_is_metafile): * libnautilus-extensions/nautilus-file.h: * libnautilus-extensions/nautilus-metafile-factory.c: (corba_open): * libnautilus-extensions/nautilus-metafile-server.idl: * libnautilus-extensions/nautilus-metafile.c: (nautilus_metafile_class_init), (nautilus_metafile_init), (destroy), (construct_private_metafile_vfs_uri), (nautilus_metafile_set_directory_uri), (nautilus_metafile_new), (nautilus_metafile_get), (schedule_next_read), (async_read_start), (async_read_done), (async_read_cancel), (corba_is_read), (corba_get), (corba_get_list), (corba_set), (corba_set_list), (corba_copy), (corba_remove), (corba_rename), (corba_rename_directory), (corba_register_monitor), (corba_unregister_monitor), (nautilus_metafile_notify_metafile_ready), (call_metafile_changed), (call_metafile_changed_for_all_files_mentioned_in_metafile), (call_metafile_changed_for_one_file), (create_metafile_root), (get_file_node), (get_metadata_string_from_metafile), (get_metadata_list_from_metafile), (set_metadata_string_in_metafile), (set_metadata_list_in_metafile), (set_metadata_in_metafile), (get_metadata_string_from_table), (get_metadata_list_from_table), (set_metadata_eat_value), (metafile_free_metadata), (get_file_metadata), (get_file_metadata_list), (set_file_metadata), (set_file_metadata_list), (metafile_get_file_uri), (rename_file_metadata), (apply_one_change), (apply_file_changes), (nautilus_metafile_apply_pending_changes), (copy_file_metadata), (remove_file_metadata), (nautilus_metafile_set_metafile_contents), (metafile_read_cancel), (can_use_public_metafile), (metafile_read_mark_done), (metafile_read_done), (metafile_read_try_public_metafile), (metafile_read_check_for_directory_callback), (metafile_read_check_for_directory), (metafile_read_failed), (metafile_read_done_callback), (metafile_read_restart), (allow_metafile), (metafile_read_start), (metafile_write_done), (metafile_write_failed), (metafile_write_failure_close_callback), (metafile_write_success_close_callback), (metafile_write_callback), (metafile_write_create_callback), (metafile_write_start), (metafile_write), (metafile_write_idle_callback), (directory_request_write_metafile): * libnautilus-extensions/nautilus-metafile.h: * libnautilus-extensions/nautilus-vfs-directory.c: (vfs_is_not_empty): Factored the metadata reading/writing code out of nautilus-directory - bug 6661.
Diffstat (limited to 'libnautilus-private/nautilus-vfs-directory.c')
-rw-r--r--libnautilus-private/nautilus-vfs-directory.c38
1 files changed, 10 insertions, 28 deletions
diff --git a/libnautilus-private/nautilus-vfs-directory.c b/libnautilus-private/nautilus-vfs-directory.c
index 2b29388c4..27678d939 100644
--- a/libnautilus-private/nautilus-vfs-directory.c
+++ b/libnautilus-private/nautilus-vfs-directory.c
@@ -148,40 +148,22 @@ vfs_are_all_files_seen (NautilusDirectory *directory)
return directory->details->directory_loaded;
}
-static int
-any_non_metafile_item (gconstpointer item, gconstpointer callback_data)
-{
- /* A metafile is exactly what we are not looking for, anything else is a match. */
- return nautilus_file_matches_uri
- (NAUTILUS_FILE (item), (const char *) callback_data)
- ? 1 : 0;
-}
-
static gboolean
vfs_is_not_empty (NautilusDirectory *directory)
{
- char *public_metafile_uri;
- gboolean not_empty;
-
+ GList *node;
+
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->file_list != NULL;
- } else {
- public_metafile_uri = gnome_vfs_uri_to_string
- (directory->details->public_metafile_vfs_uri,
- GNOME_VFS_URI_HIDE_NONE);
-
- /* Return TRUE if the directory contains anything besides a metafile. */
- not_empty = g_list_find_custom (directory->details->file_list,
- public_metafile_uri,
- any_non_metafile_item) != NULL;
-
- g_free (public_metafile_uri);
+
+ for (node = directory->details->file_list; node != NULL; node = node->next) {
+ if (!nautilus_file_is_metafile (NAUTILUS_FILE (node->data))) {
+ /* Return TRUE if the directory contains anything besides a metafile. */
+ return TRUE;
+ }
}
-
- return not_empty;
+
+ return FALSE;
}
static void