From: Dan Winship Date: Wed, 8 Apr 2009 22:14:07 +0000 (+0000) Subject: Fix the .desktop-file-as-state-file case; egg_desktop_file_get_source() X-Git-Tag: EVINCE_2_27_1~82 X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=0b4b34a6e304532dd2af2824936f09a9b74c5cbf;p=evince.git Fix the .desktop-file-as-state-file case; egg_desktop_file_get_source() 2009-04-08 Dan Winship * 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 --- diff --git a/ChangeLog b/ChangeLog index 54c53e03..1f1fdbe7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-04-08 Dan Winship + * 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 * configure.ac: diff --git a/cut-n-paste/smclient/eggsmclient-xsmp.c b/cut-n-paste/smclient/eggsmclient-xsmp.c index e4b11f62..1a56156c 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