[rhythmbox] update eggsmclient code from libegg



commit 3852f2a6f1dc7188fdcfbcd4a6f30513f3274d8a
Author: Jonathan Matthew <jonathan d14n org>
Date:   Wed Apr 29 18:48:57 2009 +1000

    update eggsmclient code from libegg
---
 lib/eggdesktopfile.c   |   22 ++++++++++++----------
 lib/eggsmclient-xsmp.c |   13 ++++++++++---
 lib/eggsmclient.c      |   10 +++++++++-
 3 files changed, 31 insertions(+), 14 deletions(-)

diff --git a/lib/eggdesktopfile.c b/lib/eggdesktopfile.c
index 9e9376e..357e548 100644
--- a/lib/eggdesktopfile.c
+++ b/lib/eggdesktopfile.c
@@ -1440,16 +1440,18 @@ egg_set_desktop_file (const char *desktop_file_path)
       g_error_free (error);
     }
 
-  /* Set localized application name and default window icon */
-  if (egg_desktop_file->name)
-    g_set_application_name (egg_desktop_file->name);
-  if (egg_desktop_file->icon)
-    {
-      if (g_path_is_absolute (egg_desktop_file->icon))
-	gtk_window_set_default_icon_from_file (egg_desktop_file->icon, NULL);
-      else
-	gtk_window_set_default_icon_name (egg_desktop_file->icon);
-    }
+  if (egg_desktop_file) {
+    /* Set localized application name and default window icon */
+    if (egg_desktop_file->name)
+      g_set_application_name (egg_desktop_file->name);
+    if (egg_desktop_file->icon)
+      {
+        if (g_path_is_absolute (egg_desktop_file->icon))
+          gtk_window_set_default_icon_from_file (egg_desktop_file->icon, NULL);
+        else
+          gtk_window_set_default_icon_name (egg_desktop_file->icon);
+      }
+  }
 
   G_UNLOCK (egg_desktop_file);
 }
diff --git a/lib/eggsmclient-xsmp.c b/lib/eggsmclient-xsmp.c
index e4b11f6..1a56156 100644
--- a/lib/eggsmclient-xsmp.c
+++ b/lib/eggsmclient-xsmp.c
@@ -795,10 +795,14 @@ save_state (EggSMClientXSMP *xsmp)
   if (desktop_file)
     {
       GKeyFile *merged_file;
+      char *desktop_file_path;
 
       merged_file = g_key_file_new ();
-      if (g_key_file_load_from_file (merged_file,
-				     egg_desktop_file_get_source (desktop_file),
+      desktop_file_path =
+	g_filename_from_uri (egg_desktop_file_get_source (desktop_file),
+			     NULL, NULL);
+      if (desktop_file_path &&
+	  g_key_file_load_from_file (merged_file, desktop_file_path,
 				     G_KEY_FILE_KEEP_COMMENTS |
 				     G_KEY_FILE_KEEP_TRANSLATIONS, NULL))
 	{
@@ -841,8 +845,11 @@ save_state (EggSMClientXSMP *xsmp)
 				 EGG_DESKTOP_FILE_KEY_EXEC,
 				 exec);
 	  g_free (exec);
-
 	}
+      else
+	desktop_file = NULL;
+
+      g_free (desktop_file_path);
     }
 
   /* Now write state_file to disk. (We can't use mktemp(), because
diff --git a/lib/eggsmclient.c b/lib/eggsmclient.c
index 8e2254f..efa901d 100644
--- a/lib/eggsmclient.c
+++ b/lib/eggsmclient.c
@@ -178,6 +178,7 @@ egg_sm_client_class_init (EggSMClientClass *klass)
 static gboolean sm_client_disable = FALSE;
 static char *sm_client_state_file = NULL;
 static char *sm_client_id = NULL;
+static char *sm_config_prefix = NULL;
 
 static gboolean
 sm_client_post_parse_func (GOptionContext  *context,
@@ -228,10 +229,17 @@ egg_sm_client_get_option_group (void)
     { "sm-client-id", 0, 0,
       G_OPTION_ARG_STRING, &sm_client_id,
       N_("Specify session management ID"), N_("ID") },
-    /* Compatibility options */
+    /* GnomeClient compatibility option */
     { "sm-disable", 0, G_OPTION_FLAG_HIDDEN,
       G_OPTION_ARG_NONE, &sm_client_disable,
       NULL, NULL },
+    /* GnomeClient compatibility option. This is a dummy option that only
+     * exists so that sessions saved by apps with GnomeClient can be restored
+     * later when they've switched to EggSMClient. See bug #575308.
+     */
+    { "sm-config-prefix", 0, G_OPTION_FLAG_HIDDEN,
+      G_OPTION_ARG_STRING, &sm_config_prefix,
+      NULL, NULL },
     { NULL }
   };
   GOptionGroup *group;



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