summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog59
-rw-r--r--components/tree/nautilus-tree-change-queue.c2
-rw-r--r--libnautilus-private/nautilus-directory-async.c5
-rw-r--r--libnautilus-private/nautilus-directory-private.h1
-rw-r--r--libnautilus-private/nautilus-directory.c11
-rw-r--r--libnautilus-private/nautilus-directory.h5
-rw-r--r--libnautilus-private/nautilus-merged-directory.c4
-rw-r--r--libnautilus-private/nautilus-trash-file.c2
-rw-r--r--libnautilus-private/nautilus-vfs-directory.c2
-rw-r--r--libnautilus-private/nautilus-vfs-file.c2
-rw-r--r--src/file-manager/fm-directory-view.c2
-rw-r--r--src/nautilus-applicable-views.c27
-rw-r--r--src/nautilus-complex-search-bar.c4
13 files changed, 85 insertions, 41 deletions
diff --git a/ChangeLog b/ChangeLog
index 0a7553eba..76e98110c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,62 @@
+2001-05-11 Darin Adler <darin@eazel.com>
+
+ reviewed by: Yoann Vandoorselaere <yoann@mandrakesoft.com>
+
+ Yoann Vandoorselaere <yoann@mandrakesoft.com> discovered that the
+ code to load a directory was accidentally waiting for all the
+ files to be read in before displaying anything. This fixes the two
+ problems that caused that, but there are remaining loose ends
+ (it's not entirely clear why View As Music is still showing
+ properly in the View menu).
+
+ * libnautilus-private/nautilus-directory-private.h:
+ * libnautilus-private/nautilus-directory-async.c:
+ (nautilus_directory_call_when_ready_internal): Take a parameter to
+ say whether to wait for all the files in the file list, instead of
+ deducing it from other parameters.
+
+ * libnautilus-private/nautilus-directory.h:
+ * libnautilus-private/nautilus-directory.c:
+ (nautilus_directory_call_when_ready): Take a parameter to say
+ whether to wait for all the files in the file list, instead of
+ deducing it from other parameters.
+ (nautilus_self_check_directory): Pass TRUE so we wait for the file
+ list.
+
+ * libnautilus-private/nautilus-merged-directory.c:
+ (merged_call_when_ready): Pass through the new boolean.
+ * libnautilus-private/nautilus-trash-file.c:
+ (real_call_when_ready): Pass FALSE since there is no file list for
+ a single file.
+ * libnautilus-private/nautilus-vfs-directory.c:
+ (vfs_call_when_ready): Pass through the new boolean.
+ * libnautilus-private/nautilus-vfs-file.c:
+ (vfs_file_call_when_ready): Pass FALSE since there is no file list
+ for a single file.
+
+ * src/nautilus-applicable-views.c:
+ (nautilus_determine_initial_view),
+ (nautilus_determine_initial_view_cancel): Removed the code to get
+ full file attributes after getting the minimum required if
+ nautilus_mime_actions_file_needs_full_file_attributes return
+ TRUE. We want to make the choice fast, and it's OK if we choose
+ poorly as a result. The question is whether this will cause any
+ real end-user problems.
+
+ * src/file-manager/fm-directory-view.c:
+ (call_when_ready_on_scripts_directory): Pass TRUE so we read the
+ entire scripts directory.
+ (load_directory): Pass FALSE so we don't wait for all the files to
+ be loaded before starting to display them. This is the core of the
+ fix.
+
+ * components/tree/nautilus-tree-change-queue.c:
+ (nautilus_tree_change_queue_enqueue): A place where we can use
+ g_slist_prepend instead of g_slist_append.
+ * src/nautilus-complex-search-bar.c:
+ (nautilus_complex_search_bar_initialize): A place where we can use
+ g_slist_prepend instead of g_slist_append.
+
2001-05-10 John Sullivan <sullivan@eazel.com>
Made the thumbnail mechanism respect the "PUBLIC_METADATA"
diff --git a/components/tree/nautilus-tree-change-queue.c b/components/tree/nautilus-tree-change-queue.c
index 75fdb4da2..4a692d130 100644
--- a/components/tree/nautilus-tree-change-queue.c
+++ b/components/tree/nautilus-tree-change-queue.c
@@ -108,7 +108,7 @@ nautilus_tree_change_queue_enqueue (NautilusTreeChangeQueue *queue,
change = nautilus_tree_change_new (change_type, node);
if (queue->details->head == NULL) {
- queue->details->head = g_slist_append (NULL, change);
+ queue->details->head = g_slist_prepend (NULL, change);
queue->details->tail = queue->details->head;
} else {
g_slist_append (queue->details->tail, change);
diff --git a/libnautilus-private/nautilus-directory-async.c b/libnautilus-private/nautilus-directory-async.c
index 47085019f..d0387b100 100644
--- a/libnautilus-private/nautilus-directory-async.c
+++ b/libnautilus-private/nautilus-directory-async.c
@@ -1204,6 +1204,7 @@ void
nautilus_directory_call_when_ready_internal (NautilusDirectory *directory,
NautilusFile *file,
GList *file_attributes,
+ gboolean wait_for_file_list,
NautilusDirectoryCallback directory_callback,
NautilusFileCallback file_callback,
gpointer callback_data)
@@ -1224,7 +1225,7 @@ nautilus_directory_call_when_ready_internal (NautilusDirectory *directory,
}
callback.callback_data = callback_data;
nautilus_directory_set_up_request (&callback.request, file_attributes);
- callback.request.file_list = file == NULL && file_attributes != NULL;
+ callback.request.file_list = wait_for_file_list;
/* Handle the NULL case. */
if (directory == NULL) {
@@ -1267,7 +1268,7 @@ nautilus_directory_check_if_ready_internal (NautilusDirectory *directory,
nautilus_directory_set_up_request (&request, file_attributes);
return request_is_satisfied (directory, file, &request);
-}
+}
static void
remove_callback_link_keep_data (NautilusDirectory *directory,
diff --git a/libnautilus-private/nautilus-directory-private.h b/libnautilus-private/nautilus-directory-private.h
index 65ef808f5..7dec6d16e 100644
--- a/libnautilus-private/nautilus-directory-private.h
+++ b/libnautilus-private/nautilus-directory-private.h
@@ -120,6 +120,7 @@ void nautilus_directory_async_state_changed (NautilusD
void nautilus_directory_call_when_ready_internal (NautilusDirectory *directory,
NautilusFile *file,
GList *file_attributes,
+ gboolean wait_for_file_list,
NautilusDirectoryCallback directory_callback,
NautilusFileCallback file_callback,
gpointer callback_data);
diff --git a/libnautilus-private/nautilus-directory.c b/libnautilus-private/nautilus-directory.c
index 9d68a2d04..c4abdfd9d 100644
--- a/libnautilus-private/nautilus-directory.c
+++ b/libnautilus-private/nautilus-directory.c
@@ -27,6 +27,7 @@
#include "nautilus-directory-metafile.h"
#include "nautilus-directory-notify.h"
+#include "nautilus-file-attributes.h"
#include "nautilus-file-private.h"
#include "nautilus-file-utilities.h"
#include "nautilus-global-preferences.h"
@@ -1412,6 +1413,7 @@ nautilus_directory_get_file_uri (NautilusDirectory *directory,
void
nautilus_directory_call_when_ready (NautilusDirectory *directory,
GList *file_attributes,
+ gboolean wait_for_all_files,
NautilusDirectoryCallback callback,
gpointer callback_data)
{
@@ -1420,11 +1422,10 @@ nautilus_directory_call_when_ready (NautilusDirectory *directory,
EEL_CALL_METHOD
(NAUTILUS_DIRECTORY_CLASS, directory,
- call_when_ready, (directory, file_attributes,
+ call_when_ready, (directory, file_attributes, wait_for_all_files,
callback, callback_data));
}
-
void
nautilus_directory_cancel_callback (NautilusDirectory *directory,
NautilusDirectoryCallback callback,
@@ -1542,7 +1543,7 @@ nautilus_self_check_directory (void)
got_metadata_flag = FALSE;
attributes = g_list_prepend (NULL, NAUTILUS_FILE_ATTRIBUTE_METADATA);
- nautilus_directory_call_when_ready (directory, attributes,
+ nautilus_directory_call_when_ready (directory, attributes, TRUE,
got_metadata_callback, &data_dummy);
g_list_free (attributes);
@@ -1593,7 +1594,7 @@ nautilus_self_check_directory (void)
got_metadata_flag = FALSE;
attributes = g_list_prepend (NULL, NAUTILUS_FILE_ATTRIBUTE_METADATA);
- nautilus_directory_call_when_ready (directory, attributes,
+ nautilus_directory_call_when_ready (directory, attributes, TRUE,
got_metadata_callback, &data_dummy);
g_list_free (attributes);
@@ -1607,7 +1608,7 @@ nautilus_self_check_directory (void)
attributes = g_list_prepend (NULL, NAUTILUS_FILE_ATTRIBUTE_MIME_TYPE);
attributes = g_list_prepend (attributes, NAUTILUS_FILE_ATTRIBUTE_DEEP_COUNTS);
- nautilus_directory_call_when_ready (directory, attributes,
+ nautilus_directory_call_when_ready (directory, attributes, TRUE,
got_files_callback, &data_dummy);
g_list_free (attributes);
diff --git a/libnautilus-private/nautilus-directory.h b/libnautilus-private/nautilus-directory.h
index 7ec226dac..da2e308fc 100644
--- a/libnautilus-private/nautilus-directory.h
+++ b/libnautilus-private/nautilus-directory.h
@@ -114,6 +114,7 @@ typedef struct
NautilusFile *file);
void (* call_when_ready) (NautilusDirectory *directory,
GList *file_attributes,
+ gboolean wait_for_file_list,
NautilusDirectoryCallback callback,
gpointer callback_data);
void (* cancel_callback) (NautilusDirectory *directory,
@@ -162,15 +163,13 @@ char * nautilus_directory_get_file_uri (NautilusDirectory *director
/* Get (and ref) a NautilusFile object for this directory. */
NautilusFile * nautilus_directory_get_corresponding_file (NautilusDirectory *directory);
-
/* Waiting for data that's read asynchronously.
* The file attribute and metadata keys are for files in the directory.
- * If any file attributes or metadata keys are passed, it won't call
- * until all the files are seen.
*/
void nautilus_directory_call_when_ready (NautilusDirectory *directory,
GList *file_attributes,
+ gboolean wait_for_all_files,
NautilusDirectoryCallback callback,
gpointer callback_data);
void nautilus_directory_cancel_callback (NautilusDirectory *directory,
diff --git a/libnautilus-private/nautilus-merged-directory.c b/libnautilus-private/nautilus-merged-directory.c
index 0101938ab..5695cdd0a 100644
--- a/libnautilus-private/nautilus-merged-directory.c
+++ b/libnautilus-private/nautilus-merged-directory.c
@@ -46,6 +46,7 @@ typedef struct {
gpointer callback_data;
GList *wait_for_attributes;
+ gboolean wait_for_file_list;
GList *non_ready_directories;
GList *merged_file_list;
@@ -205,6 +206,7 @@ directory_ready_callback (NautilusDirectory *directory,
static void
merged_call_when_ready (NautilusDirectory *directory,
GList *file_attributes,
+ gboolean wait_for_file_list,
NautilusDirectoryCallback callback,
gpointer callback_data)
{
@@ -228,6 +230,7 @@ merged_call_when_ready (NautilusDirectory *directory,
merged_callback->callback = callback;
merged_callback->callback_data = callback_data;
merged_callback->wait_for_attributes = eel_g_str_list_copy (file_attributes);
+ merged_callback->wait_for_file_list = wait_for_file_list;
for (node = merged->details->directories; node != NULL; node = node->next) {
merged_callback->non_ready_directories = g_list_prepend
(merged_callback->non_ready_directories, node->data);
@@ -247,6 +250,7 @@ merged_call_when_ready (NautilusDirectory *directory,
nautilus_directory_call_when_ready
(node->data,
merged_callback->wait_for_attributes,
+ merged_callback->wait_for_file_list,
directory_ready_callback, merged_callback);
}
}
diff --git a/libnautilus-private/nautilus-trash-file.c b/libnautilus-private/nautilus-trash-file.c
index b4f33a439..a1206ccbc 100644
--- a/libnautilus-private/nautilus-trash-file.c
+++ b/libnautilus-private/nautilus-trash-file.c
@@ -146,7 +146,7 @@ real_call_when_ready (NautilusFile *file,
{
nautilus_directory_call_when_ready_internal
(file->details->directory, file,
- attributes, NULL, callback, callback_data);
+ attributes, FALSE, NULL, callback, callback_data);
}
static void
diff --git a/libnautilus-private/nautilus-vfs-directory.c b/libnautilus-private/nautilus-vfs-directory.c
index 07eb8d0d0..8154123c2 100644
--- a/libnautilus-private/nautilus-vfs-directory.c
+++ b/libnautilus-private/nautilus-vfs-directory.c
@@ -71,6 +71,7 @@ vfs_contains_file (NautilusDirectory *directory,
static void
vfs_call_when_ready (NautilusDirectory *directory,
GList *file_attributes,
+ gboolean wait_for_file_list,
NautilusDirectoryCallback callback,
gpointer callback_data)
{
@@ -80,6 +81,7 @@ vfs_call_when_ready (NautilusDirectory *directory,
(directory,
NULL,
file_attributes,
+ wait_for_file_list,
callback,
NULL,
callback_data);
diff --git a/libnautilus-private/nautilus-vfs-file.c b/libnautilus-private/nautilus-vfs-file.c
index 28f33d2f0..035a53f28 100644
--- a/libnautilus-private/nautilus-vfs-file.c
+++ b/libnautilus-private/nautilus-vfs-file.c
@@ -69,7 +69,7 @@ vfs_file_call_when_ready (NautilusFile *file,
{
nautilus_directory_call_when_ready_internal
(file->details->directory, file,
- file_attributes, NULL, callback, callback_data);
+ file_attributes, FALSE, NULL, callback, callback_data);
}
static void
diff --git a/src/file-manager/fm-directory-view.c b/src/file-manager/fm-directory-view.c
index 1c35243a5..e2c349640 100644
--- a/src/file-manager/fm-directory-view.c
+++ b/src/file-manager/fm-directory-view.c
@@ -3639,6 +3639,7 @@ call_when_ready_on_scripts_directory (FMDirectoryView *view,
attributes = g_list_prepend (attributes, NAUTILUS_FILE_ATTRIBUTE_DIRECTORY_ITEM_COUNT);
nautilus_directory_call_when_ready (view->details->scripts_directory,
attributes,
+ TRUE,
scripts_directory_callback,
view);
g_list_free (attributes);
@@ -4715,6 +4716,7 @@ load_directory (FMDirectoryView *view,
nautilus_directory_call_when_ready
(view->details->model,
attributes,
+ FALSE,
metadata_for_files_in_directory_ready_callback, view);
g_list_free (attributes);
diff --git a/src/nautilus-applicable-views.c b/src/nautilus-applicable-views.c
index 7c854958c..4832255aa 100644
--- a/src/nautilus-applicable-views.c
+++ b/src/nautilus-applicable-views.c
@@ -135,29 +135,6 @@ got_file_info_callback (NautilusFile *file,
nautilus_determine_initial_view_cancel (handle);
}
-static void
-got_minimum_file_info_callback (NautilusFile *file,
- gpointer callback_data)
-{
- NautilusDetermineViewHandle *handle;
- GList *attributes;
-
- handle = (NautilusDetermineViewHandle *) callback_data;
-
- g_assert (handle->file == file);
-
- if (nautilus_mime_actions_file_needs_full_file_attributes (file)
- && nautilus_file_get_file_info_result (file) == GNOME_VFS_OK) {
- attributes = nautilus_mime_actions_get_full_file_attributes ();
- nautilus_file_call_when_ready (file, attributes,
- got_file_info_callback,
- handle);
- g_list_free (attributes);
- } else {
- got_file_info_callback (file, handle);
- }
-}
-
NautilusDetermineViewHandle *
nautilus_determine_initial_view (const char *location,
NautilusDetermineViewCallback callback,
@@ -180,7 +157,7 @@ nautilus_determine_initial_view (const char *location,
attributes = nautilus_mime_actions_get_minimum_file_attributes ();
nautilus_file_call_when_ready (handle->file, attributes,
- got_minimum_file_info_callback, handle);
+ got_file_info_callback, handle);
g_list_free (attributes);
if (handle != NULL) {
@@ -203,8 +180,6 @@ nautilus_determine_initial_view_cancel (NautilusDetermineViewHandle *handle)
}
nautilus_file_cancel_call_when_ready
- (handle->file, got_minimum_file_info_callback, handle);
- nautilus_file_cancel_call_when_ready
(handle->file, got_file_info_callback, handle);
nautilus_file_unref (handle->file);
diff --git a/src/nautilus-complex-search-bar.c b/src/nautilus-complex-search-bar.c
index e5d1de0c3..cd045db6b 100644
--- a/src/nautilus-complex-search-bar.c
+++ b/src/nautilus-complex-search-bar.c
@@ -210,8 +210,8 @@ nautilus_complex_search_bar_initialize (NautilusComplexSearchBar *bar)
"criterion_type_changed",
search_bar_criterion_type_changed_callback,
(gpointer) bar);
- bar->details->search_criteria = g_slist_append (NULL,
- file_name_criterion);
+ bar->details->search_criteria = g_slist_prepend (NULL,
+ file_name_criterion);
nautilus_search_bar_criterion_show (file_name_criterion);
attach_criterion_to_search_bar (bar, file_name_criterion, 1);