diff options
author | Felix Riemann <friemann@svn.gnome.org> | 2009-01-09 20:33:29 +0000 |
---|---|---|
committer | Felix Riemann <friemann@src.gnome.org> | 2009-01-09 20:33:29 +0000 |
commit | fbe253cb55db44ffe61c90853d4458e7db522630 (patch) | |
tree | cc75cdceae7de560dc0a6050b7c77e6500b3ffcf /src/main.c | |
parent | 19d9570960637b8c44029b642de9624252fc72a6 (diff) | |
download | eog-fbe253cb55db44ffe61c90853d4458e7db522630.tar.gz |
Drop libgnomeui dependency. Remove session handling code that did
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.
svn path=/trunk/; revision=4938
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 35 |
1 files changed, 19 insertions, 16 deletions
@@ -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 @@ load_files_remote (void) 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 @@ main (int argc, char **argv) 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 @@ main (int argc, char **argv) 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 @@ main (int argc, char **argv) eog_plugin_engine_shutdown (); - g_object_unref (program); - #ifdef HAVE_EXEMPI xmp_terminate(); #endif |