eog r4938 - in trunk: . src



Author: friemann
Date: Fri Jan  9 20:33:29 2009
New Revision: 4938
URL: http://svn.gnome.org/viewvc/eog?rev=4938&view=rev

Log:
2009-01-09  Felix Riemann  <friemann svn gnome org>

	* configure.ac: Drop libgnomeui dependency.
	* src/eog-session.c: (eog_session_init): Remove session handling
	code that did essentially nothing.
	* src/eog-util.c:
	* src/main.c: (main):
	Stop using GnomeProgram. Remove remaining traces of libgnome
	and libgnomeui in eog. This finally drops the dependency on 
	libgnome and libgnomeui. Fixes bug #559500.


Modified:
   trunk/ChangeLog
   trunk/configure.ac
   trunk/src/eog-session.c
   trunk/src/eog-util.c
   trunk/src/main.c

Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac	(original)
+++ trunk/configure.ac	Fri Jan  9 20:33:29 2009
@@ -83,7 +83,6 @@
 
 GTK_REQUIRED=2.13.1
 GLIB_REQUIRED=2.15.3
-LIBGNOMEUI_REQUIRED=2.6.0
 GNOME_DESKTOP_REQUIRED=2.25.1
 GDKPIXBUF_REQUIRED=2.4.0
 GCONF_REQUIRED=2.5.90
@@ -97,7 +96,6 @@
 EOG_MODULES="gtk+-2.0 >= $GTK_REQUIRED \
              glib-2.0 >= $GLIB_REQUIRED \
              gio-2.0 >= $GLIB_REQUIRED \
-             libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED \
              gnome-desktop-2.0 >= $GNOME_DESKTOP_REQUIRED \
              gdk-pixbuf-2.0 >= $GDKPIXBUF_REQUIRED \
              gconf-2.0 >= $GCONF_REQUIRED \

Modified: trunk/src/eog-session.c
==============================================================================
--- trunk/src/eog-session.c	(original)
+++ trunk/src/eog-session.c	Fri Jan  9 20:33:29 2009
@@ -31,34 +31,12 @@
 #include "eog-window.h"
 #include "eog-application.h"
 
-#include <libgnomeui/gnome-client.h>
-
-static void
-removed_from_session (GnomeClient *client, EogApplication *application)
-{
-	eog_application_shutdown (application);
-}
-
-static gint
-save_session (GnomeClient *client, gint phase, GnomeSaveStyle save_style, gint shutdown,
-	      GnomeInteractStyle interact_style, gint fast, EogApplication *application)
-{
-	return TRUE;
-}
-
 void
 eog_session_init (EogApplication *application)
 {
-	GnomeClient *client;
-
 	g_return_if_fail (EOG_IS_APPLICATION (application));
 
-	client = gnome_master_client ();
-
-	g_signal_connect (client, "save_yourself",
-			  G_CALLBACK (save_session), application);
-	g_signal_connect (client, "die",
-			  G_CALLBACK (removed_from_session), application);
+	/* FIXME: Session management is currently a no-op in eog. */
 }
 
 gboolean

Modified: trunk/src/eog-util.c
==============================================================================
--- trunk/src/eog-util.c	(original)
+++ trunk/src/eog-util.c	Fri Jan  9 20:33:29 2009
@@ -35,6 +35,7 @@
 
 #include "eog-util.h"
 
+#include <errno.h>
 #include <string.h>
 #include <glib.h>
 #include <glib/gprintf.h>
@@ -42,7 +43,6 @@
 #include <gtk/gtk.h>
 #include <gio/gio.h>
 #include <glib/gi18n.h>
-#include <libgnome/gnome-init.h>
 
 void
 eog_util_show_help (const gchar *section, GtkWindow *parent)

Modified: trunk/src/main.c
==============================================================================
--- trunk/src/main.c	(original)
+++ trunk/src/main.c	Fri Jan  9 20:33:29 2009
@@ -43,10 +43,6 @@
 #include <stdlib.h>
 #include <glib/gi18n.h>
 #include <gconf/gconf-client.h>
-#include <libgnomeui/gnome-ui-init.h>
-#include <libgnomeui/gnome-client.h>
-#include <libgnomeui/gnome-app-helper.h>
-#include <libgnomeui/gnome-authentication-manager.h>
 
 #if HAVE_EXEMPI
 #include <exempi/xmp.h>
@@ -174,9 +170,12 @@
 int
 main (int argc, char **argv)
 {
-	GnomeProgram *program;
+	GError *error = NULL;
 	GOptionContext *ctx;
 
+	if (!g_thread_supported ())
+		g_thread_init (NULL);
+
 	bindtextdomain (PACKAGE, EOG_LOCALE_DIR);
 	bind_textdomain_codeset (PACKAGE, "UTF-8");
 	textdomain (PACKAGE);
@@ -185,13 +184,22 @@
 
 	ctx = g_option_context_new (NULL);
 	g_option_context_add_main_entries (ctx, goption_options, PACKAGE);
+	/* Option groups are free'd together with the context */
+	g_option_context_add_group (ctx, gtk_get_option_group (TRUE));
+
+	gtk_init (&argc, &argv);
+
+	if (!g_option_context_parse (ctx, &argc, &argv, &error)) {
+		/* I18N: The first %s is the error message from GOption.
+		         The second %s is eog's command name (argv[0]) */
+                g_print(_("Error: %s\nRun '%s --help' to see a full list of available command line options.\n"), error->message, argv[0]); 
+                g_error_free (error);
+                g_option_context_free (ctx);
+                
+                return 1;
+        }
+	g_option_context_free (ctx);
 
-	program = gnome_program_init ("eog", VERSION,
-				      LIBGNOMEUI_MODULE, argc, argv,
-				      GNOME_PARAM_GOPTION_CONTEXT, ctx,
-				      GNOME_PARAM_HUMAN_READABLE_NAME, _("Eye of GNOME"),
-				      GNOME_PARAM_APP_DATADIR, EOG_DATA_DIR,
-				      NULL);
 	
 	set_startup_flags ();
 	
@@ -199,14 +207,11 @@
 	if (!force_new_instance &&
 	    !eog_application_register_service (EOG_APP)) {
 		if (load_files_remote ()) {
-			g_object_unref (program);
 			return 0;
 		}
 	}
 #endif /* HAVE_DBUS */
 	
-	gnome_authentication_manager_init ();
-
 #ifdef HAVE_EXEMPI
  	xmp_init();
 #endif
@@ -236,8 +241,6 @@
 
 	eog_plugin_engine_shutdown ();
 
-	g_object_unref (program);
-
 #ifdef HAVE_EXEMPI
 	xmp_terminate();
 #endif



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