[xdg-user-dirs-gtk] Only initialize gtk when needed



commit 20ad0dca1b74b01ea5f111967d2a4d5077a85b9e
Author: Sebastien Bacher <seb128 ubuntu com>
Date:   Tue Mar 16 09:38:46 2010 +0100

    Only initialize gtk when needed

 update.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/update.c b/update.c
index 50a57e0..f1975c4 100644
--- a/update.c
+++ b/update.c
@@ -287,8 +287,6 @@ main (int argc, char *argv[])
   bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
   textdomain (GETTEXT_PACKAGE);
 
-  gtk_init (&argc, &argv);
-
   old_entries = parse_xdg_dirs (NULL);
   old_locale = parse_xdg_dirs_locale ();
   locale = g_strdup (setlocale (LC_MESSAGES, NULL));
@@ -299,8 +297,11 @@ main (int argc, char *argv[])
   if (old_locale && *old_locale != 0 &&
       strcmp (old_locale, locale) != 0 &&
       has_xdg_translation ())
-    update_locale (old_entries);
-
+    {
+       gtk_init (&argc, &argv);
+       update_locale (old_entries);
+    }
+  
   new_entries = parse_xdg_dirs (NULL);
 
   bookmarks = parse_gtk_bookmarks (NULL);



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