172 lines
5.8 KiB
Diff
172 lines
5.8 KiB
Diff
Index: src/file-manager/fm-tree-view.c
|
|
===================================================================
|
|
--- src/file-manager/fm-tree-view.c (revision 14068)
|
|
+++ src/file-manager/fm-tree-view.c (working copy)
|
|
@@ -590,6 +590,9 @@
|
|
GFile *root;
|
|
GIcon *icon;
|
|
|
|
+ if (nautilus_is_livecd (mount))
|
|
+ return;
|
|
+
|
|
icon = g_mount_get_icon (mount);
|
|
root = g_mount_get_root (mount);
|
|
mount_uri = g_file_get_uri (root);
|
|
Index: src/nautilus-places-sidebar.c
|
|
===================================================================
|
|
--- src/nautilus-places-sidebar.c (revision 14068)
|
|
+++ src/nautilus-places-sidebar.c (working copy)
|
|
@@ -308,22 +308,24 @@
|
|
volume = ll->data;
|
|
mount = g_volume_get_mount (volume);
|
|
if (mount != NULL) {
|
|
- /* Show mounted volume in the sidebar */
|
|
- icon = g_mount_get_icon (mount);
|
|
- root = g_mount_get_root (mount);
|
|
- mount_uri = g_file_get_uri (root);
|
|
- g_object_unref (root);
|
|
- name = g_mount_get_name (mount);
|
|
- last_iter = add_place (sidebar, PLACES_MOUNTED_VOLUME,
|
|
- name, icon, mount_uri,
|
|
- drive, volume, mount, 0);
|
|
- if (strcmp (location, mount_uri) == 0) {
|
|
- gtk_tree_selection_select_iter (selection, &last_iter);
|
|
+ if (! nautilus_is_livecd (mount)) {
|
|
+ /* Show mounted volume in the sidebar */
|
|
+ icon = g_mount_get_icon (mount);
|
|
+ root = g_mount_get_root (mount);
|
|
+ mount_uri = g_file_get_uri (root);
|
|
+ g_object_unref (root);
|
|
+ name = g_mount_get_name (mount);
|
|
+ last_iter = add_place (sidebar, PLACES_MOUNTED_VOLUME,
|
|
+ name, icon, mount_uri,
|
|
+ drive, volume, mount, 0);
|
|
+ if (strcmp (location, mount_uri) == 0) {
|
|
+ gtk_tree_selection_select_iter (selection, &last_iter);
|
|
+ }
|
|
+ g_object_unref (mount);
|
|
+ g_object_unref (icon);
|
|
+ g_free (name);
|
|
+ g_free (mount_uri);
|
|
}
|
|
- g_object_unref (mount);
|
|
- g_object_unref (icon);
|
|
- g_free (name);
|
|
- g_free (mount_uri);
|
|
} else {
|
|
/* Do show the unmounted volumes in the sidebar;
|
|
* this is so the user can mount it (in case automounting
|
|
@@ -412,6 +414,8 @@
|
|
mounts = g_volume_monitor_get_mounts (volume_monitor);
|
|
for (l = mounts; l != NULL; l = l->next) {
|
|
mount = l->data;
|
|
+ if (nautilus_is_livecd (mount))
|
|
+ continue;
|
|
volume = g_mount_get_volume (mount);
|
|
if (volume != NULL) {
|
|
g_object_unref (volume);
|
|
Index: libnautilus-private/nautilus-directory-async.c
|
|
===================================================================
|
|
--- libnautilus-private/nautilus-directory-async.c (revision 14068)
|
|
+++ libnautilus-private/nautilus-directory-async.c (working copy)
|
|
@@ -968,6 +968,9 @@
|
|
return;
|
|
}
|
|
|
|
+ if (nautilus_is_livecd_from_info (info))
|
|
+ return;
|
|
+
|
|
if (g_file_info_get_name (info) == NULL) {
|
|
char *uri;
|
|
|
|
Index: libnautilus-private/nautilus-desktop-link-monitor.c
|
|
===================================================================
|
|
--- libnautilus-private/nautilus-desktop-link-monitor.c (revision 14068)
|
|
+++ libnautilus-private/nautilus-desktop-link-monitor.c (working copy)
|
|
@@ -192,7 +192,7 @@
|
|
|
|
link = NULL;
|
|
|
|
- if (eel_preferences_get_boolean (NAUTILUS_PREFERENCES_DESKTOP_VOLUMES_VISIBLE)) {
|
|
+ if (eel_preferences_get_boolean (NAUTILUS_PREFERENCES_DESKTOP_VOLUMES_VISIBLE) && (! nautilus_is_livecd (mount))) {
|
|
link = nautilus_desktop_link_new_from_mount (mount);
|
|
monitor->details->mount_links = g_list_prepend (monitor->details->mount_links, link);
|
|
}
|
|
Index: libnautilus-private/nautilus-file.c
|
|
===================================================================
|
|
--- libnautilus-private/nautilus-file.c (revision 14068)
|
|
+++ libnautilus-private/nautilus-file.c (working copy)
|
|
@@ -7145,3 +7145,53 @@
|
|
}
|
|
|
|
#endif /* !NAUTILUS_OMIT_SELF_CHECK */
|
|
+
|
|
+
|
|
+gboolean
|
|
+nautilus_is_livecd (GMount *mount)
|
|
+{
|
|
+ char *mount_name, *root_path;
|
|
+ GFile *root_file;
|
|
+ gboolean res;
|
|
+
|
|
+ if (! mount)
|
|
+ return FALSE;
|
|
+
|
|
+ mount_name = g_mount_get_name (mount);
|
|
+ root_file = g_mount_get_root (mount);
|
|
+ root_path = g_file_get_path (root_file);
|
|
+
|
|
+ res = ((g_strstr_len (mount_name, strlen (mount_name), LIVECD_LABEL_STRING) == mount_name) &&
|
|
+ (g_strstr_len (root_path, strlen (root_path), LIVECD_MOUNTPOINT) == root_path));
|
|
+
|
|
+ g_free (root_path);
|
|
+ g_free (mount_name);
|
|
+ g_object_unref (root_file);
|
|
+
|
|
+ return res;
|
|
+}
|
|
+
|
|
+gboolean
|
|
+nautilus_is_livecd_from_info (GFileInfo *info)
|
|
+{
|
|
+ const char *mount_name;
|
|
+ const char *root_path;
|
|
+ gboolean res;
|
|
+
|
|
+ if (! info)
|
|
+ return FALSE;
|
|
+
|
|
+ if (g_file_info_get_file_type (info) != G_FILE_TYPE_MOUNTABLE)
|
|
+ return FALSE;
|
|
+
|
|
+ mount_name = g_file_info_get_display_name (info);
|
|
+ root_path = g_file_info_get_attribute_string (info, G_FILE_ATTRIBUTE_STANDARD_TARGET_URI);
|
|
+
|
|
+ res = ((g_strstr_len (mount_name, strlen (mount_name), LIVECD_LABEL_STRING) == mount_name) &&
|
|
+ (g_strstr_len (root_path, strlen (root_path), LIVECD_MOUNTPOINT) == root_path + 7));
|
|
+
|
|
+ return res;
|
|
+}
|
|
+
|
|
+
|
|
+
|
|
Index: libnautilus-private/nautilus-file.h
|
|
===================================================================
|
|
--- libnautilus-private/nautilus-file.h (revision 14068)
|
|
+++ libnautilus-private/nautilus-file.h (working copy)
|
|
@@ -423,6 +423,14 @@
|
|
/* Debugging */
|
|
void nautilus_file_dump (NautilusFile *file);
|
|
|
|
+/* LiveCD mount hiding */
|
|
+#define LIVECD_LABEL_STRING "Fedora-9-"
|
|
+#define LIVECD_MOUNTPOINT "/mnt/live"
|
|
+gboolean nautilus_is_livecd (GMount *mount);
|
|
+gboolean nautilus_is_livecd_from_info (GFileInfo *info);
|
|
+
|
|
+
|
|
+
|
|
typedef struct NautilusFileDetails NautilusFileDetails;
|
|
|
|
struct NautilusFile {
|