aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2008-12-12 23:49:31 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2008-12-12 23:49:31 +0800
commit3b36480159ea5d9a7477e8fe118a4847fe32bbd3 (patch)
tree9935fc97f63d94bb614613c63261f23893441147
parent37d1d0fb5b7b306c038d5535b822d71090881052 (diff)
downloadgsoc2013-empathy-3b36480159ea5d9a7477e8fe118a4847fe32bbd3.tar
gsoc2013-empathy-3b36480159ea5d9a7477e8fe118a4847fe32bbd3.tar.gz
gsoc2013-empathy-3b36480159ea5d9a7477e8fe118a4847fe32bbd3.tar.bz2
gsoc2013-empathy-3b36480159ea5d9a7477e8fe118a4847fe32bbd3.tar.lz
gsoc2013-empathy-3b36480159ea5d9a7477e8fe118a4847fe32bbd3.tar.xz
gsoc2013-empathy-3b36480159ea5d9a7477e8fe118a4847fe32bbd3.tar.zst
gsoc2013-empathy-3b36480159ea5d9a7477e8fe118a4847fe32bbd3.zip
Refactor empathy_gtk_init* to share common code.
svn path=/trunk/; revision=1969
-rw-r--r--libempathy-gtk/empathy-ui-utils.c45
1 files changed, 26 insertions, 19 deletions
diff --git a/libempathy-gtk/empathy-ui-utils.c b/libempathy-gtk/empathy-ui-utils.c
index 351a5aa9c..91bbfe58b 100644
--- a/libempathy-gtk/empathy-ui-utils.c
+++ b/libempathy-gtk/empathy-ui-utils.c
@@ -49,20 +49,40 @@
#include <libempathy/empathy-utils.h>
#include <libempathy/empathy-dispatcher.h>
-void
-empathy_gtk_init (int *argc, char ***argv)
+static gboolean
+init (gboolean abort_if_fail,
+ int *argc,
+ char ***argv,
+ char *parameter_string,
+ GOptionEntry *entries,
+ char *translation_domain,
+ GError **error)
{
static gboolean initialized = FALSE;
+ gboolean ret = TRUE;
if (initialized)
- return;
+ return TRUE;
empathy_init ();
- gtk_init (argc, argv);
+ if (abort_if_fail) {
+ gtk_init (argc, argv);
+ } else {
+ ret = gtk_init_with_args (argc, argv, parameter_string, entries,
+ translation_domain, error);
+ }
gtk_icon_theme_append_search_path (gtk_icon_theme_get_default (),
PKGDATADIR G_DIR_SEPARATOR_S "icons");
initialized = TRUE;
+
+ return ret;
+}
+
+void
+empathy_gtk_init (int *argc, char ***argv)
+{
+ init (FALSE, argc, argv, NULL, NULL, NULL, NULL);
}
gboolean
@@ -73,21 +93,8 @@ empathy_gtk_init_with_args (int *argc,
char *translation_domain,
GError **error)
{
- static gboolean initialized = FALSE;
- gboolean ret;
-
- if (initialized)
- return TRUE;
-
- empathy_init ();
- ret = gtk_init_with_args (argc, argv, parameter_string, entries,
- translation_domain, error);
- gtk_icon_theme_append_search_path (gtk_icon_theme_get_default (),
- PKGDATADIR G_DIR_SEPARATOR_S "icons");
-
- initialized = TRUE;
-
- return ret;
+ return init (TRUE, argc, argv, parameter_string, entries,
+ translation_domain, error);
}
struct SizeData {