Re: [Owen Taylor <otaylor redhat com>] [Nautilus-list] Build patch for recent GLib/GTK+ changes



Hi Owen,

On 21 Nov 2001, Owen Taylor wrote:
> Hmm, it doesn't look like you are on nautilus-list. I mailed this to
> nautilus-list yesterday and it looks like it collides with your recent
> checkin

        Gack - that's bad. Sorry about that; now subscribed to the list,
I've merged up vs. your patch - and yes; there were an astonishing set of
cockups in that commit, sigh.
        
        Here's the final result;       
        
        Apologies,
  
                Michael.

? darin
? intl
? type.list
? nautilus-config
? nautilus-installer.spec
? helper-utilities/error-dialog/nautilus-error-dialog
? helper-utilities/xml-migrate/nautilus-xml-migrate
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/nautilus/ChangeLog,v
retrieving revision 1.4851
diff -u -p -u -r1.4851 ChangeLog
--- ChangeLog	2001/11/21 08:34:54	1.4851
+++ ChangeLog	2001/11/22 05:48:42
@@ -1,3 +1,37 @@
+2001-11-22  Michael Meeks  <michael ximian com>
+
+	* libnautilus-private/nautilus-icon-container.c
+	(nautilus_icon_container_class_init): fix marshaller.
+
+	* libnautilus-private/nautilus-marshal.list: add
+	INT_POINTER_BOOLEAN
+	
+	* src/file-manager/fm-properties-window.c
+	(real_destroy): protect against double destroys.
+
+Tue Nov 20 21:45:43 2001  Owen Taylor  <otaylor redhat com>
+
+	* configure.in: Add [quoting] around AC_CHECK_HEADERS needed for 
+	some autoconf versions.
+	
+	* components/text/nautilus-text-view.c (file_read_callback): 
+	text_view->details->text_display is set to NULL in
+	nautilus_text_view_destroy(), so simply check for non-NULL
+	rather than calling GTK_OBJECT_DESTROYED().
+
+	* src/file-manager/fm-properties-window.c (real_destroy): NULL
+	out name_field here, since it will be destroyed, so we
+	can avoid accessing it in rename_callback.
+
+	* libnautilus-private/Makefile.am (nautilus-marshal-guts.c): Get rid
+	of nautilus-marshal-guts.h, since glib-genmarshal now generates correct
+	standalone headers.
+
+	* libnautilus/nautilus-clipboard.c (select_all_callback),
+	* libnautilus-private/nautilus-entry.c (nautilus_entry_select_all_at_idle):
+	Remove the idle on destrunction of the widget, rather than checking
+	GTK_OBJECT_DESTROYED().
+
 2001-11-21  Michael Meeks  <michael ximian com>
 
 	* test/test-nautilus-wrap-table.c (main): fix.
Index: configure.in
===================================================================
RCS file: /cvs/gnome/nautilus/configure.in,v
retrieving revision 1.384
diff -u -p -u -r1.384 configure.in
--- configure.in	2001/11/12 07:00:31	1.384
+++ configure.in	2001/11/22 05:48:44
@@ -127,10 +127,10 @@ dnl FAM
 FAM_MISSING_WARNING="Nautilus depends on FAM to provide notification when files are altered (either through filesystem polling, or a kernel notification mechanism). If Nautilus is built without FAM support, directories viewed with Nautilus will not remain in synch with the actual filesystem when they are altered by external processes. Particularly if you are a distributor please compile Nautilus with FAM support. FAM is available from http://oss.sgi.com/projects/fam/. A patch to add Linux Kernel 2.4 directory notify support to FAM (highly desirable) is available from http://people.redhat.com/alexl/files/";
 FAM_LIBS=
 AC_CHECK_LIB(fam, FAMOpen,
-  AC_CHECK_HEADERS(fam.h,
+  [AC_CHECK_HEADERS(fam.h,
     [AC_DEFINE(HAVE_LIBFAM)
      FAM_LIBS="-lfam"],
-    AC_MSG_WARN(*** FAM support will not be built (header files not found) $FAM_MISSING_WARNING ***)),
+    AC_MSG_WARN(*** FAM support will not be built (header files not found) $FAM_MISSING_WARNING ***))],
   AC_MSG_WARN(*** FAM support will not be built (FAM library not found) $FAM_MISSING_WARNING ***))
 AC_SUBST(FAM_LIBS)
 
@@ -415,9 +415,9 @@ dnl libpng
 
   if test -z "$LIBPNG"; then
     AC_CHECK_LIB(png, png_read_info,
-      AC_CHECK_HEADER(png.h,
+      [AC_CHECK_HEADER(png.h,
         png_ok=yes,
-        png_ok=no),
+        png_ok=no)],
       AC_MSG_ERROR(*** (PNG library not found) ***), -lz -lm)
     if test "$png_ok" = yes; then
       AC_MSG_CHECKING([for png_structp in png.h])
@@ -444,9 +444,9 @@ dnl libjpeg
 
   if test -z "$LIBJPEG"; then
     AC_CHECK_LIB(jpeg, jpeg_start_decompress,
-      AC_CHECK_HEADER(jpeglib.h,
+      [AC_CHECK_HEADER(jpeglib.h,
         jpeg_ok=yes,
-        jpeg_ok=no),
+        jpeg_ok=no)],
       AC_MSG_WARN(*** (jpeg library not found) ***), -lm)
     if test "$jpeg_ok" = yes; then
       JPEG='jpeg'; LIBJPEG='-ljpeg'
Index: components/text/nautilus-text-view.c
===================================================================
RCS file: /cvs/gnome/nautilus/components/text/nautilus-text-view.c,v
retrieving revision 1.42
diff -u -p -u -r1.42 nautilus-text-view.c
--- components/text/nautilus-text-view.c	2001/11/21 06:14:48	1.42
+++ components/text/nautilus-text-view.c	2001/11/22 05:48:48
@@ -324,16 +324,18 @@ file_read_callback (GnomeVFSAsyncHandle 
 
 	/* at EOF, bytes_read is 0 and result is GNOME_VFS_OK */
 	if (result == GNOME_VFS_OK && bytes_read > 0) {
-		/* write the buffer into the text field */
-                display = GTK_TEXT (text_view->details->text_display);
-                
-                gtk_text_freeze (display);
-                gtk_text_set_point (display,
-                                    gtk_text_get_length (display));
-                gtk_text_insert (display,
-                                 NULL, NULL, NULL,
-                                 buffer, bytes_read);
-                gtk_text_thaw (display);
+                if (text_view->details->text_display != NULL) {
+                        /* write the buffer into the text field */
+                        display = GTK_TEXT (text_view->details->text_display);
+                        
+                        gtk_text_freeze (display);
+                        gtk_text_set_point (display,
+                                            gtk_text_get_length (display));
+                        gtk_text_insert (display,
+                                         NULL, NULL, NULL,
+                                         buffer, bytes_read);
+                        gtk_text_thaw (display);
+                }
                 
 		/* read more if necessary */		
 		if (text_view->details->file_size < MAX_FILE_SIZE) {
Index: libnautilus/nautilus-clipboard.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus/nautilus-clipboard.c,v
retrieving revision 1.34
diff -u -p -u -r1.34 nautilus-clipboard.c
--- libnautilus/nautilus-clipboard.c	2001/11/21 06:14:49	1.34
+++ libnautilus/nautilus-clipboard.c	2001/11/22 05:48:52
@@ -105,8 +105,6 @@ select_all_idle_callback (gpointer callb
 
 	select_all (editable);
 
-	g_object_unref (G_OBJECT (editable));
-
 	return FALSE;
 }
 
@@ -115,14 +113,20 @@ select_all_callback (BonoboUIComponent *
 		     gpointer callback_data,
 		     const char *command_name)
 {
+	GSource *source;
 	GtkEditable *editable;
 
 	g_assert (BONOBO_IS_UI_COMPONENT (ui));
 	g_assert (strcmp (command_name, "Select All") == 0);
 
 	editable = GTK_EDITABLE (callback_data);
-	g_object_ref (G_OBJECT (editable));
-	gtk_idle_add (select_all_idle_callback, editable);
+
+	source = g_idle_source_new ();
+	g_source_set_callback (source, select_all_idle_callback, editable, NULL);
+	g_signal_connect_swapped (editable, "destroy",
+				  G_CALLBACK (g_source_destroy), source);
+	g_source_attach (source, NULL);
+	g_source_unref (source);
 }
 
 static void
Index: libnautilus-private/Makefile.am
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/Makefile.am,v
retrieving revision 1.204
diff -u -p -u -r1.204 Makefile.am
--- libnautilus-private/Makefile.am	2001/11/09 01:10:00	1.204
+++ libnautilus-private/Makefile.am	2001/11/22 05:48:53
@@ -27,7 +27,7 @@ nautilus_metafile_server_idl_sources = \
 	$(NULL)
 
 marshal_sources = \
-	nautilus-marshal-guts.h \
+	nautilus-marshal.h \
 	nautilus-marshal-guts.c \
 	$(NULL)
 
@@ -112,7 +112,6 @@ libnautilus_private_la_SOURCES = \
 	nautilus-link-historical.h \
 	nautilus-link.c \
 	nautilus-link.h \
-	nautilus-marshal-guts.h \
 	nautilus-marshal.c \
 	nautilus-marshal.h \
 	nautilus-medusa-support.c \
@@ -176,7 +175,7 @@ nautilus_metafile_server_idl_stamp: naut
 	$(ORBIT_IDL) -I$(top_srcdir) $(CORE_IDL_INCLUDES) $<
 	touch $@
 
-nautilus-marshal-guts.h: nautilus-marshal.list $(GLIB_GENMARSHAL)
+nautilus-marshal.h: nautilus-marshal.list $(GLIB_GENMARSHAL)
 	$(GLIB_GENMARSHAL) $< --header --prefix=nautilus_marshal > $@
 nautilus-marshal-guts.c: nautilus-marshal.list $(GLIB_GENMARSHAL)
 	$(GLIB_GENMARSHAL) $< --body --prefix=nautilus_marshal > $@
Index: libnautilus-private/nautilus-entry.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-entry.c,v
retrieving revision 1.41
diff -u -p -u -r1.41 nautilus-entry.c
--- libnautilus-private/nautilus-entry.c	2001/11/21 06:14:50	1.41
+++ libnautilus-private/nautilus-entry.c	2001/11/22 05:48:54
@@ -283,14 +283,21 @@ select_all_at_idle (gpointer callback_da
 void
 nautilus_entry_select_all_at_idle (NautilusEntry *entry)
 {
+	GSource *source;
+	
 	g_return_if_fail (NAUTILUS_IS_ENTRY (entry));
 
 	/* If the text cursor position changes in this routine
 	 * then gtk_entry_key_press will unselect (and we want
 	 * to move the text cursor position to the end).
 	 */
-	g_object_ref (G_OBJECT (entry));
-	gtk_idle_add (select_all_at_idle, entry);
+
+	source = g_idle_source_new ();
+	g_source_set_callback (source, select_all_at_idle, entry, NULL);
+	g_signal_connect_swapped (entry, "destroy",
+				  G_CALLBACK (g_source_destroy), source);
+	g_source_attach (source, NULL);
+	g_source_unref (source);
 }
 
 /**
Index: libnautilus-private/nautilus-icon-container.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-icon-container.c,v
retrieving revision 1.231
diff -u -p -u -r1.231 nautilus-icon-container.c
--- libnautilus-private/nautilus-icon-container.c	2001/11/10 05:00:33	1.231
+++ libnautilus-private/nautilus-icon-container.c	2001/11/22 05:49:07
@@ -3298,7 +3298,7 @@ nautilus_icon_container_class_init (Naut
 		                G_STRUCT_OFFSET (NautilusIconContainerClass,
 						 preview),
 		                NULL, NULL,
-		                nautilus_marshal_INT__POINTER_INT,
+		                nautilus_marshal_INT__POINTER_BOOLEAN,
 		                G_TYPE_INT, 2,
 				G_TYPE_POINTER,
 				G_TYPE_BOOLEAN);
Index: libnautilus-private/nautilus-marshal.h
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-marshal.h,v
retrieving revision 1.2
diff -u -p -u -r1.2 nautilus-marshal.h
--- libnautilus-private/nautilus-marshal.h	2001/11/21 06:14:50	1.2
+++ libnautilus-private/nautilus-marshal.h	2001/11/22 05:49:07
@@ -1,2 +1,81 @@
-#include <glib-object.h>
-#include "nautilus-marshal-guts.h"
+
+#ifndef __nautilus_marshal_MARSHAL_H__
+#define __nautilus_marshal_MARSHAL_H__
+
+#include	<glib-object.h>
+
+G_BEGIN_DECLS
+
+/* BOOLEAN:POINTER (nautilus-marshal.list:1) */
+extern void nautilus_marshal_BOOLEAN__POINTER (GClosure     *closure,
+                                               GValue       *return_value,
+                                               guint         n_param_values,
+                                               const GValue *param_values,
+                                               gpointer      invocation_hint,
+                                               gpointer      marshal_data);
+
+/* INT:POINTER,INT (nautilus-marshal.list:2) */
+extern void nautilus_marshal_INT__POINTER_INT (GClosure     *closure,
+                                               GValue       *return_value,
+                                               guint         n_param_values,
+                                               const GValue *param_values,
+                                               gpointer      invocation_hint,
+                                               gpointer      marshal_data);
+
+/* INT:POINTER,BOOLEAN (nautilus-marshal.list:3) */
+extern void nautilus_marshal_INT__POINTER_BOOLEAN (GClosure     *closure,
+                                                   GValue       *return_value,
+                                                   guint         n_param_values,
+                                                   const GValue *param_values,
+                                                   gpointer      invocation_hint,
+                                                   gpointer      marshal_data);
+
+/* INT:POINTER,POINTER (nautilus-marshal.list:4) */
+extern void nautilus_marshal_INT__POINTER_POINTER (GClosure     *closure,
+                                                   GValue       *return_value,
+                                                   guint         n_param_values,
+                                                   const GValue *param_values,
+                                                   gpointer      invocation_hint,
+                                                   gpointer      marshal_data);
+
+/* POINTER:VOID (nautilus-marshal.list:5) */
+extern void nautilus_marshal_POINTER__VOID (GClosure     *closure,
+                                            GValue       *return_value,
+                                            guint         n_param_values,
+                                            const GValue *param_values,
+                                            gpointer      invocation_hint,
+                                            gpointer      marshal_data);
+
+/* VOID:DOUBLE (nautilus-marshal.list:6) */
+#define nautilus_marshal_VOID__DOUBLE	g_cclosure_marshal_VOID__DOUBLE
+
+/* VOID:POINTER,INT,INT,INT (nautilus-marshal.list:7) */
+extern void nautilus_marshal_VOID__POINTER_INT_INT_INT (GClosure     *closure,
+                                                        GValue       *return_value,
+                                                        guint         n_param_values,
+                                                        const GValue *param_values,
+                                                        gpointer      invocation_hint,
+                                                        gpointer      marshal_data);
+
+/* VOID:POINTER,POINTER (nautilus-marshal.list:8) */
+extern void nautilus_marshal_VOID__POINTER_POINTER (GClosure     *closure,
+                                                    GValue       *return_value,
+                                                    guint         n_param_values,
+                                                    const GValue *param_values,
+                                                    gpointer      invocation_hint,
+                                                    gpointer      marshal_data);
+
+/* VOID:POINTER,POINTER (nautilus-marshal.list:9) */
+
+/* VOID:POINTER,POINTER,POINTER,INT,INT,INT (nautilus-marshal.list:10) */
+extern void nautilus_marshal_VOID__POINTER_POINTER_POINTER_INT_INT_INT (GClosure     *closure,
+                                                                        GValue       *return_value,
+                                                                        guint         n_param_values,
+                                                                        const GValue *param_values,
+                                                                        gpointer      invocation_hint,
+                                                                        gpointer      marshal_data);
+
+G_END_DECLS
+
+#endif /* __nautilus_marshal_MARSHAL_H__ */
+
Index: libnautilus-private/nautilus-marshal.list
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-marshal.list,v
retrieving revision 1.2
diff -u -p -u -r1.2 nautilus-marshal.list
--- libnautilus-private/nautilus-marshal.list	2001/10/30 19:31:53	1.2
+++ libnautilus-private/nautilus-marshal.list	2001/11/22 05:49:07
@@ -1,5 +1,6 @@
 BOOLEAN:POINTER
 INT:POINTER,INT
+INT:POINTER,BOOLEAN
 INT:POINTER,POINTER
 POINTER:VOID
 VOID:DOUBLE
Index: src/file-manager/fm-properties-window.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-properties-window.c,v
retrieving revision 1.135
diff -u -p -u -r1.135 fm-properties-window.c
--- src/file-manager/fm-properties-window.c	2001/11/21 06:14:51	1.135
+++ src/file-manager/fm-properties-window.c	2001/11/22 05:49:14
@@ -472,7 +472,9 @@ rename_callback (NautilusFile *file, Gno
 					       window->details->pending_name, 
 					       result,
 					       GTK_WINDOW (window));
-		name_field_restore_original_name (window->details->name_field);
+		if (window->details->name_field != NULL) {
+			name_field_restore_original_name (window->details->name_field);
+		}
 	}
 
 	g_object_unref (G_OBJECT (window));
@@ -2458,18 +2460,30 @@ real_destroy (GtkObject *object)
 	window = FM_PROPERTIES_WINDOW (object);
 
 	g_hash_table_remove (windows, window->details->original_file);
+	
+	if (window->details->original_file != NULL) {
+		nautilus_file_monitor_remove (window->details->original_file, window);
+		nautilus_file_unref (window->details->original_file);
+		window->details->original_file = NULL;
+	}
 
-	nautilus_file_monitor_remove (window->details->original_file, window);
-	nautilus_file_unref (window->details->original_file);
+	if (window->details->target_file != NULL) {
+		nautilus_file_monitor_remove (window->details->target_file, window);
+		nautilus_file_unref (window->details->target_file);
+		window->details->target_file = NULL;
+	}
 
-	nautilus_file_monitor_remove (window->details->target_file, window);
-	nautilus_file_unref (window->details->target_file);	
+	window->details->name_field = NULL;
 	
 	g_list_free (window->details->directory_contents_widgets);
+	window->details->directory_contents_widgets = NULL;
+
 	g_list_free (window->details->special_flags_widgets);
+	window->details->special_flags_widgets = NULL;
 
 	if (window->details->update_directory_contents_timeout_id != 0) {
 		gtk_timeout_remove (window->details->update_directory_contents_timeout_id);
+		window->details->update_directory_contents_timeout_id = 0;
 	}
 
 	/* Note that file_changed_handler_id is disconnected in dispose,

-- 
 mmeeks gnu org  <><, Pseudo Engineer, itinerant idiot





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]