diff options
author | Dan Winship <danw@gnome.org> | 2009-04-08 22:14:07 (GMT) |
---|---|---|
committer | Nickolay V. Shmyrev <nshmyrev@src.gnome.org> | 2009-04-08 22:14:07 (GMT) |
commit | 0b4b34a6e304532dd2af2824936f09a9b74c5cbf (patch) | |
tree | 5f7688fdfae84645bc6b1ad60203d4a5ccfa0ed2 | |
parent | a01fab9d01d6bd9fe2b479cbcbc7ee5fe7d69515 (diff) |
Fix the .desktop-file-as-state-file case; egg_desktop_file_get_source()
2009-04-08 Dan Winship <danw@gnome.org>
* cut-n-paste/smclient/eggsmclient-xsmp.c (save_state):
Fix the .desktop-file-as-state-file case;
egg_desktop_file_get_source() returns a URI, not a filename.
svn path=/trunk/; revision=3585
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | cut-n-paste/smclient/eggsmclient-xsmp.c | 13 |
2 files changed, 16 insertions, 3 deletions
@@ -1,3 +1,9 @@ +2009-04-08 Dan Winship <danw@gnome.org> + * cut-n-paste/smclient/eggsmclient-xsmp.c (save_state): + + Fix the .desktop-file-as-state-file case; + egg_desktop_file_get_source() returns a URI, not a filename. + 2009-04-08 Carlos Garcia Campos <carlosgc@gnome.org> * configure.ac: diff --git a/cut-n-paste/smclient/eggsmclient-xsmp.c b/cut-n-paste/smclient/eggsmclient-xsmp.c index e4b11f6..1a56156 100644 --- a/cut-n-paste/smclient/eggsmclient-xsmp.c +++ b/cut-n-paste/smclient/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 |