[Xfce4-commits] r29825 - thunar/branches/migration-to-gio/thunar

Jannis Pohlmann jannis at xfce.org
Fri Apr 17 00:23:13 CEST 2009


Author: jannis
Date: 2009-04-16 22:23:12 +0000 (Thu, 16 Apr 2009)
New Revision: 29825

Modified:
   thunar/branches/migration-to-gio/thunar/thunar-clipboard-manager.c
   thunar/branches/migration-to-gio/thunar/thunar-dbus-service.c
Log:
	* thunar/thunar-clipboard-manager.c: Remove GTK+ 2.6 check.
	* thunar/thunar-dbus-service.c: Replace ThunarVfsPath with GFile in
	  thunar_dbus_service_connect_trash_bin() and
	  thunar_dbus_service_display_folder_and_select().

Modified: thunar/branches/migration-to-gio/thunar/thunar-clipboard-manager.c
===================================================================
--- thunar/branches/migration-to-gio/thunar/thunar-clipboard-manager.c	2009-04-16 22:23:08 UTC (rev 29824)
+++ thunar/branches/migration-to-gio/thunar/thunar-clipboard-manager.c	2009-04-16 22:23:12 UTC (rev 29825)
@@ -345,13 +345,9 @@
       if (G_UNLIKELY (!path_copy))
         gtk_clipboard_clear (manager->clipboard);
 
-      /* check the contents of the clipboard again
-       * if either the Xserver or our GTK+ version
-       * doesn't support the XFixes extension.
-       */
-#if GTK_CHECK_VERSION(2,6,0)
+      /* check the contents of the clipboard again if either the Xserver or 
+       * our GTK+ version doesn't support the XFixes extension */
       if (!gdk_display_supports_selection_notification (gtk_clipboard_get_display (manager->clipboard)))
-#endif
         {
           thunar_clipboard_manager_owner_changed (manager->clipboard, NULL, manager);
         }

Modified: thunar/branches/migration-to-gio/thunar/thunar-dbus-service.c
===================================================================
--- thunar/branches/migration-to-gio/thunar/thunar-dbus-service.c	2009-04-16 22:23:08 UTC (rev 29824)
+++ thunar/branches/migration-to-gio/thunar/thunar-dbus-service.c	2009-04-16 22:23:12 UTC (rev 29825)
@@ -1,6 +1,7 @@
 /* $Id$ */
 /*-
  * Copyright (c) 2006 Benedikt Meurer <benny at xfce.org>
+ * Copyright (c) 2009 Jannis Pohlmann <jannis at xfce.org>
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the Free
@@ -252,14 +253,14 @@
 thunar_dbus_service_connect_trash_bin (ThunarDBusService *dbus_service,
                                        GError           **error)
 {
-  ThunarVfsPath *trash_bin_path;
+  GFile *trash_bin_path;
 
   /* check if we're not already connected to the trash bin */
   if (G_UNLIKELY (dbus_service->trash_bin == NULL))
     {
       /* try to connect to the trash bin */
-      trash_bin_path = thunar_vfs_path_get_for_trash ();
-      dbus_service->trash_bin = thunar_file_get_for_path (trash_bin_path, error);
+      trash_bin_path = g_file_new_for_trash ();
+      dbus_service->trash_bin = thunar_file_get (trash_bin_path, error);
       if (G_LIKELY (dbus_service->trash_bin != NULL))
         {
           /* watch the trash bin for changes */
@@ -270,7 +271,7 @@
                                     G_CALLBACK (thunar_dbus_service_trash_bin_changed),
                                     dbus_service);
         }
-      thunar_vfs_path_unref (trash_bin_path);
+      g_object_unref (trash_bin_path);
     }
 
   return (dbus_service->trash_bin != NULL);
@@ -380,11 +381,11 @@
                                                GError           **error)
 {
   ThunarApplication *application;
-  ThunarVfsPath     *path;
   ThunarFile        *file;
   ThunarFile        *folder;
   GdkScreen         *screen;
   GtkWidget         *window;
+  GFile             *path;
 
   /* verify that filename is valid */
   if (G_UNLIKELY (filename == NULL || *filename == '\0' || strchr (filename, '/') != NULL))
@@ -400,30 +401,30 @@
   /* popup a new window for the folder */
   application = thunar_application_get ();
   window = thunar_application_open_window (application, folder, screen);
-  g_object_unref (G_OBJECT (application));
+  g_object_unref (application);
 
   /* determine the path for the filename relative to the folder */
-  path = thunar_vfs_path_relative (thunar_file_get_path (folder), filename);
+  path = g_file_resolve_relative_path (thunar_file_get_file (folder), filename);
   if (G_LIKELY (path != NULL))
     {
       /* try to determine the file for the path */
-      file = thunar_file_get_for_path (path, NULL);
+      file = thunar_file_get (path, NULL);
       if (G_LIKELY (file != NULL))
         {
           /* tell the window to scroll to the given file and select it */
           thunar_window_scroll_to_file (THUNAR_WINDOW (window), file, TRUE, TRUE, 0.5f, 0.5f);
 
           /* release the file reference */
-          g_object_unref (G_OBJECT (file));
+          g_object_unref (file);
         }
 
       /* release the path */
-      thunar_vfs_path_unref (path);
+      g_object_unref (path);
     }
 
   /* cleanup */
-  g_object_unref (G_OBJECT (screen));
-  g_object_unref (G_OBJECT (folder));
+  g_object_unref (screen);
+  g_object_unref (folder);
 
   return TRUE;
 }




More information about the Xfce4-commits mailing list