summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2009-04-08 23:28:28 +0000
committerCosimo Cecchi <cosimoc@src.gnome.org>2009-04-08 23:28:28 +0000
commit672daf9d853385d416c8885f81ba55097e4c300d (patch)
treec9820765b32aa124336331bb6c371e47657a7c6b
parentaf3eb62a4ae43276a9c6724a43222d76a989e32b (diff)
downloadnautilus-672daf9d853385d416c8885f81ba55097e4c300d.tar.gz
Update the EggSMClient code from libegg trunk.
2009-04-09 Cosimo Cecchi <cosimoc@gnome.org> * cut-n-paste-code/libegg/eggsmclient-xsmp.c: (save_state), (set_properties), (ptrarray_prop): * cut-n-paste-code/libegg/eggsmclient.c: (egg_sm_client_get_option_group): Update the EggSMClient code from libegg trunk. svn path=/trunk/; revision=15174
-rw-r--r--ChangeLog8
-rw-r--r--cut-n-paste-code/libegg/eggsmclient-xsmp.c19
-rw-r--r--cut-n-paste-code/libegg/eggsmclient.c47
3 files changed, 48 insertions, 26 deletions
diff --git a/ChangeLog b/ChangeLog
index 37a23cd25..192742400 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2009-04-09 Cosimo Cecchi <cosimoc@gnome.org>
+
+ * cut-n-paste-code/libegg/eggsmclient-xsmp.c: (save_state),
+ (set_properties), (ptrarray_prop):
+ * cut-n-paste-code/libegg/eggsmclient.c:
+ (egg_sm_client_get_option_group):
+ Update the EggSMClient code from libegg trunk.
+
2009-04-08 Cosimo Cecchi <cosimoc@gnome.org>
* cut-n-paste-code/libegg/eggtreemultidnd.c:
diff --git a/cut-n-paste-code/libegg/eggsmclient-xsmp.c b/cut-n-paste-code/libegg/eggsmclient-xsmp.c
index 86dfdb74f..1a56156ce 100644
--- a/cut-n-paste-code/libegg/eggsmclient-xsmp.c
+++ b/cut-n-paste-code/libegg/eggsmclient-xsmp.c
@@ -795,14 +795,18 @@ 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))
{
- int g, k, i;
+ guint g, k, i;
char **groups, **keys, *value, *exec;
groups = g_key_file_get_groups (state_file, 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
@@ -1071,7 +1078,7 @@ set_properties (EggSMClientXSMP *xsmp, ...)
GPtrArray *props;
SmProp *prop;
va_list ap;
- int i;
+ guint i;
props = g_ptr_array_new ();
@@ -1164,7 +1171,7 @@ ptrarray_prop (const char *name, GPtrArray *values)
SmProp *prop;
SmPropValue pv;
GArray *vals;
- int i;
+ guint i;
prop = g_new (SmProp, 1);
prop->name = (char *)name;
diff --git a/cut-n-paste-code/libegg/eggsmclient.c b/cut-n-paste-code/libegg/eggsmclient.c
index b24968dad..efa901d53 100644
--- a/cut-n-paste-code/libegg/eggsmclient.c
+++ b/cut-n-paste-code/libegg/eggsmclient.c
@@ -38,7 +38,7 @@ enum {
LAST_SIGNAL
};
-static guint signals[LAST_SIGNAL] = { 0 };
+static guint signals[LAST_SIGNAL];
struct _EggSMClientPrivate {
GKeyFile *state_file;
@@ -178,23 +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 GOptionEntry entries[] = {
- { "sm-client-disable", 0, 0,
- G_OPTION_ARG_NONE, &sm_client_disable,
- N_("Disable connection to session manager"), NULL },
- { "sm-client-state-file", 0, 0,
- G_OPTION_ARG_STRING, &sm_client_state_file,
- N_("Specify file containing saved configuration"), N_("FILE") },
- { "sm-client-id", 0, 0,
- G_OPTION_ARG_STRING, &sm_client_id,
- N_("Specify session management ID"), N_("ID") },
- /* Compatibility options */
- { "sm-disable", 0, G_OPTION_FLAG_HIDDEN,
- G_OPTION_ARG_NONE, &sm_client_disable,
- NULL, NULL },
- { NULL }
-};
+static char *sm_config_prefix = NULL;
static gboolean
sm_client_post_parse_func (GOptionContext *context,
@@ -235,6 +219,29 @@ sm_client_post_parse_func (GOptionContext *context,
GOptionGroup *
egg_sm_client_get_option_group (void)
{
+ const GOptionEntry entries[] = {
+ { "sm-client-disable", 0, 0,
+ G_OPTION_ARG_NONE, &sm_client_disable,
+ N_("Disable connection to session manager"), NULL },
+ { "sm-client-state-file", 0, 0,
+ G_OPTION_ARG_FILENAME, &sm_client_state_file,
+ N_("Specify file containing saved configuration"), N_("FILE") },
+ { "sm-client-id", 0, 0,
+ G_OPTION_ARG_STRING, &sm_client_id,
+ N_("Specify session management ID"), N_("ID") },
+ /* 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;
/* Use our own debug handler for the "EggSMClient" domain. */
@@ -242,8 +249,8 @@ egg_sm_client_get_option_group (void)
egg_sm_client_debug_handler, NULL);
group = g_option_group_new ("sm-client",
- _("Session Management Options"),
- _("Show Session Management options"),
+ _("Session management options:"),
+ _("Show session management options"),
NULL, NULL);
g_option_group_add_entries (group, entries);
g_option_group_set_parse_hooks (group, NULL, sm_client_post_parse_func);