[Nautilus-list] some fixes to nautilus 2



Hello.

I have tried to write nautilus-gtkhtml-view, and noticed some problems
in nautilus HEAD.

1. Nautilus retrieves messages from gettext in locale encoding. It
should get utf-8 strings instead (see gnome-2-0-list for discussion).
Attached patch fixes that...

Well, now it breaks all places where nautilus did it's own antialiased
text rendering -- texts are displayed in raw utf-8. IMHO, all that
custom aa rendering should be replaced by general Gtk+ 2.0 widgets, this
way we get utf-8 rendering and remove lots of rendering code which is
already in platform.

2. libnautilus does not install pkg-config files. I have created it,
attached a patch and .pc.in file.

It has one problem -- it's not parallel installable with old nautilus.
Of course, no other parts are parallel-installable (gettext mo files,
binaries, preferences), so I don't think it's much of a problem. You
will want to run only one nautilus at a time...

3. two obvious places needed to change while porting to Gtk+2.

-- 
Gediminas Paulauskas
Kaunas, Lithuania
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/nautilus/ChangeLog,v
retrieving revision 1.4860
diff -u -p -r1.4860 ChangeLog
--- ChangeLog	2001/12/04 19:49:19	1.4860
+++ ChangeLog	2001/12/05 11:26:24
@@ -1,3 +1,13 @@
+2001-12-05  Gediminas Paulauskas <menesis delfi lt>
+
+	* components/hardware/main.c, components/help/hyperbola-main.c,
+	components/image-viewer/nautilus-image-view.c,
+	components/mozilla/main.c, libnautilus/nautilus-view-standard-main.c,
+	src/nautilus-main.c: (main) get translated messages from nautilus
+	text domain in utf-8.
+	* src/nautilus-window-menus.c: (help_menu_about_nautilus_callback)
+	replace copyright symbol with utf-8 version of it.
+
 2001-12-04  Darin Adler  <darin bentspoon com>
 
 	Fix bugs exposed by "make check".
Index: components/hardware/main.c
===================================================================
RCS file: /cvs/gnome/nautilus/components/hardware/main.c,v
retrieving revision 1.16
diff -u -p -r1.16 main.c
--- components/hardware/main.c	2001/11/22 06:49:44	1.16
+++ components/hardware/main.c	2001/12/05 10:59:37
@@ -76,6 +76,7 @@ int main(int argc, char *argv[])
 	/* Initialize gettext support */
 #ifdef ENABLE_NLS /* sadly we need this ifdef because otherwise the following get empty statement warnings */
 	bindtextdomain (PACKAGE, GNOMELOCALEDIR);
+	bind_textdomain_codeset (PACKAGE, "UTF-8");
 	textdomain (PACKAGE);
 #endif
 
Index: components/help/hyperbola-main.c
===================================================================
RCS file: /cvs/gnome/nautilus/components/help/hyperbola-main.c,v
retrieving revision 1.31
diff -u -p -r1.31 hyperbola-main.c
--- components/help/hyperbola-main.c	2001/11/12 07:00:35	1.31
+++ components/help/hyperbola-main.c	2001/12/05 10:59:37
@@ -98,6 +98,7 @@ main (int argc, char *argv[])
 	/* Initialize gettext support */
 #ifdef ENABLE_NLS		/* sadly we need this ifdef because otherwise the following get empty statement warnings */
 	bindtextdomain (PACKAGE, GNOMELOCALEDIR);
+	bind_textdomain_codeset (PACKAGE, "UTF-8");
 	textdomain (PACKAGE);
 #endif
 
Index: components/image-viewer/nautilus-image-view.c
===================================================================
RCS file: /cvs/gnome/nautilus/components/image-viewer/nautilus-image-view.c,v
retrieving revision 1.28
diff -u -p -r1.28 nautilus-image-view.c
--- components/image-viewer/nautilus-image-view.c	2001/11/11 00:50:00	1.28
+++ components/image-viewer/nautilus-image-view.c	2001/12/05 10:59:37
@@ -848,6 +848,7 @@ main (int argc, char *argv [])
 	/* Initialize gettext support */
 #ifdef ENABLE_NLS
 	bindtextdomain (PACKAGE, GNOMELOCALEDIR);
+	bind_textdomain_codeset (PACKAGE, "UTF-8");
 	textdomain (PACKAGE);
 #endif
 
Index: components/mozilla/main.c
===================================================================
RCS file: /cvs/gnome/nautilus/components/mozilla/main.c,v
retrieving revision 1.35
diff -u -p -r1.35 main.c
--- components/mozilla/main.c	2001/11/09 02:05:27	1.35
+++ components/mozilla/main.c	2001/12/05 10:59:37
@@ -247,6 +247,7 @@ main (int argc, char *argv[])
 	/* Initialize gettext support */
 #ifdef ENABLE_NLS
 	bindtextdomain (PACKAGE, GNOMELOCALEDIR);
+	bind_textdomain_codeset (PACKAGE, "UTF-8");
 	textdomain (PACKAGE);
 #endif
 
Index: libnautilus/nautilus-view-standard-main.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus/nautilus-view-standard-main.c,v
retrieving revision 1.16
diff -u -p -r1.16 nautilus-view-standard-main.c
--- libnautilus/nautilus-view-standard-main.c	2001/11/22 06:49:46	1.16
+++ libnautilus/nautilus-view-standard-main.c	2001/12/05 10:59:38
@@ -188,6 +188,7 @@ nautilus_view_standard_main_multi (const
 	if (gettext_package_name != NULL
 	    && gettext_locale_directory != NULL) {
 		bindtextdomain (gettext_package_name, gettext_locale_directory);
+		bind_textdomain_codeset (gettext_package_name, "UTF-8");
 		textdomain (gettext_package_name);
 	}
 #endif
Index: src/nautilus-main.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-main.c,v
retrieving revision 1.113
diff -u -p -r1.113 nautilus-main.c
--- src/nautilus-main.c	2001/12/01 01:05:36	1.113
+++ src/nautilus-main.c	2001/12/05 10:59:40
@@ -190,6 +190,7 @@ main (int argc, char *argv[])
 	 */
 #ifdef ENABLE_NLS
 	bindtextdomain (PACKAGE, GNOMELOCALEDIR);
+	bind_textdomain_codeset (PACKAGE, "UTF-8");
 	textdomain (PACKAGE);
 #endif
 
Index: src/nautilus-window-menus.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-window-menus.c,v
retrieving revision 1.213
diff -u -p -r1.213 nautilus-window-menus.c
--- src/nautilus-window-menus.c	2001/11/09 02:05:50	1.213
+++ src/nautilus-window-menus.c	2001/12/05 10:59:42
@@ -628,11 +628,8 @@ help_menu_about_nautilus_callback (Bonob
 		    || strcmp (locale, "C") == 0
 		    || strcmp (locale, "POSIX") == 0
 		    || strcmp (locale, "en_US") == 0) {
-			/* The copyright character here is correct for
-			 * Latin-1 encoding, but not for UTF-8, so we
-			 * have to change it when we move to GTK 2.0.
-			 */
-			copyright = "Copyright \xA9 1999-2001 Eazel, Inc.";
+			/* The copyright character here is in UTF-8 */
+			copyright = "Copyright \xC2\xA9 1999-2001 Eazel, Inc.";
 		} else {
 			/* Localize to deal with issues in the copyright
 			 * symbol characters -- do not translate the company
Index: Makefile.am
===================================================================
RCS file: /cvs/gnome/nautilus/Makefile.am,v
retrieving revision 1.63
diff -u -p -r1.63 Makefile.am
--- Makefile.am	2001/11/09 01:09:23	1.63
+++ Makefile.am	2001/12/05 10:59:35
@@ -50,6 +50,8 @@ EXTRA_DIST=					\
 	$(DESKTOP_FILES)			\
 	$(NULL)
 
+$(pkgconfig_DATA): config.status
+
 appicondir = $(datadir)/pixmaps
 appicon_DATA = 	nautilus-launch-icon.png 	\
 		gnome-starthere-96.png		\
Index: configure.in
===================================================================
RCS file: /cvs/gnome/nautilus/configure.in,v
retrieving revision 1.385
diff -u -p -r1.385 configure.in
--- configure.in	2001/11/22 05:58:25	1.385
+++ configure.in	2001/12/05 10:59:35
@@ -601,6 +601,7 @@ icons/throbber/Makefile
 libnautilus-adapter/Makefile
 libnautilus-private/Makefile
 libnautilus/Makefile
+libnautilus/libnautilus.pc
 nautilus.spec
 omf-install/Makefile
 po/Makefile.in
Index: libnautilus/Makefile.am
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus/Makefile.am,v
retrieving revision 1.101
diff -u -p -r1.101 Makefile.am
--- libnautilus/Makefile.am	2001/11/09 01:32:17	1.101
+++ libnautilus/Makefile.am	2001/12/05 10:59:38
@@ -94,6 +94,9 @@ CLEANFILES = \
 	$(nautilus_distributed_undo_idl_sources)	\
 	nautilus_distributed_undo_idl_stamp             \
 	$(NULL)
+
+pkgconfigdir=$(libdir)/pkgconfig
+pkgconfig_DATA=libnautilus.pc
 
 dist-hook:
 	cd $(distdir); rm -f $(CLEANFILES)
prefix= prefix@
exec_prefix= exec_prefix@
libdir= libdir@
includedir= includedir@

Name: libnautilus
Description: A library to create Nautilus components
Version: @VERSION@
Requires: eel-2.0 bonobo-activation-2.0 libbonobo-2.0 libbonoboui-2.0
Libs: -L${libdir} -lnautilus
Cflags: -I${includedir}
Index: libnautilus-private/nautilus-desktop-file-loader.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-desktop-file-loader.c,v
retrieving revision 1.4
diff -u -p -r1.4 nautilus-desktop-file-loader.c
--- libnautilus-private/nautilus-desktop-file-loader.c	2001/11/07 21:43:55	1.4
+++ libnautilus-private/nautilus-desktop-file-loader.c	2001/12/05 10:59:39
@@ -294,50 +294,10 @@ nautilus_desktop_file_free (NautilusDesk
 }
 
 
-/* This is cut and pasted from glib 1.3.x
- * It should be removed when porting to glib 2
- */
-/**
- * g_strdupv:
- * @str_array: %NULL-terminated array of strings
- * 
- * Copies %NULL-terminated array of strings. The copy is a deep copy;
- * the new array should be freed by first freeing each string, then
- * the array itself. g_strfreev() does this for you. If called
- * on a %NULL value, g_strdupv() simply returns %NULL.
- * 
- * Return value: a new %NULL-terminated array of strings
- **/
-static gchar**
-cnp_g_strdupv (gchar **str_array)
-{
-        if (str_array) {
-                gint i;
-                gchar **retval;
-
-                i = 0;
-                while (str_array[i])
-                        ++i;
-          
-                retval = g_new (gchar*, i + 1);
-
-                i = 0;
-                while (str_array[i]) {
-                        retval[i] = g_strdup (str_array[i]);
-                        ++i;
-                }
-                retval[i] = NULL;
-
-                return retval;
-        } else {
-                return NULL;
-        }
-}
-
 char**
 nautilus_desktop_file_get_lines (NautilusDesktopFile *df)
 {
-        return cnp_g_strdupv (df->lines);
+        return g_strdupv (df->lines);
 }
 
 /* Custom hash functions allow us to avoid strdups */
@@ -1071,24 +1031,6 @@ validated_strdup (const char *str)
         return buf;
 }
 
-/* This is cut and pasted from glib 1.3.x
- * It should be removed when porting to glib 2
- */
-static void
-cnp_g_string_append_len (GString *str,
-			 const char *s,
-			 int len)
-{
-	if (len < 0) {
-		g_string_append (str, s);
-	} else {
-		char *tmp;
-		tmp = g_strndup (s, len);
-		g_string_append (str, tmp);
-		g_free (tmp);
-	}
-}
-
 static char*
 nautilus_desktop_file_sub_formats (NautilusDesktopFile *df,
 				   const char *src)
@@ -1107,7 +1049,7 @@ nautilus_desktop_file_sub_formats (Nauti
 	while (p) {
 		if (p != end) {
 			/* Append what we just scanned over */
-		        cnp_g_string_append_len (new, end, p - end);
+		        g_string_append_len (new, end, p - end);
 		}
 
 		end = p;
Index: src/nautilus-about.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-about.c,v
retrieving revision 1.37
diff -u -p -r1.37 nautilus-about.c
--- src/nautilus-about.c	2001/12/01 01:05:36	1.37
+++ src/nautilus-about.c	2001/12/05 10:59:40
@@ -126,10 +126,9 @@ nautilus_about_instance_init (NautilusAb
 	about->details->background_pixbuf = gdk_pixbuf_new_from_file (background_path, NULL);
 	g_free (background_path);	
 
-	/* set the window title and standard close key accelerator */
+	/* set the window title */
 	gtk_window_set_title (GTK_WINDOW (about), _("About Nautilus"));
 	gtk_window_set_wmclass (GTK_WINDOW (about), "about", "Nautilus");
-	eel_gtk_window_set_up_close_accelerator (GTK_WINDOW (about));
 	
 	/* allocate a frame to hold the drawing area */
 	frame = gtk_frame_new (NULL);
Index: src/file-manager/nautilus-indexing-info.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/nautilus-indexing-info.c,v
retrieving revision 1.31
diff -u -p -r1.31 nautilus-indexing-info.c
--- src/file-manager/nautilus-indexing-info.c	2001/11/09 02:05:52	1.31
+++ src/file-manager/nautilus-indexing-info.c	2001/12/05 10:59:42
@@ -110,7 +110,7 @@ update_progress_display (gpointer callba
 static void
 dialog_close_cover (gpointer dialog_data)
 {
-        g_assert (GNOME_IS_DIALOG (dialog_data));
+        g_assert (GTK_IS_DIALOG (dialog_data));
 
         gtk_dialog_close (dialog_data);
 }


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