[Nautilus-list] [PATCH] XFS Trashcan problem



I hope I did this right, this is my first patch, so it might not be
formatted correctly.

These patches fix the problem with the trashcan on XFS filesystems.
--- libnautilus-private/nautilus-volume-monitor.c	Thu May 10 21:30:31 2001
+++ ../nautilus-1.0.3.1/libnautilus-private/nautilus-volume-monitor.c.new	Tue May 22 23:36:07 2001
@@ -179,6 +179,7 @@
 static void            get_reiser_volume_name                   (NautilusVolume             *volume);
 static void            get_ufs_volume_name                      (NautilusVolume             *volume);
 static void            get_generic_volume_name                  (NautilusVolume             *volume);
+static void            get_xfs_volume_name                      (NautilusVolume             *volume);
 static void            mount_volume_get_name                    (NautilusVolume             *volume);
 static void            mount_volume_activate                    (NautilusVolumeMonitor      *view,
 								 NautilusVolume             *volume);
@@ -647,7 +648,8 @@
 		|| volume->volume_type == NAUTILUS_VOLUME_VFAT
 		|| volume->volume_type == NAUTILUS_VOLUME_REISER
 		|| volume->volume_type == NAUTILUS_VOLUME_UFS
-		|| volume->volume_type == NAUTILUS_VOLUME_SMB;
+		|| volume->volume_type == NAUTILUS_VOLUME_SMB
+		|| volume->volume_type == NAUTILUS_VOLUME_XFS;
 }
 
 const char *
@@ -772,6 +774,11 @@
 }
 
 static void
+mount_volume_activate_xfs (NautilusVolumeMonitor *view, NautilusVolume *volume)
+{
+}
+
+static void
 mount_volume_activate_generic (NautilusVolumeMonitor *view, NautilusVolume *volume)
 {	
 }
@@ -825,6 +832,9 @@
 	case NAUTILUS_VOLUME_XIAFS:
 		get_generic_volume_name (volume);
 		break;
+	case NAUTILUS_VOLUME_XFS:
+		get_xfs_volume_name (volume);
+		break;
 		
 	default:
 		g_assert_not_reached ();
@@ -857,7 +867,11 @@
 	case NAUTILUS_VOLUME_NFS:
 		mount_volume_activate_nfs (monitor, volume);		
 		break;
-		
+
+	case NAUTILUS_VOLUME_XFS:
+		mount_volume_activate_xfs (monitor, volume);
+		break;	
+
 	case NAUTILUS_VOLUME_AFFS:
 	case NAUTILUS_VOLUME_FAT:
 	case NAUTILUS_VOLUME_HPFS:
@@ -872,7 +886,7 @@
 	case NAUTILUS_VOLUME_XIAFS:
 		mount_volume_activate_generic (monitor, volume);
 		break;
-		
+
 	default:
 		g_assert_not_reached ();
 		break;
@@ -1454,6 +1468,16 @@
 	return TRUE;
 }
 
+static gboolean
+mount_volume_xfs_add (NautilusVolume *volume)
+{
+	volume->volume_type = NAUTILUS_VOLUME_XFS;
+	volume->device_type = NAUTILUS_DEVICE_UNKNOWN;	
+
+	return TRUE;
+}
+
+
 static void
 find_volumes (NautilusVolumeMonitor *monitor)
 {
@@ -1967,6 +1991,20 @@
 	}
 }
 
+static void
+get_xfs_volume_name (NautilusVolume *volume)
+{
+	char *name;
+	
+	name = strrchr (volume->mount_path, '/');
+	if (name != NULL) {
+		name++;
+		volume->volume_name = g_strdup (name);
+		modify_volume_name_for_display (volume);
+	} else {
+		volume->volume_name = g_strdup (_("XFS Volume"));
+	}
+}
 
 static void
 load_additional_mount_list_info (GList *volume_list)
@@ -2038,6 +2076,8 @@
 		added = mount_volume_xenix_add (volume);
 	} else if (strcmp (volume->filesystem, "xiafs") == 0) {
 		added = mount_volume_xiafs_add (volume);
+	} else if (strcmp (volume->filesystem, "xfs") == 0) {
+		added = mount_volume_xfs_add (volume);
 	}
 
 	if (added) {
--- libnautilus-private/nautilus-volume-monitor.h	Mon Apr 30 22:11:14 2001
+++ ../nautilus-1.0.3.1/libnautilus-private/nautilus-volume-monitor.h.new	Tue May 22 23:36:16 2001
@@ -77,6 +77,7 @@
 	NAUTILUS_VOLUME_VFAT,
 	NAUTILUS_VOLUME_XENIX,
 	NAUTILUS_VOLUME_XIAFS,
+	NAUTILUS_VOLUME_XFS,
 	NAUTILUS_VOLUME_UNKNOWN
 } NautilusVolumeType;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]