Author: kelnos
Date: 2008-11-06 11:20:12 +0000 (Thu, 06 Nov 2008)
New Revision: 28630

Modified:
   thunar/trunk/ChangeLog
   thunar/trunk/thunar/thunar-private.h
   thunar/trunk/thunar/thunar-shortcuts-model.c
   thunar/trunk/thunar/thunar-templates-action.c
   thunar/trunk/thunar/thunar-window.c
Log:
        * thunar/thunar-private.h,
          thunar/thunar-{shortcuts-model,templates-action,window}.c: Fix
          compilation with glib < 2.14.

Modified: thunar/trunk/ChangeLog
===================================================================
--- thunar/trunk/ChangeLog      2008-11-06 10:58:25 UTC (rev 28629)
+++ thunar/trunk/ChangeLog      2008-11-06 11:20:12 UTC (rev 28630)
@@ -1,3 +1,9 @@
+2008-11-06     Brian Tarricone <[EMAIL PROTECTED]>
+
+       * thunar/thunar-private.h,
+         thunar/thunar-{shortcuts-model,templates-action,window}.c: Fix
+         compilation with glib < 2.14.
+
 2008-11-05     Olivier Fourdan <[EMAIL PROTECTED]>
 
        * thunar/thunar-window.c: Remove portion including a C_() macro.

Modified: thunar/trunk/thunar/thunar-private.h
===================================================================
--- thunar/trunk/thunar/thunar-private.h        2008-11-06 10:58:25 UTC (rev 
28629)
+++ thunar/trunk/thunar/thunar-private.h        2008-11-06 11:20:12 UTC (rev 
28630)
@@ -107,7 +107,9 @@
 #define THUNAR_USER_DIRECTORY_VIDEOS       G_USER_DIRECTORY_VIDEOS
 #define THUNAR_USER_N_DIRECTORIES          (8)
 
+#if GLIB_CHECK_VERSION(2, 14, 0)
 gchar *_thunar_get_xdg_user_dirs_locale (void);
+#endif
 extern const gchar *_thunar_user_directory_names[THUNAR_USER_N_DIRECTORIES+1];
 
 #else /* GLIB_CHECK_VERSION(2,14,0) */

Modified: thunar/trunk/thunar/thunar-shortcuts-model.c
===================================================================
--- thunar/trunk/thunar/thunar-shortcuts-model.c        2008-11-06 10:58:25 UTC 
(rev 28629)
+++ thunar/trunk/thunar/thunar-shortcuts-model.c        2008-11-06 11:20:12 UTC 
(rev 28630)
@@ -309,6 +309,7 @@
   /* append the system defined items ('Home', 'Trash', 'File System') */
   for (n = 0; n < G_N_ELEMENTS (system_path_list); ++n)
     {
+#if GLIB_CHECK_VERSION(2, 14, 0)
       /* we exclude the desktop if it points to home */
       if (n == desktop_index
           && exo_str_is_equal (g_get_user_special_dir 
(G_USER_DIRECTORY_DESKTOP),
@@ -317,6 +318,7 @@
           thunar_vfs_path_unref (system_path_list[n]);
           continue;
         }
+#endif
 
       /* determine the file for the path */
       file = thunar_file_get_for_path (system_path_list[n], NULL);
@@ -800,6 +802,7 @@
     }
 }
 
+#if GLIB_CHECK_VERSION(2, 14, 0)
 /* Reads the current xdg user dirs locale from ~/.config/xdg-user-dirs.locale
  * Notice that the result shall be freed by using g_free (). */
 gchar *
@@ -828,6 +831,7 @@
 
   return locale;
 }
+#endif
 
 static void
 thunar_shortcuts_model_load (ThunarShortcutsModel *model)

Modified: thunar/trunk/thunar/thunar-templates-action.c
===================================================================
--- thunar/trunk/thunar/thunar-templates-action.c       2008-11-06 10:58:25 UTC 
(rev 28629)
+++ thunar/trunk/thunar/thunar-templates-action.c       2008-11-06 11:20:12 UTC 
(rev 28630)
@@ -382,11 +382,13 @@
 
   thunar_vfs_path_unref (home_path);
 
+#if GLIB_CHECK_VERSION(2, 14, 0)
   if (!exo_str_is_equal (g_get_user_special_dir (G_USER_DIRECTORY_TEMPLATES), 
xfce_get_homedir ()))
     {
       /* fill the menu with files/folders from the ~/Templates folder */
       thunar_templates_action_fill_menu (templates_action, templates_path, 
menu);
     }
+#endif
 
   /* check if any items were added to the menu */
   if (G_UNLIKELY (GTK_MENU_SHELL (menu)->children == NULL))

Modified: thunar/trunk/thunar/thunar-window.c
===================================================================
--- thunar/trunk/thunar/thunar-window.c 2008-11-06 10:58:25 UTC (rev 28629)
+++ thunar/trunk/thunar/thunar-window.c 2008-11-06 11:20:12 UTC (rev 28630)
@@ -608,11 +608,19 @@
 thunar_window_setup_user_dir_menu_entries (ThunarWindow *window)
 {
   gint i;
+  static const gchar *callback_names[] = {
+    "open-desktop", "open-documents", "open-downloads", "open-music",
+    "open-pictures", "open-public", "open-templates", "open-videos"
+  };
 
 #if !GLIB_CHECK_VERSION(2, 14, 0)
 
-  for (i = 0; i < THUNAR_USER_N_DIRECTORIES; i++)
-    gtk_action_set_visible (GTK_ACTION (action), FALSE);
+  for (i = 0; i < G_N_ELEMENTS(callback_names); i++)
+    {
+      GtkAction *action = gtk_action_group_get_action (window->action_group,
+                                                       callback_names[i]);
+      gtk_action_set_visible (GTK_ACTION (action), FALSE);
+    }
 
 #else  /* GLIB_CHECK_VERSION(2, 14, 0) */
 
@@ -621,10 +629,6 @@
   gchar *translation    = NULL;
   /* gchar *dir_name       = NULL;  */  // see below
   const gchar *home_dir = NULL;
-  static const gchar *callback_names[] = {
-    "open-desktop", "open-documents", "open-downloads", "open-music",
-    "open-pictures", "open-public", "open-templates", "open-videos"
-  };
 
   bindtextdomain (XDG_USER_DIRS_PACKAGE, PACKAGE_LOCALE_DIR);
 #ifdef HAVE_BIND_TEXTDOMAIN_CODESET

_______________________________________________
Xfce4-commits mailing list
Xfce4-commits@xfce.org
http://foo-projects.org/mailman/listinfo/xfce4-commits

Reply via email to