[Xfce4-commits] <thunar:master> Set desktop type in empty desktop files.

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


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

commit 28cf90311c3f8b66211838867f1a256d863d4bec
Author: Nick Schermer <nick at xfce.org>
Date:   Fri Sep 28 20:49:27 2012 +0200

    Set desktop type in empty desktop files.

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

diff --git a/plugins/thunar-apr/thunar-apr-desktop-page.c b/plugins/thunar-apr/thunar-apr-desktop-page.c
index d90ab37..069cd4b 100644
--- a/plugins/thunar-apr/thunar-apr-desktop-page.c
+++ b/plugins/thunar-apr/thunar-apr-desktop-page.c
@@ -555,6 +555,16 @@ thunar_apr_desktop_page_save (ThunarAprDesktopPage *desktop_page,
       /* save the widget changes to the key file */
       thunar_apr_desktop_page_save_widget (desktop_page, widget, key_file);
 
+      /* give empty desktop files a type */
+      if (!g_key_file_has_key (key_file, G_KEY_FILE_DESKTOP_GROUP,
+                               G_KEY_FILE_DESKTOP_KEY_TYPE, NULL))
+        {
+          g_key_file_set_string (key_file,
+                                 G_KEY_FILE_DESKTOP_GROUP,
+                                 G_KEY_FILE_DESKTOP_KEY_TYPE,
+                                 "Application");
+        }
+
       /* determine the content of the key file */
       data = g_key_file_to_data (key_file, &data_length, &error);
       if (G_LIKELY (data_length > 0))


More information about the Xfce4-commits mailing list