From 0cf63ba421ed43151f03eda6aece87f507e0b765 Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Fri, 11 Jul 2008 09:16:23 +0000 Subject: [PATCH] moved some common code back to main.c svn path=/trunk/; revision=26118 --- app/main.c | 17 ++++++++++++++--- app/unique.c | 31 +++++++------------------------ app/unique.h | 3 +-- po/POTFILES.in | 1 - 4 files changed, 22 insertions(+), 30 deletions(-) diff --git a/app/main.c b/app/main.c index 7e16c10fb9..2f3a2f0639 100644 --- a/app/main.c +++ b/app/main.c @@ -41,6 +41,10 @@ #include /* get_osfhandle */ #endif +#ifndef GIMP_CONSOLE_COMPILATION +#include +#endif + #include "libgimpbase/gimpbase.h" #include "core/core-types.h" @@ -370,11 +374,18 @@ main (int argc, if (no_interface) new_instance = TRUE; - if (! new_instance) +#ifndef GIMP_CONSOLE_COMPILATION + if (! new_instance && gimp_unique_open (filenames, as_new)) { - if (gimp_unique_open (filenames, as_new, be_verbose)) - return EXIT_SUCCESS; + if (be_verbose) + g_print ("%s\n", + _("Another GIMP instance is already running.")); + + gdk_notify_startup_complete (); + + return EXIT_SUCCESS; } +#endif abort_message = sanity_check (); if (abort_message) diff --git a/app/unique.c b/app/unique.c index 7e2890ef99..74a12f591b 100644 --- a/app/unique.c +++ b/app/unique.c @@ -28,40 +28,31 @@ #include #endif -#ifndef GIMP_CONSOLE_COMPILATION -#include -#endif - #include "core/core-types.h" #include "file/file-utils.h" #include "unique.h" -#include "gimp-intl.h" - #if HAVE_DBUS_GLIB static gboolean gimp_unique_dbus_open (const gchar **filenames, - gboolean as_new, - gboolean be_verbose); + gboolean as_new); #endif #ifdef G_OS_WIN32 static gboolean gimp_unique_win32_open (const gchar **filenames, - gboolean as_new, - gboolean be_verbose); + gboolean as_new); #endif gboolean gimp_unique_open (const gchar **filenames, - gboolean as_new, - gboolean be_verbose) + gboolean as_new) { #ifdef G_OS_WIN32 - return gimp_unique_win32_open (filenames, as_new, be_verbose); + return gimp_unique_win32_open (filenames, as_new); #elif HAVE_DBUS_GLIB - return gimp_unique_dbus_open (filenames, as_new, be_verbose); + return gimp_unique_dbus_open (filenames, as_new); #else return FALSE; #endif @@ -72,8 +63,7 @@ gimp_unique_open (const gchar **filenames, static gboolean gimp_unique_dbus_open (const gchar **filenames, - gboolean as_new, - gboolean be_verbose) + gboolean as_new) { #ifndef GIMP_CONSOLE_COMPILATION @@ -160,12 +150,6 @@ gimp_unique_dbus_open (const gchar **filenames, if (success) { - if (be_verbose) - g_print ("%s\n", - _("Another GIMP instance is already running.")); - - gdk_notify_startup_complete (); - return TRUE; } else if (! (error->domain == DBUS_GERROR && @@ -188,8 +172,7 @@ gimp_unique_dbus_open (const gchar **filenames, static gboolean gimp_unique_win32_open (const gchar **filenames, - gboolean as_new, - gboolean be_verbose) + gboolean as_new) { #ifndef GIMP_CONSOLE_COMPILATION diff --git a/app/unique.h b/app/unique.h index 69617dc960..64eebcbfde 100644 --- a/app/unique.h +++ b/app/unique.h @@ -21,8 +21,7 @@ gboolean gimp_unique_open (const gchar **filenames, - gboolean as_new, - gboolean be_verbose); + gboolean as_new); #endif /* __UNIQUE_H__ */ diff --git a/po/POTFILES.in b/po/POTFILES.in index 50354aec0c..af3be2afed 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -8,7 +8,6 @@ app/app.c app/batch.c app/main.c app/sanity.c -app/unique.c app/version.c app/actions/actions.c