[Xfce4-commits] r29816 - in thunar/branches/migration-to-gio: . thunar

Jannis Pohlmann jannis at xfce.org
Wed Apr 15 00:45:21 CEST 2009


Author: jannis
Date: 2009-04-14 22:45:20 +0000 (Tue, 14 Apr 2009)
New Revision: 29816

Modified:
   thunar/branches/migration-to-gio/ChangeLog
   thunar/branches/migration-to-gio/thunar/thunar-standard-view.c
Log:
	* thunar/thunar-standard-view.c: Use GFile instead of ThunarVfsPath in
	  thunar_standard_view_drag_drop().

Modified: thunar/branches/migration-to-gio/ChangeLog
===================================================================
--- thunar/branches/migration-to-gio/ChangeLog	2009-04-14 22:32:29 UTC (rev 29815)
+++ thunar/branches/migration-to-gio/ChangeLog	2009-04-14 22:45:20 UTC (rev 29816)
@@ -1,5 +1,10 @@
 2009-04-15	Jannis Pohlmann <jannis at xfce.org>
 
+	* thunar/thunar-standard-view.c: Use GFile instead of ThunarVfsPath in
+	  thunar_standard_view_drag_drop(). 
+
+2009-04-15	Jannis Pohlmann <jannis at xfce.org>
+
 	* thunar/thunar-preferences.c, thunar/thunar-sendto-model.c,
 	  thunar/thunar-shortcuts-model.c: Check whether the created file
 	  monitor is != NULL before connecting to its "changed" signal.

Modified: thunar/branches/migration-to-gio/thunar/thunar-standard-view.c
===================================================================
--- thunar/branches/migration-to-gio/thunar/thunar-standard-view.c	2009-04-14 22:32:29 UTC (rev 29815)
+++ thunar/branches/migration-to-gio/thunar/thunar-standard-view.c	2009-04-14 22:45:20 UTC (rev 29816)
@@ -2489,12 +2489,12 @@
                                 guint               time,
                                 ThunarStandardView *standard_view)
 {
-  ThunarVfsPath *path;
-  ThunarFile    *file = NULL;
-  GdkAtom        target;
-  guchar        *prop_text;
-  gint           prop_len;
-  gchar         *uri = NULL;
+  ThunarFile *file = NULL;
+  GdkAtom     target;
+  guchar     *prop_text;
+  GFile      *path;
+  gchar      *uri = NULL;
+  gint        prop_len;
 
   target = gtk_drag_dest_find_target (view, context, NULL);
   if (G_UNLIKELY (target == GDK_NONE))
@@ -2521,10 +2521,11 @@
               if (G_LIKELY (*prop_text != '\0' && strchr ((const gchar *) prop_text, G_DIR_SEPARATOR) == NULL))
                 {
                   /* allocate the relative path for the target */
-                  path = thunar_vfs_path_relative (thunar_file_get_path (file), (const gchar *) prop_text);
+                  path = g_file_resolve_relative_path (thunar_file_get_file (file), 
+                                                       (const gchar *)prop_text);
 
                   /* determine the new URI */
-                  uri = thunar_vfs_path_dup_uri (path);
+                  uri = g_file_get_uri (path);
 
                   /* setup the property */
                   gdk_property_change (GDK_DRAWABLE (context->source_window),
@@ -2534,7 +2535,7 @@
                                        strlen (uri));
 
                   /* cleanup */
-                  thunar_vfs_path_unref (path);
+                  g_object_unref (path);
                   g_free (uri);
                 }
               else
@@ -2683,7 +2684,7 @@
                   if (G_LIKELY (file != NULL))
                     {
                       /* determine the absolute path to the target directory */
-                      working_directory = thunar_vfs_path_dup_string (thunar_file_get_path (file));
+                      working_directory = g_file_get_uri (thunar_file_get_file (file));
 
                       /* prepare the basic part of the command */
                       argv[n++] = "exo-desktop-item-edit";
@@ -2828,8 +2829,13 @@
           file = thunar_standard_view_get_drop_file (standard_view, x, y, &path);
 
           /* check if we can save here */
-          if (G_LIKELY (file != NULL && thunar_file_is_local (file) && thunar_file_is_directory (file) && thunar_file_is_writable (file)))
-            action = context->suggested_action;
+          if (G_LIKELY (file != NULL 
+                        && thunar_file_is_local (file) 
+                        && thunar_file_is_directory (file) 
+                        && thunar_file_is_writable (file)))
+            {
+              action = context->suggested_action;
+            }
 
           /* reset path if we cannot drop */
           if (G_UNLIKELY (action == 0 && path != NULL))




More information about the Xfce4-commits mailing list