[Xfce4-commits] <thunar:master> Allow editing desktop that are empty.

Nick Schermer noreply at xfce.org
Fri Sep 28 20:40:01 CEST 2012


Updating branch refs/heads/master
         to 1c0e847306b687ae6ca7de7ac6d374d24e0a37b9 (commit)
       from b1599bc6b8fd64588468d88387e1ea20bcbe889d (commit)

commit 1c0e847306b687ae6ca7de7ac6d374d24e0a37b9
Author: Nick Schermer <nick at xfce.org>
Date:   Fri Sep 28 20:38:33 2012 +0200

    Allow editing desktop that are empty.

 plugins/thunar-apr/thunar-apr-desktop-page.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/plugins/thunar-apr/thunar-apr-desktop-page.c b/plugins/thunar-apr/thunar-apr-desktop-page.c
index b525b90..d90ab37 100644
--- a/plugins/thunar-apr/thunar-apr-desktop-page.c
+++ b/plugins/thunar-apr/thunar-apr-desktop-page.c
@@ -557,7 +557,7 @@ thunar_apr_desktop_page_save (ThunarAprDesktopPage *desktop_page,
 
       /* determine the content of the key file */
       data = g_key_file_to_data (key_file, &data_length, &error);
-      if (G_LIKELY (data != NULL))
+      if (G_LIKELY (data_length > 0))
         {
           /* try to save the key file content to disk */
           fp = fopen (filename, "w");
@@ -571,10 +571,10 @@ thunar_apr_desktop_page_save (ThunarAprDesktopPage *desktop_page,
             {
               error = g_error_new_literal (G_FILE_ERROR, g_file_error_from_errno (errno), g_strerror (errno));
             }
-
-          /* cleanup */
-          g_free (data);
         }
+
+      /* cleanup */
+      g_free (data);
     }
 
   /* check if we succeed */


More information about the Xfce4-commits mailing list