Commit 784a8062 authored by Darin Adler's avatar Darin Adler

Bump version to 1.0.4.1

	* configure.in: Bump version to 1.0.4.1

	* cut-n-paste-code/widgets/e-paned/e-paned.c: (e_paned_expose):
	Fix type cast that was causing Ben trouble compiling on Solaris.

	Take a cut at removing the problem where opening a new window
	causes all the old windows to act as if all items were re-added.

	* libnautilus-private/nautilus-directory.h:
	* libnautilus-private/nautilus-directory.c:
	(nautilus_directory_file_monitor_add),
	(nautilus_self_check_directory):
	* libnautilus-private/nautilus-directory-async.c:
	(nautilus_directory_monitor_add_internal):
	* libnautilus-private/nautilus-directory-private.h:
	* libnautilus-private/nautilus-merged-directory.c:
	(build_merged_callback_list), (merged_file_monitor_add),
	(forward_files_added_cover), (forward_files_changed_cover),
	(monitor_add_directory), (merged_add_real_directory):
	* libnautilus-private/nautilus-trash-file.c: (real_monitor_add):
	* libnautilus-private/nautilus-trash-monitor.c:
	(nautilus_trash_monitor_initialize):
	* libnautilus-private/nautilus-vfs-directory.c:
	(vfs_file_monitor_add):
	* libnautilus-private/nautilus-vfs-file.c: (vfs_file_monitor_add):
	Change monitor_add to take a parameter for a callback function, and
	call that instead of sending out a files_added message when someone
	starts monitoring files.

	* components/tree/nautilus-tree-model.c:
	(nautilus_tree_model_node_begin_monitoring_no_connect),
	(nautilus_tree_model_node_begin_monitoring),
	(nautilus_tree_model_directory_files_changed_callback):
	* src/file-manager/fm-directory-view.c: (connect_script_handlers),
	(finish_loading):
	Pass in a callback function to monitor_add, and don't hook up the
	files_added and files_changed signals until after the monitor is
	added.
parent 715bfddb
2001-07-05 Darin Adler <darin@bentspoon.com>
* configure.in: Bump version to 1.0.4.1
* cut-n-paste-code/widgets/e-paned/e-paned.c: (e_paned_expose):
Fix type cast that was causing Ben trouble compiling on Solaris.
Take a cut at removing the problem where opening a new window
causes all the old windows to act as if all items were re-added.
* libnautilus-private/nautilus-directory.h:
* libnautilus-private/nautilus-directory.c:
(nautilus_directory_file_monitor_add),
(nautilus_self_check_directory):
* libnautilus-private/nautilus-directory-async.c:
(nautilus_directory_monitor_add_internal):
* libnautilus-private/nautilus-directory-private.h:
* libnautilus-private/nautilus-merged-directory.c:
(build_merged_callback_list), (merged_file_monitor_add),
(forward_files_added_cover), (forward_files_changed_cover),
(monitor_add_directory), (merged_add_real_directory):
* libnautilus-private/nautilus-trash-file.c: (real_monitor_add):
* libnautilus-private/nautilus-trash-monitor.c:
(nautilus_trash_monitor_initialize):
* libnautilus-private/nautilus-vfs-directory.c:
(vfs_file_monitor_add):
* libnautilus-private/nautilus-vfs-file.c: (vfs_file_monitor_add):
Change monitor_add to take a parameter for a callback function, and
call that instead of sending out a files_added message when someone
starts monitoring files.
* components/tree/nautilus-tree-model.c:
(nautilus_tree_model_node_begin_monitoring_no_connect),
(nautilus_tree_model_node_begin_monitoring),
(nautilus_tree_model_directory_files_changed_callback):
* src/file-manager/fm-directory-view.c: (connect_script_handlers),
(finish_loading):
Pass in a callback function to monitor_add, and don't hook up the
files_added and files_changed signals until after the monitor is
added.
=== Nautilus 1.0.4 ===
2001-07-05 Darin Adler <darin@bentspoon.com>
......
......@@ -87,7 +87,7 @@ static void nautilus_tree_model_root_node_file_monitor (NautilusFile
NautilusTreeModel *model);
static void nautilus_tree_model_directory_files_changed_callback (NautilusDirectory *directory,
GList *added_files,
NautilusTreeModel *model);
gpointer callback_data);
static void nautilus_tree_model_directory_done_loading_callback (NautilusDirectory *directory,
NautilusTreeModel *model);
......@@ -416,7 +416,9 @@ nautilus_tree_model_node_begin_monitoring_no_connect (NautilusTreeModel
nautilus_directory_file_monitor_add (directory,
model,
TRUE, TRUE,
monitor_attributes);
monitor_attributes,
nautilus_tree_model_directory_files_changed_callback,
model);
g_list_free (monitor_attributes);
}
......@@ -428,10 +430,17 @@ nautilus_tree_model_node_begin_monitoring (NautilusTreeModel *model,
gboolean force_reload)
{
NautilusDirectory *directory;
directory = nautilus_tree_node_get_directory (node);
/* we must connect to signals */
node->details->done_loading_id = gtk_signal_connect
(GTK_OBJECT (directory),
"done_loading",
nautilus_tree_model_directory_done_loading_callback,
model);
nautilus_tree_model_node_begin_monitoring_no_connect (model, node, force_reload);
node->details->files_added_id = gtk_signal_connect
(GTK_OBJECT (directory),
"files_added",
......@@ -442,15 +451,7 @@ nautilus_tree_model_node_begin_monitoring (NautilusTreeModel *model,
(GTK_OBJECT (directory),
"files_changed",
nautilus_tree_model_directory_files_changed_callback,
model);
node->details->done_loading_id = gtk_signal_connect
(GTK_OBJECT (directory),
"done_loading",
nautilus_tree_model_directory_done_loading_callback,
model);
nautilus_tree_model_node_begin_monitoring_no_connect (model, node, force_reload);
model);
}
static void
......@@ -942,15 +943,18 @@ add_file_to_hash (GHashTable *hash,
}
static void
nautilus_tree_model_directory_files_changed_callback (NautilusDirectory *directory,
GList *changed_files,
NautilusTreeModel *model)
nautilus_tree_model_directory_files_changed_callback (NautilusDirectory *directory,
GList *changed_files,
gpointer callback_data)
{
GList *p;
NautilusTreeModel *model;
GList *node;
NautilusFile *file;
for (p = changed_files; p != NULL; p = p->next) {
file = NAUTILUS_FILE (p->data);
model = NAUTILUS_TREE_MODEL (callback_data);
for (node = changed_files; node != NULL; node = node->next) {
file = NAUTILUS_FILE (node->data);
if (model->details->changed_files != NULL) {
add_file_to_hash (model->details->changed_files, file);
......
......@@ -48,7 +48,7 @@ if test -n "$GNOME2_PATH"; then
export PATH
fi
AM_INIT_AUTOMAKE(nautilus, 1.0.4)
AM_INIT_AUTOMAKE(nautilus, 1.0.4.1)
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE
......
......@@ -325,7 +325,7 @@ e_paned_expose (GtkWidget *widget,
GdkEventExpose *event)
{
EPaned *paned;
GdkEventExpose child_event;
GdkEvent child_event;
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (E_IS_PANED (widget), FALSE);
......@@ -339,7 +339,6 @@ e_paned_expose (GtkWidget *widget,
{
if (e_paned_handle_shown(paned))
{
child_event = *event;
event->area.x += paned->handle_xpos;
event->area.y += paned->handle_ypos;
gtk_widget_draw (widget, &event->area);
......@@ -347,16 +346,16 @@ e_paned_expose (GtkWidget *widget,
}
else
{
child_event = *event;
child_event.expose = *event;
if (paned->child1 &&
GTK_WIDGET_NO_WINDOW (paned->child1) &&
gtk_widget_intersect (paned->child1, &event->area, &child_event.area))
gtk_widget_event (paned->child1, (GdkEvent *) &child_event);
gtk_widget_intersect (paned->child1, &event->area, &child_event.expose.area))
gtk_widget_event (paned->child1, &child_event);
if (paned->child2 &&
GTK_WIDGET_NO_WINDOW (paned->child2) &&
gtk_widget_intersect (paned->child2, &event->area, &child_event.area))
gtk_widget_event (paned->child2, (GdkEvent *) &child_event);
gtk_widget_intersect (paned->child2, &event->area, &child_event.expose.area))
gtk_widget_event (paned->child2, &child_event);
}
}
......
......@@ -592,7 +592,9 @@ nautilus_directory_monitor_add_internal (NautilusDirectory *directory,
gconstpointer client,
gboolean monitor_hidden_files,
gboolean monitor_backup_files,
GList *file_attributes)
GList *file_attributes,
NautilusDirectoryCallback callback,
gpointer callback_data)
{
Monitor *monitor;
GList *file_list;
......@@ -615,17 +617,10 @@ nautilus_directory_monitor_add_internal (NautilusDirectory *directory,
directory->details->monitor_list =
g_list_prepend (directory->details->monitor_list, monitor);
/* Re-send the "files_added" signal for this set of files.
* Old monitorers already know about them, but it's harmless
* to hear about the same files again.
*/
if (file == NULL) {
if (callback != NULL) {
file_list = get_non_tentative_file_list (directory);
if (file_list != NULL) {
nautilus_directory_emit_files_added
(directory, file_list);
nautilus_file_list_free (file_list);
}
(* callback) (directory, file_list, callback_data);
nautilus_file_list_free (file_list);
}
/* Start the "real" monitoring (FAM or whatever). */
......
......@@ -137,7 +137,9 @@ void nautilus_directory_monitor_add_internal (NautilusD
gconstpointer client,
gboolean monitor_hidden_files,
gboolean monitor_backup_files,
GList *attributes);
GList *attributes,
NautilusDirectoryCallback callback,
gpointer callback_data);
void nautilus_directory_monitor_remove_internal (NautilusDirectory *directory,
NautilusFile *file,
gconstpointer client);
......
......@@ -1444,7 +1444,9 @@ nautilus_directory_file_monitor_add (NautilusDirectory *directory,
gconstpointer client,
gboolean monitor_hidden_files,
gboolean monitor_backup_files,
GList *file_attributes)
GList *file_attributes,
NautilusDirectoryCallback callback,
gpointer callback_data)
{
g_return_if_fail (NAUTILUS_IS_DIRECTORY (directory));
g_return_if_fail (client != NULL);
......@@ -1454,7 +1456,8 @@ nautilus_directory_file_monitor_add (NautilusDirectory *directory,
file_monitor_add, (directory, client,
monitor_hidden_files,
monitor_backup_files,
file_attributes));
file_attributes,
callback, callback_data));
}
void
......@@ -1538,7 +1541,7 @@ nautilus_self_check_directory (void)
nautilus_directory_file_monitor_add
(directory, &data_dummy,
TRUE, TRUE, NULL);
TRUE, TRUE, NULL, NULL, NULL);
got_metadata_flag = FALSE;
......
......@@ -124,7 +124,9 @@ typedef struct
gconstpointer client,
gboolean monitor_hidden_files,
gboolean monitor_backup_files,
GList *monitor_attributes);
GList *monitor_attributes,
NautilusDirectoryCallback initial_files_callback,
gpointer callback_data);
void (* file_monitor_remove) (NautilusDirectory *directory,
gconstpointer client);
void (* force_reload) (NautilusDirectory *directory);
......@@ -182,7 +184,9 @@ void nautilus_directory_file_monitor_add (NautilusDirector
gconstpointer client,
gboolean monitor_hidden_files,
gboolean monitor_backup_files,
GList *attributes);
GList *attributes,
NautilusDirectoryCallback initial_files_callback,
gpointer callback_data);
void nautilus_directory_file_monitor_remove (NautilusDirectory *directory,
gconstpointer client);
void nautilus_directory_force_reload (NautilusDirectory *directory);
......
......@@ -286,17 +286,32 @@ merged_cancel_callback (NautilusDirectory *directory,
merged_callback_destroy (merged_callback);
}
static void
build_merged_callback_list (NautilusDirectory *directory,
GList *file_list,
gpointer callback_data)
{
GList **merged_list;
merged_list = callback_data;
*merged_list = g_list_concat (*merged_list,
nautilus_file_list_copy (file_list));
}
/* Create a monitor on each of the directories in the list. */
static void
merged_file_monitor_add (NautilusDirectory *directory,
gconstpointer client,
gboolean monitor_hidden_files,
gboolean monitor_backup_files,
GList *file_attributes)
GList *file_attributes,
NautilusDirectoryCallback callback,
gpointer callback_data)
{
NautilusMergedDirectory *merged;
MergedMonitor *monitor;
GList *node;
GList *merged_callback_list;
merged = NAUTILUS_MERGED_DIRECTORY (directory);
......@@ -318,12 +333,18 @@ merged_file_monitor_add (NautilusDirectory *directory,
monitor->monitor_attributes = eel_g_str_list_copy (file_attributes);
/* Call through to the real directory add calls. */
merged_callback_list = NULL;
for (node = merged->details->directories; node != NULL; node = node->next) {
nautilus_directory_file_monitor_add
(node->data, monitor,
monitor_hidden_files, monitor_backup_files,
file_attributes);
file_attributes,
build_merged_callback_list, &merged_callback_list);
}
if (callback != NULL) {
(* callback) (directory, merged_callback_list, callback_data);
}
nautilus_file_list_free (merged_callback_list);
}
/* Remove the monitor from each of the directories in the list. */
......@@ -423,17 +444,17 @@ merged_is_not_empty (NautilusDirectory *directory)
static void
forward_files_added_cover (NautilusDirectory *real_directory,
GList *files,
NautilusMergedDirectory *merged)
gpointer callback_data)
{
nautilus_directory_emit_files_added (NAUTILUS_DIRECTORY (merged), files);
nautilus_directory_emit_files_added (NAUTILUS_DIRECTORY (callback_data), files);
}
static void
forward_files_changed_cover (NautilusDirectory *real_directory,
GList *files,
NautilusMergedDirectory *merged)
gpointer callback_data)
{
nautilus_directory_emit_files_changed (NAUTILUS_DIRECTORY (merged), files);
nautilus_directory_emit_files_changed (NAUTILUS_DIRECTORY (callback_data), files);
}
static void
......@@ -459,7 +480,8 @@ monitor_add_directory (gpointer key,
(NAUTILUS_DIRECTORY (callback_data), monitor,
monitor->monitor_hidden_files,
monitor->monitor_backup_files,
monitor->monitor_attributes);
monitor->monitor_attributes,
forward_files_added_cover, monitor->merged);
}
static void
......@@ -478,15 +500,6 @@ merged_add_real_directory (NautilusMergedDirectory *merged,
merged->details->directories_not_done_loading = g_list_prepend
(merged->details->directories_not_done_loading, real_directory);
/* Connect signals. */
gtk_signal_connect (GTK_OBJECT (real_directory),
"files_added",
forward_files_added_cover,
merged);
gtk_signal_connect (GTK_OBJECT (real_directory),
"files_changed",
forward_files_changed_cover,
merged);
gtk_signal_connect (GTK_OBJECT (real_directory),
"done_loading",
done_loading_callback,
......@@ -501,6 +514,15 @@ merged_add_real_directory (NautilusMergedDirectory *merged,
monitor_add_directory,
real_directory);
/* FIXME bugzilla.eazel.com 2541: Do we need to add the directory to callbacks too? */
gtk_signal_connect (GTK_OBJECT (real_directory),
"files_added",
forward_files_added_cover,
merged);
gtk_signal_connect (GTK_OBJECT (real_directory),
"files_changed",
forward_files_changed_cover,
merged);
}
void
......
......@@ -126,7 +126,7 @@ real_monitor_add (NautilusFile *file,
{
nautilus_directory_monitor_add_internal
(file->details->directory, file,
client, TRUE, TRUE, attributes);
client, TRUE, TRUE, attributes, NULL, NULL);
}
static void
......
......@@ -139,7 +139,8 @@ nautilus_trash_monitor_initialize (gpointer object, gpointer klass)
/* Make sure we get notified about changes */
nautilus_directory_file_monitor_add
(trash_directory, trash_monitor, TRUE, TRUE, attributes);
(trash_directory, trash_monitor, TRUE, TRUE, attributes,
nautilus_trash_files_changed_callback, trash_monitor);
g_list_free (attributes);
......
......@@ -107,7 +107,9 @@ vfs_file_monitor_add (NautilusDirectory *directory,
gconstpointer client,
gboolean monitor_hidden_files,
gboolean monitor_backup_files,
GList *file_attributes)
GList *file_attributes,
NautilusDirectoryCallback callback,
gpointer callback_data)
{
g_assert (NAUTILUS_IS_VFS_DIRECTORY (directory));
g_assert (client != NULL);
......@@ -117,7 +119,8 @@ vfs_file_monitor_add (NautilusDirectory *directory,
client,
monitor_hidden_files,
monitor_backup_files,
file_attributes);
file_attributes,
callback, callback_data);
}
static void
......
......@@ -39,8 +39,8 @@ static void nautilus_vfs_file_initialize (gpointer object,
static void nautilus_vfs_file_initialize_class (gpointer klass);
EEL_DEFINE_CLASS_BOILERPLATE (NautilusVFSFile,
nautilus_vfs_file,
NAUTILUS_TYPE_FILE)
nautilus_vfs_file,
NAUTILUS_TYPE_FILE)
static void
vfs_file_monitor_add (NautilusFile *file,
......@@ -49,7 +49,7 @@ vfs_file_monitor_add (NautilusFile *file,
{
nautilus_directory_monitor_add_internal
(file->details->directory, file,
client, TRUE, TRUE, attributes);
client, TRUE, TRUE, attributes, NULL, NULL);
}
static void
......
......@@ -1122,7 +1122,8 @@ connect_script_handlers (FMDirectoryView *view)
nautilus_directory_file_monitor_add (view->details->scripts_directory,
&view->details->scripts_directory,
FALSE, FALSE, NULL);
FALSE, FALSE, NULL,
scripts_added_or_changed_callback, view);
view->details->scripts_added_handler_id = gtk_signal_connect
(GTK_OBJECT (view->details->scripts_directory),
......@@ -4736,31 +4737,19 @@ finish_loading (FMDirectoryView *view)
/* Start loading. */
/* Connect handlers to see files as they are added. */
view->details->files_added_handler_id = gtk_signal_connect
(GTK_OBJECT (view->details->model),
"files_added",
files_added_callback,
view);
view->details->files_changed_handler_id = gtk_signal_connect
(GTK_OBJECT (view->details->model),
"files_changed",
files_changed_callback,
view);
/* Connect handlers to learn about loading progress. */
view->details->done_loading_handler_id = gtk_signal_connect
(GTK_OBJECT (view->details->model),
"done_loading",
done_loading_callback,
view);
done_loading_callback, view);
view->details->load_error_handler_id = gtk_signal_connect
(GTK_OBJECT (view->details->model),
"load_error",
load_error_callback,
view);
load_error_callback, view);
/* Monitor the things needed to get the right
* icon. Also monitor a directory's item count because
* the "size" attribute is based on that, and the file's metadata.
/* Monitor the things needed to get the right icon. Also
* monitor a directory's item count because the "size"
* attribute is based on that, and the file's metadata.
*/
attributes = nautilus_icon_factory_get_required_file_attributes ();
attributes = g_list_prepend (attributes,
......@@ -4774,9 +4763,19 @@ finish_loading (FMDirectoryView *view)
&view->details->model,
view->details->show_hidden_files,
view->details->show_backup_files,
attributes);
attributes,
files_added_callback, view);
g_list_free (attributes);
view->details->files_added_handler_id = gtk_signal_connect
(GTK_OBJECT (view->details->model),
"files_added",
files_added_callback, view);
view->details->files_changed_handler_id = gtk_signal_connect
(GTK_OBJECT (view->details->model),
"files_changed",
files_changed_callback, view);
}
static void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment