[totem] Update smclient from libegg master



commit 33c374b4af4c1f6d244bb1cdb412b4edceee9bd7
Author: Christian Persch <chpe gnome org>
Date:   Thu Jun 25 20:10:46 2009 +0200

    Update smclient from libegg master
    
    And use egg_set_desktop_file_without_defaults() instead of
    egg_set_desktop_file(). Bug #586128, bug #585734.

 .gitignore              |    1 -
 src/eggdesktopfile.c    |   69 ++++++++++++++++++++++++++++++++++------------
 src/eggdesktopfile.h    |    5 ++-
 src/eggsmclient-1.patch |   15 ++++++----
 src/eggsmclient-xsmp.c  |   12 ++++----
 src/totem-session.c     |    2 +-
 6 files changed, 70 insertions(+), 34 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index dbbda9c..5fa9642 100644
--- a/.gitignore
+++ b/.gitignore
@@ -54,6 +54,5 @@ src/plugins/totem/Makefile.in
 src/plugins/tracker/Makefile.in
 src/plugins/youtube/Makefile.in
 *~
-*.patch
 *.log
 *.diff
diff --git a/src/eggdesktopfile.c b/src/eggdesktopfile.c
index 357e548..af8a98e 100644
--- a/src/eggdesktopfile.c
+++ b/src/eggdesktopfile.c
@@ -1386,6 +1386,8 @@ egg_desktop_file_launch (EggDesktopFile *desktop_file,
       free_document_list (documents);
       break;
 
+    case EGG_DESKTOP_FILE_TYPE_UNRECOGNIZED:
+    case EGG_DESKTOP_FILE_TYPE_DIRECTORY:
     default:
       g_set_error (error, EGG_DESKTOP_FILE_ERROR,
 		   EGG_DESKTOP_FILE_ERROR_NOT_LAUNCHABLE,
@@ -1408,23 +1410,9 @@ egg_desktop_file_error_quark (void)
 G_LOCK_DEFINE_STATIC (egg_desktop_file);
 static EggDesktopFile *egg_desktop_file;
 
-/**
- * egg_set_desktop_file:
- * @desktop_file_path: path to the application's desktop file
- *
- * Creates an #EggDesktopFile for the application from the data at
- * @desktop_file_path. This will also call g_set_application_name()
- * with the localized application name from the desktop file, and
- * gtk_window_set_default_icon_name() or
- * gtk_window_set_default_icon_from_file() with the application's
- * icon. Other code may use additional information from the desktop
- * file.
- *
- * Note that for thread safety reasons, this function can only
- * be called once.
- **/
-void
-egg_set_desktop_file (const char *desktop_file_path)
+static void
+egg_set_desktop_file_internal (const char *desktop_file_path,
+                               gboolean set_defaults)
 {
   GError *error = NULL;
 
@@ -1440,7 +1428,7 @@ egg_set_desktop_file (const char *desktop_file_path)
       g_error_free (error);
     }
 
-  if (egg_desktop_file) {
+  if (set_defaults && egg_desktop_file != NULL) {
     /* Set localized application name and default window icon */
     if (egg_desktop_file->name)
       g_set_application_name (egg_desktop_file->name);
@@ -1457,6 +1445,51 @@ egg_set_desktop_file (const char *desktop_file_path)
 }
 
 /**
+ * egg_set_desktop_file:
+ * @desktop_file_path: path to the application's desktop file
+ *
+ * Creates an #EggDesktopFile for the application from the data at
+ * @desktop_file_path. This will also call g_set_application_name()
+ * with the localized application name from the desktop file, and
+ * gtk_window_set_default_icon_name() or
+ * gtk_window_set_default_icon_from_file() with the application's
+ * icon. Other code may use additional information from the desktop
+ * file.
+ * See egg_set_desktop_file_without_defaults() for a variant of this
+ * function that does not set the application name and default window
+ * icon.
+ *
+ * Note that for thread safety reasons, this function can only
+ * be called once, and is mutually exclusive with calling
+ * egg_set_desktop_file_without_defaults().
+ **/
+void
+egg_set_desktop_file (const char *desktop_file_path)
+{
+  egg_set_desktop_file_internal (desktop_file_path, TRUE);
+}
+
+/**
+ * egg_set_desktop_file_without_defaults:
+ * @desktop_file_path: path to the application's desktop file
+ *
+ * Creates an #EggDesktopFile for the application from the data at
+ * @desktop_file_path.
+ * See egg_set_desktop_file() for a variant of this function that
+ * sets the application name and default window icon from the information
+ * in the desktop file.
+ *
+ * Note that for thread safety reasons, this function can only
+ * be called once, and is mutually exclusive with calling
+ * egg_set_desktop_file().
+ **/
+void
+egg_set_desktop_file_without_defaults (const char *desktop_file_path)
+{
+  egg_set_desktop_file_internal (desktop_file_path, FALSE);
+}
+
+/**
  * egg_get_desktop_file:
  * 
  * Gets the application's #EggDesktopFile, as set by
diff --git a/src/eggdesktopfile.h b/src/eggdesktopfile.h
index f8a3d3e..18fe463 100644
--- a/src/eggdesktopfile.h
+++ b/src/eggdesktopfile.h
@@ -150,8 +150,9 @@ typedef enum {
 } EggDesktopFileError;
 
 /* Global application desktop file */
-void            egg_set_desktop_file (const char *desktop_file_path);
-EggDesktopFile *egg_get_desktop_file (void);
+void            egg_set_desktop_file                  (const char *desktop_file_path);
+void            egg_set_desktop_file_without_defaults (const char *desktop_file_path);
+EggDesktopFile *egg_get_desktop_file                  (void);
 
 
 G_END_DECLS
diff --git a/src/eggsmclient-1.patch b/src/eggsmclient-1.patch
index 7dcce88..8cbb77b 100644
--- a/src/eggsmclient-1.patch
+++ b/src/eggsmclient-1.patch
@@ -1,8 +1,11 @@
-From b134b02356a5811b504106c09e437f189c807f1f Mon Sep 17 00:00:00 2001
+From 4778f3a8c0f76d449b33115fca5bcc14feb51ae8 Mon Sep 17 00:00:00 2001
 From: Christian Persch <chpe gnome org>
 Date: Wed, 24 Sep 2008 13:33:57 +0200
-Subject: [PATCH] Add egg_sm_client_set_discard_command() to set the discard command when using egg_sm_client_set_restart_command(), to ease porting from GnomeClient without needing to support a new session file format.
+Subject: [PATCH] Add egg_sm_client_set_discard_command()
 
+Allows set the discard command when using
+egg_sm_client_set_restart_command(), to ease porting from GnomeClient
+without needing to support a new session file format.
 ---
  libegg/smclient/eggsmclient-xsmp.c |   49 ++++++++++++++++++++++++++++++-----
  libegg/smclient/eggsmclient.c      |   21 +++++++++++++++
@@ -10,7 +13,7 @@ Subject: [PATCH] Add egg_sm_client_set_discard_command() to set the discard comm
  3 files changed, 69 insertions(+), 7 deletions(-)
 
 diff --git a/libegg/smclient/eggsmclient-xsmp.c b/libegg/smclient/eggsmclient-xsmp.c
-index e4b11f6..dcaf36b 100644
+index 8bebfba..69f96f8 100644
 --- a/libegg/smclient/eggsmclient-xsmp.c
 +++ b/libegg/smclient/eggsmclient-xsmp.c
 @@ -88,6 +88,8 @@ struct _EggSMClientXSMP
@@ -103,7 +106,7 @@ index e4b11f6..dcaf36b 100644
        return;
      }
  
-@@ -1034,14 +1069,14 @@ xsmp_shutdown_cancelled (SmcConn   smc_conn,
+@@ -1041,14 +1076,14 @@ xsmp_shutdown_cancelled (SmcConn   smc_conn,
   * then free the array, but not its contents.
   */
  static GPtrArray *
@@ -120,7 +123,7 @@ index e4b11f6..dcaf36b 100644
  
    if (client_id)
      {
-@@ -1055,8 +1090,8 @@ generate_command (char **restart_command, const char *client_id,
+@@ -1062,8 +1097,8 @@ generate_command (char **restart_command, const char *client_id,
        g_ptr_array_add (cmd, (char *)state_file);
      }
  
@@ -188,5 +191,5 @@ index e620b75..f13bcec 100644
  /* Handling "quit_requested" signal */
  void             egg_sm_client_will_quit           (EggSMClient *client,
 -- 
-1.6.0.2.GIT
+1.6.2.2.471.g6da14
 
diff --git a/src/eggsmclient-xsmp.c b/src/eggsmclient-xsmp.c
index 81af7d2..69f96f8 100644
--- a/src/eggsmclient-xsmp.c
+++ b/src/eggsmclient-xsmp.c
@@ -1087,13 +1087,13 @@ generate_command (char **argv, const char *client_id,
 
   if (client_id)
     {
-      g_ptr_array_add (cmd, "--sm-client-id");
+      g_ptr_array_add (cmd, (char *)"--sm-client-id");
       g_ptr_array_add (cmd, (char *)client_id);
     }
 
   if (state_file)
     {
-      g_ptr_array_add (cmd, "--sm-client-state-file");
+      g_ptr_array_add (cmd, (char *)"--sm-client-state-file");
       g_ptr_array_add (cmd, (char *)state_file);
     }
 
@@ -1176,7 +1176,7 @@ array_prop (const char *name, ...)
 
   prop = g_new (SmProp, 1);
   prop->name = (char *)name;
-  prop->type = SmLISTofARRAY8;
+  prop->type = (char *)SmLISTofARRAY8;
 
   vals = g_array_new (FALSE, FALSE, sizeof (SmPropValue));
 
@@ -1210,7 +1210,7 @@ ptrarray_prop (const char *name, GPtrArray *values)
 
   prop = g_new (SmProp, 1);
   prop->name = (char *)name;
-  prop->type = SmLISTofARRAY8;
+  prop->type = (char *)SmLISTofARRAY8;
 
   vals = g_array_new (FALSE, FALSE, sizeof (SmPropValue));
 
@@ -1240,7 +1240,7 @@ string_prop (const char *name, const char *value)
 
   prop = g_new (SmProp, 1);
   prop->name = (char *)name;
-  prop->type = SmARRAY8;
+  prop->type = (char *)SmARRAY8;
 
   prop->num_vals = 1;
   prop->vals = g_new (SmPropValue, 1);
@@ -1265,7 +1265,7 @@ card8_prop (const char *name, unsigned char value)
 
   prop = g_new (SmProp, 1);
   prop->name = (char *)name;
-  prop->type = SmCARD8;
+  prop->type = (char *)SmCARD8;
 
   prop->num_vals = 1;
   prop->vals = g_new (SmPropValue, 2);
diff --git a/src/totem-session.c b/src/totem-session.c
index 4ffd845..f014c05 100644
--- a/src/totem-session.c
+++ b/src/totem-session.c
@@ -112,7 +112,7 @@ void
 totem_session_add_options (GOptionContext *context)
 {
 #ifdef GDK_WINDOWING_X11
-	egg_set_desktop_file (DATADIR "/applications/" PACKAGE ".desktop");
+	egg_set_desktop_file_without_defaults (DATADIR "/applications/" PACKAGE ".desktop");
 #endif
 
 	g_option_context_add_group (context, egg_sm_client_get_option_group ());



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