Patch: supermount support



Ok, here is patch for supermount support (bug 48090)

It is a bit ugly, due to supermount nature => when "umounting"
supermount devices, only eject command is started..

Comments (or OK to commit) are welcome..
-- 
Frédéric Crozat
MandrakeSoft
--- ChangeLog	29 Jun 2002 03:58:33 -0000	1.5398
+++ ChangeLog	1 Jul 2002 12:30:25 -0000
@@ -1,3 +1,14 @@
+2002-07-01  Frederic Crozat  <fcrozat mandrakesoft com>
+
+	* libnautilus-private/filesystem-attributes.xml:
+	* libnautilus-private/nautilus-volume-monitor.c:
+	(has_removable_mntent_options), (get_removable_volumes),
+	(volume_is_removable), (get_mount_list),
+	(nautilus_volume_monitor_mount_unmount_removable):
+	* src/file-manager/fm-desktop-icon-view.c:
+	(create_unique_volume_name):
+	Add supermount support (bug #48090)
+
 2002-06-29  Gregory Merchan  <merchan phys lsu edu>
 
 	* src/nautilus-desktop-window.c:
--- libnautilus-private/filesystem-attributes.xml	25 Jun 2002 05:22:05 -0000	1.6
+++ libnautilus-private/filesystem-attributes.xml	1 Jul 2002 12:30:25 -0000
@@ -21,6 +21,7 @@
     <filesystem name="proc"     _default_volume_name="System Volume"/>
     <filesystem name="reiserfs" _default_volume_name="ReiserFS Linux Volume" trash="yes"/>
     <filesystem name="smbfs"    _default_volume_name="Windows Shared Volume" trash="yes"/>
+    <filesystem name="supermount"      _default_volume_name="SuperMount Volume" />
     <filesystem name="udf"      _default_volume_name="DVD Volume"/>
     <filesystem name="ufs"      _default_volume_name="Solaris/BSD Volume" trash="yes"/>
     <filesystem name="udfs"     _default_volume_name="Udfs Solaris Volume" trash="yes"/>
--- libnautilus-private/nautilus-volume-monitor.c	28 Jun 2002 10:59:06 -0000	1.131
+++ libnautilus-private/nautilus-volume-monitor.c	1 Jul 2002 12:30:26 -0000
@@ -493,7 +493,8 @@
 	/* Use "owner" or "user" or "users" as our way of determining a removable volume */
 	if (hasmntopt (ent, "user") != NULL
 	    || hasmntopt (ent, "users") != NULL
-	    || hasmntopt (ent, "owner") != NULL) {
+	    || hasmntopt (ent, "owner") != NULL
+	    || eel_strcmp ("supermount", ent->mnt_type) == 0) {
 		return TRUE;
 	}
 #endif
@@ -563,7 +564,16 @@
 #elif defined (HAVE_MNTENT_H)
 	while ((ent = getmntent (file)) != NULL) {
 		if (has_removable_mntent_options (ent)) {
+#if defined (HAVE_HASMNTOPT)
+			if (eel_strcmp ("supermount", ent->mnt_type) == 0) {
+				volume = create_volume (eel_str_strip_substring_and_after (hasmntopt(ent, "dev"), ",") + strlen("dev="), 
+							ent->mnt_dir);
+			} else {
+#endif
 			volume = create_volume (ent->mnt_fsname, ent->mnt_dir);
+#if defined (HAVE_HASMNTOPT)
+			}
+#endif
 			volumes = finish_creating_volume_and_prepend
 				(monitor, volume, ent->mnt_type, volumes);
 		}
@@ -617,7 +627,10 @@
 	}
 #elif defined (HAVE_MNTENT_H)
 	while ((ent = getmntent (file)) != NULL) {
-		if (strcmp (volume->device_path, ent->mnt_fsname) == 0
+		if (((strcmp (volume->device_path, ent->mnt_fsname) == 0) 
+		    || (strcmp (ent->mnt_type, "supermount") == 0 && 
+			strcmp (volume->device_path, eel_str_strip_substring_and_after (hasmntopt (ent, "dev"), ",") + strlen ("dev=")) == 0))
+		    && (strcmp (volume->mount_path, ent->mnt_dir) == 0)
 		    && has_removable_mntent_options (ent)) {
 			removable = TRUE;
 			break;
@@ -1027,6 +1040,20 @@
                         device_path = eel_string_list_nth (list, 0);
                         mount_path = eel_string_list_nth (list, 1);
                         file_system_type_name = eel_string_list_nth (list, 2);
+ 			/* For supermount, search info in removable list */
+ 			if (eel_strcmp ("supermount", file_system_type_name) == 0) {
+ 				GList * list;
+ 				g_free (device_path);
+ 				list = monitor->details->removable_volumes;
+ 				while (list) {
+ 					volume = (NautilusVolume *) list->data;
+ 					if (eel_strcmp (mount_path, volume->mount_path) == 0) {
+ 						device_path = g_strdup (volume->device_path);
+ 						break;
+ 					}
+ 					list = list->next;
+ 				}				
+ 			}
                         volume = create_volume (device_path, mount_path);
 			if (eel_string_list_get_length (list) >= 4 &&
 			    option_list_has_option (eel_string_list_peek_nth (list, 3), MNTOPT_RO))
@@ -1566,6 +1593,15 @@
 #else
        name = mount_point;
 #endif
+
+       /* Don't run mount/umount on supermount mount point, it is useless */
+       if ((volume->file_system_type != NULL) 
+	   && (strcmp (volume->file_system_type->name, "supermount") == 0)) {
+	       if (volume->device_type == NAUTILUS_DEVICE_CDROM_DRIVE) {
+		       eject_device (volume->device_path);
+	       }
+	       return;
+       }
        
        if (should_mount) {
                command = find_command (MOUNT_COMMAND);
--- src/file-manager/fm-desktop-icon-view.c	28 Jun 2002 10:59:09 -0000	1.183
+++ src/file-manager/fm-desktop-icon-view.c	1 Jul 2002 12:30:26 -0000
@@ -377,7 +377,12 @@
 	 */	   
 	index = 1;
 			
-	volume_name = nautilus_volume_get_name (volume);	
+	volume_name = nautilus_volume_get_name (volume);
+	if ((strcmp(volume_name,_("Unknown")) == 0) 
+	    && ((nautilus_volume_get_device_type (volume) == NAUTILUS_DEVICE_CDROM_DRIVE)
+	    || (nautilus_volume_get_device_type (volume) == NAUTILUS_DEVICE_AUDIO_CD))) {
+		volume_name = g_strdup(_("CD-ROM"));
+	}		
 		
 	uri_path = g_strdup_printf ("%s/%s", desktop_directory, volume_name);		
 	uri = gnome_vfs_uri_new (uri_path);


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