[Goodies-commits] r2649 - in xfce4-places-plugin/branches/volumes: . panel-plugin

Diego Ongaro ongardie at xfce.org
Mon Apr 2 03:56:56 CEST 2007


Author: ongardie
Date: 2007-04-02 01:56:56 +0000 (Mon, 02 Apr 2007)
New Revision: 2649

Modified:
   xfce4-places-plugin/branches/volumes/configure.ac
   xfce4-places-plugin/branches/volumes/panel-plugin/Makefile.am
   xfce4-places-plugin/branches/volumes/panel-plugin/places.c
Log:
Places: started playing with the ThunarVfsVolumeManager API.


Modified: xfce4-places-plugin/branches/volumes/configure.ac
===================================================================
--- xfce4-places-plugin/branches/volumes/configure.ac	2007-04-02 00:49:42 UTC (rev 2648)
+++ xfce4-places-plugin/branches/volumes/configure.ac	2007-04-02 01:56:56 UTC (rev 2649)
@@ -27,6 +27,7 @@
 XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.3.99.1])
 XDT_CHECK_PACKAGE([LIBXFCEGUI4], [libxfcegui4-1.0], [4.3.99.1])
 XDT_CHECK_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-1.0], [4.3.99.1])
+XDT_CHECK_PACKAGE([THUNAR_VFS], [thunar-vfs-1], [0.4.0])
 
 XDT_FEATURE_DEBUG()
 

Modified: xfce4-places-plugin/branches/volumes/panel-plugin/Makefile.am
===================================================================
--- xfce4-places-plugin/branches/volumes/panel-plugin/Makefile.am	2007-04-02 00:49:42 UTC (rev 2648)
+++ xfce4-places-plugin/branches/volumes/panel-plugin/Makefile.am	2007-04-02 01:56:56 UTC (rev 2649)
@@ -20,12 +20,14 @@
 	$(LIBXFCE4UTIL_CFLAGS)						\
 	$(LIBXFCEGUI4_CFLAGS)						\
 	$(LIBXFCE4PANEL_CFLAGS)						\
+        $(THUNAR_VFS_CFLAGS)						\
 	$(PLATFORM_CFLAGS)
 
 xfce4_places_plugin_LDADD =						\
 	$(LIBXFCE4UTIL_LIBS)						\
 	$(LIBXFCEGUI4_LIBS)						\
-	$(LIBXFCE4PANEL_LIBS)
+	$(LIBXFCE4PANEL_LIBS)						\
+	@THUNAR_VFS_LIBS@
 
 #
 # Desktop file

Modified: xfce4-places-plugin/branches/volumes/panel-plugin/places.c
===================================================================
--- xfce4-places-plugin/branches/volumes/panel-plugin/places.c	2007-04-02 00:49:42 UTC (rev 2648)
+++ xfce4-places-plugin/branches/volumes/panel-plugin/places.c	2007-04-02 01:56:56 UTC (rev 2649)
@@ -30,6 +30,7 @@
 #include <libxfce4panel/xfce-hvbox.h>
 #include <libxfce4panel/xfce-panel-convenience.h>
 #include <libxfcegui4/libxfcegui4.h>
+#include <thunar-vfs/thunar-vfs.h>
 
 #include "places.h"
 #include "unescape_uri.c"
@@ -51,11 +52,51 @@
 /********** Initialization **********/
 XFCE_PANEL_PLUGIN_REGISTER_EXTERNAL(places_construct);
 
+static void places_volumes_dev()
+{
+    thunar_vfs_init();
+
+    ThunarVfsVolume* volume;
+    ThunarVfsVolumeStatus status;
+    ThunarVfsPath* mount_point;
+    gchar* path;
+
+    ThunarVfsVolumeManager* volume_man = thunar_vfs_volume_manager_get_default();
+    const GList* volumes = thunar_vfs_volume_manager_get_volumes(volume_man);
+    
+    while(volumes){
+        volume = THUNAR_VFS_VOLUME(volumes->data);
+        DBG("Volume");
+        DBG("  Name: %s", thunar_vfs_volume_get_name(volume));
+        //DBG("  Kind: %d", thunar_vfs_volume_get_kind(volume));
+        
+        mount_point = thunar_vfs_volume_get_mount_point(volume);
+        path = thunar_vfs_path_dup_uri(mount_point);
+        DBG("  Path: %s", path);
+        g_free(path);
+
+        status = thunar_vfs_volume_get_status(volume);
+        DBG("  Mounted? %x", status & 1);
+        //DBG("  Mounted? %x", thunar_vfs_volume_is_mounted(volume));
+        DBG("  Present? %x", status & 2);
+        DBG("  Removable? %x", thunar_vfs_volume_is_removable(volume));
+        DBG("  Icon: %s", thunar_vfs_volume_lookup_icon_name(volume, gtk_icon_theme_get_default()));
+
+        volumes = volumes->next;
+    }
+    
+    g_object_unref(volume_man);
+
+    thunar_vfs_shutdown();
+}
+
 static void 
 places_construct(XfcePanelPlugin *plugin)
 {
     DBG ("Construct: %s", PLUGIN_NAME);
 
+    places_volumes_dev();
+
     PlacesData *pd = panel_slice_new0(PlacesData);
     pd->plugin = plugin;
     places_init_bookmarks(pd);




More information about the Goodies-commits mailing list