Commit 6b62b6df authored by David Zeuthen's avatar David Zeuthen Committed by David Zeuthen

Update for API changes in gio trunk.

2007-12-11  David Zeuthen  <davidz@redhat.com>

	Update for API changes in gio trunk.

	* libnautilus-private/nautilus-desktop-icon-file.c:
	(update_info_from_link):
	* libnautilus-private/nautilus-desktop-link-monitor.c:
	(volume_delete_dialog), (volume_file_name_used),
	(create_mount_link), (mount_added_callback),
	(mount_removed_callback), (mount_changed_callback),
	(desktop_volumes_visible_changed),
	(nautilus_desktop_link_monitor_init),
	(desktop_link_monitor_finalize):
	* libnautilus-private/nautilus-desktop-link.c:
	(nautilus_desktop_link_new),
	(nautilus_desktop_link_new_from_mount),
	(nautilus_desktop_link_get_mount), (desktop_link_finalize):
	* libnautilus-private/nautilus-desktop-link.h:
	* libnautilus-private/nautilus-file-operations.c:
	(custom_mount_to_string), (custom_mount_skip),
	(unmount_mount_callback), (do_unmount), (get_trash_dirs_for_mount),
	(has_trash_files), (nautilus_file_operations_unmount_mount):
	* libnautilus-private/nautilus-file-operations.h:
	* libnautilus-private/nautilus-file.c:
	(nautilus_file_get_volume_name):
	* src/file-manager/fm-icon-container.c: (get_sort_category):
	* src/file-manager/fm-tree-model.c: (fm_tree_model_add_root_uri),
	(fm_tree_model_get_mount_for_root_node_file),
	(fm_tree_model_remove_root_uri):
	* src/file-manager/fm-tree-model.h:
	* src/file-manager/fm-tree-view.c: (add_root_for_mount),
	(mount_added_callback), (mount_removed_callback),
	(button_pressed_callback), (fm_tree_view_unmount_cb),
	(create_tree):
	* src/nautilus-application.c: (nautilus_application_instance_init),
	(mount_added_callback), (mount_removed_callback):
	* src/nautilus-pathbar.c:
	(nautilus_path_bar_update_button_appearance),
	(is_file_path_mounted_mount), (find_button_type),
	(make_directory_button):
	* src/nautilus-places-sidebar.c: (add_place), (update_places),
	(mount_added_callback), (mount_removed_callback),
	(mount_changed_callback), (volume_added_callback),
	(volume_removed_callback), (volume_changed_callback),
	(drive_changed_callback), (bookmarks_popup_menu_detach_cb),
	(check_visibility), (bookmarks_check_popup_sensitivity),
	(volume_mount_cb), (open_selected_bookmark), (mount_shortcut_cb),
	(unmount_shortcut_cb), (eject_shortcut_cb),
	(drive_poll_for_media_cb), (rescan_shortcut_cb),
	(bookmarks_build_popup_menu), (nautilus_places_sidebar_init),
	(nautilus_places_sidebar_set_parent_window):


svn path=/trunk/; revision=13520
parent 4688bb16
2007-12-11 David Zeuthen <davidz@redhat.com>
Update for API changes in gio trunk.
* libnautilus-private/nautilus-desktop-icon-file.c:
(update_info_from_link):
* libnautilus-private/nautilus-desktop-link-monitor.c:
(volume_delete_dialog), (volume_file_name_used),
(create_mount_link), (mount_added_callback),
(mount_removed_callback), (mount_changed_callback),
(desktop_volumes_visible_changed),
(nautilus_desktop_link_monitor_init),
(desktop_link_monitor_finalize):
* libnautilus-private/nautilus-desktop-link.c:
(nautilus_desktop_link_new),
(nautilus_desktop_link_new_from_mount),
(nautilus_desktop_link_get_mount), (desktop_link_finalize):
* libnautilus-private/nautilus-desktop-link.h:
* libnautilus-private/nautilus-file-operations.c:
(custom_mount_to_string), (custom_mount_skip),
(unmount_mount_callback), (do_unmount), (get_trash_dirs_for_mount),
(has_trash_files), (nautilus_file_operations_unmount_mount):
* libnautilus-private/nautilus-file-operations.h:
* libnautilus-private/nautilus-file.c:
(nautilus_file_get_volume_name):
* src/file-manager/fm-icon-container.c: (get_sort_category):
* src/file-manager/fm-tree-model.c: (fm_tree_model_add_root_uri),
(fm_tree_model_get_mount_for_root_node_file),
(fm_tree_model_remove_root_uri):
* src/file-manager/fm-tree-model.h:
* src/file-manager/fm-tree-view.c: (add_root_for_mount),
(mount_added_callback), (mount_removed_callback),
(button_pressed_callback), (fm_tree_view_unmount_cb),
(create_tree):
* src/nautilus-application.c: (nautilus_application_instance_init),
(mount_added_callback), (mount_removed_callback):
* src/nautilus-pathbar.c:
(nautilus_path_bar_update_button_appearance),
(is_file_path_mounted_mount), (find_button_type),
(make_directory_button):
* src/nautilus-places-sidebar.c: (add_place), (update_places),
(mount_added_callback), (mount_removed_callback),
(mount_changed_callback), (volume_added_callback),
(volume_removed_callback), (volume_changed_callback),
(drive_changed_callback), (bookmarks_popup_menu_detach_cb),
(check_visibility), (bookmarks_check_popup_sensitivity),
(volume_mount_cb), (open_selected_bookmark), (mount_shortcut_cb),
(unmount_shortcut_cb), (eject_shortcut_cb),
(drive_poll_for_media_cb), (rescan_shortcut_cb),
(bookmarks_build_popup_menu), (nautilus_places_sidebar_init),
(nautilus_places_sidebar_set_parent_window):
2007-12-11 A. Walton <awalton@svn.gnome.org>
* src/nautilus-shell-interface.idl:
Fix build error from nautilus metafile removal.
......
......@@ -35,6 +35,7 @@
#include "nautilus-desktop-directory.h"
#include <glib/gi18n.h>
#include <string.h>
#include <gio/gdrive.h>
struct NautilusDesktopIconFileDetails {
NautilusDesktopLink *link;
......@@ -161,7 +162,7 @@ update_info_from_link (NautilusDesktopIconFile *icon_file)
NautilusFile *file;
NautilusDesktopLink *link;
char *display_name;
GVolume *volume;
GMount *mount;
file = NAUTILUS_FILE (icon_file);
......@@ -182,11 +183,20 @@ update_info_from_link (NautilusDesktopIconFile *icon_file)
file->details->can_mount = FALSE;
file->details->can_unmount = FALSE;
file->details->can_eject = FALSE;
volume = nautilus_desktop_link_get_volume (link);
if (volume) {
file->details->can_unmount = g_volume_can_unmount (volume);
file->details->can_eject = g_volume_can_eject (volume);
g_object_unref (volume);
mount = nautilus_desktop_link_get_mount (link);
if (mount) {
GDrive *drive;
gboolean can_eject = FALSE;
drive = g_mount_get_drive (mount);
if (drive != NULL) {
can_eject = g_drive_can_eject (drive);
g_object_unref (drive);
}
file->details->can_unmount = g_mount_can_unmount (mount);
file->details->can_eject = can_eject;
g_object_unref (mount);
}
file->details->file_info_is_up_to_date = TRUE;
......
......@@ -54,8 +54,9 @@ struct NautilusDesktopLinkMonitorDetails {
gulong mount_id;
gulong unmount_id;
gulong changed_id;
GList *volume_links;
GList *mount_links;
};
......@@ -91,19 +92,28 @@ static void
volume_delete_dialog (GtkWidget *parent_view,
NautilusDesktopLink *link)
{
GVolume *volume;
GMount *mount;
char *dialog_str;
char *display_name;
volume = nautilus_desktop_link_get_volume (link);
mount = nautilus_desktop_link_get_mount (link);
if (mount != NULL) {
GDrive *drive;
gboolean can_eject = FALSE;
drive = g_mount_get_drive (mount);
if (drive != NULL) {
can_eject = g_drive_can_eject (drive);
g_object_unref (drive);
}
if (volume != NULL) {
display_name = nautilus_desktop_link_get_display_name (link);
dialog_str = g_strdup_printf (_("You cannot move the volume \"%s\" to the trash."),
display_name);
g_free (display_name);
if (g_volume_can_eject (volume)) {
if (can_eject) {
eel_run_simple_dialog
(parent_view,
FALSE,
......@@ -123,7 +133,7 @@ volume_delete_dialog (GtkWidget *parent_view,
GTK_STOCK_OK, NULL);
}
g_object_unref (volume);
g_object_unref (mount);
g_free (dialog_str);
}
}
......@@ -154,7 +164,7 @@ volume_file_name_used (NautilusDesktopLinkMonitor *monitor,
char *other_name;
gboolean same;
for (l = monitor->details->volume_links; l != NULL; l = l->next) {
for (l = monitor->details->mount_links; l != NULL; l = l->next) {
other_name = nautilus_desktop_link_get_file_name (l->data);
same = strcmp (name, other_name) == 0;
g_free (other_name);
......@@ -184,56 +194,64 @@ nautilus_desktop_link_monitor_make_filename_unique (NautilusDesktopLinkMonitor *
}
static void
create_volume_link (NautilusDesktopLinkMonitor *monitor,
GVolume *volume)
create_mount_link (NautilusDesktopLinkMonitor *monitor,
GMount *mount)
{
NautilusDesktopLink *link;
link = NULL;
if (eel_preferences_get_boolean (NAUTILUS_PREFERENCES_DESKTOP_VOLUMES_VISIBLE)) {
link = nautilus_desktop_link_new_from_volume (volume);
monitor->details->volume_links = g_list_prepend (monitor->details->volume_links, link);
link = nautilus_desktop_link_new_from_mount (mount);
monitor->details->mount_links = g_list_prepend (monitor->details->mount_links, link);
}
}
static void
volume_mounted_callback (GVolumeMonitor *volume_monitor,
GVolume *volume,
NautilusDesktopLinkMonitor *monitor)
mount_added_callback (GVolumeMonitor *volume_monitor,
GMount *mount,
NautilusDesktopLinkMonitor *monitor)
{
create_volume_link (monitor, volume);
create_mount_link (monitor, mount);
}
static void
volume_unmounted_callback (GVolumeMonitor *volume_monitor,
GVolume *volume,
NautilusDesktopLinkMonitor *monitor)
mount_removed_callback (GVolumeMonitor *volume_monitor,
GMount *mount,
NautilusDesktopLinkMonitor *monitor)
{
GList *l;
NautilusDesktopLink *link;
GVolume *other_volume;
GMount *other_mount;
link = NULL;
for (l = monitor->details->volume_links; l != NULL; l = l->next) {
other_volume = nautilus_desktop_link_get_volume (l->data);
if (volume == other_volume) {
g_object_unref (other_volume);
for (l = monitor->details->mount_links; l != NULL; l = l->next) {
other_mount = nautilus_desktop_link_get_mount (l->data);
if (mount == other_mount) {
g_object_unref (other_mount);
link = l->data;
break;
}
g_object_unref (other_volume);
g_object_unref (other_mount);
}
if (link) {
monitor->details->volume_links = g_list_remove (monitor->details->volume_links, link);
monitor->details->mount_links = g_list_remove (monitor->details->mount_links, link);
g_object_unref (link);
}
}
static void
mount_changed_callback (GVolumeMonitor *volume_monitor,
GMount *mount,
NautilusDesktopLinkMonitor *monitor)
{
/* TODO: update the mount */
}
static void
update_link_visibility (NautilusDesktopLinkMonitor *monitor,
NautilusDesktopLink **link_ref,
......@@ -308,23 +326,23 @@ static void
desktop_volumes_visible_changed (gpointer callback_data)
{
NautilusDesktopLinkMonitor *monitor;
GList *l, *volumes;
GList *l, *mounts;
monitor = NAUTILUS_DESKTOP_LINK_MONITOR (callback_data);
if (eel_preferences_get_boolean (NAUTILUS_PREFERENCES_DESKTOP_VOLUMES_VISIBLE)) {
if (monitor->details->volume_links == NULL) {
volumes = g_volume_monitor_get_mounted_volumes (monitor->details->volume_monitor);
for (l = volumes; l != NULL; l = l->next) {
create_volume_link (monitor, l->data);
if (monitor->details->mount_links == NULL) {
mounts = g_volume_monitor_get_mounts (monitor->details->volume_monitor);
for (l = mounts; l != NULL; l = l->next) {
create_mount_link (monitor, l->data);
g_object_unref (l->data);
}
g_list_free (volumes);
g_list_free (mounts);
}
} else {
g_list_foreach (monitor->details->volume_links, (GFunc)g_object_unref, NULL);
g_list_free (monitor->details->volume_links);
monitor->details->volume_links = NULL;
g_list_foreach (monitor->details->mount_links, (GFunc)g_object_unref, NULL);
g_list_free (monitor->details->mount_links);
monitor->details->mount_links = NULL;
}
}
......@@ -346,8 +364,8 @@ static void
nautilus_desktop_link_monitor_init (gpointer object, gpointer klass)
{
NautilusDesktopLinkMonitor *monitor;
GList *l, *volumes;
GVolume *volume;
GList *l, *mounts;
GMount *mount;
monitor = NAUTILUS_DESKTOP_LINK_MONITOR (object);
......@@ -386,26 +404,29 @@ nautilus_desktop_link_monitor_init (gpointer object, gpointer klass)
desktop_network_visible_changed,
monitor);
/* Volume links */
/* Mount links */
volumes = g_volume_monitor_get_mounted_volumes (monitor->details->volume_monitor);
for (l = volumes; l != NULL; l = l->next) {
volume = l->data;
create_volume_link (monitor, volume);
g_object_unref (volume);
mounts = g_volume_monitor_get_mounts (monitor->details->volume_monitor);
for (l = mounts; l != NULL; l = l->next) {
mount = l->data;
create_mount_link (monitor, mount);
g_object_unref (mount);
}
g_list_free (volumes);
g_list_free (mounts);
eel_preferences_add_callback (NAUTILUS_PREFERENCES_DESKTOP_VOLUMES_VISIBLE,
desktop_volumes_visible_changed,
monitor);
monitor->details->mount_id =
g_signal_connect_object (monitor->details->volume_monitor, "volume_mounted",
G_CALLBACK (volume_mounted_callback), monitor, 0);
g_signal_connect_object (monitor->details->volume_monitor, "mount_added",
G_CALLBACK (mount_added_callback), monitor, 0);
monitor->details->unmount_id =
g_signal_connect_object (monitor->details->volume_monitor, "volume_unmounted",
G_CALLBACK (volume_unmounted_callback), monitor, 0);
g_signal_connect_object (monitor->details->volume_monitor, "mount_removed",
G_CALLBACK (mount_removed_callback), monitor, 0);
monitor->details->changed_id =
g_signal_connect_object (monitor->details->volume_monitor, "mount_changed",
G_CALLBACK (mount_changed_callback), monitor, 0);
}
......@@ -454,11 +475,11 @@ desktop_link_monitor_finalize (GObject *object)
desktop_network_visible_changed,
monitor);
/* Volumes */
/* Mounts */
g_list_foreach (monitor->details->volume_links, (GFunc)g_object_unref, NULL);
g_list_free (monitor->details->volume_links);
monitor->details->volume_links = NULL;
g_list_foreach (monitor->details->mount_links, (GFunc)g_object_unref, NULL);
g_list_free (monitor->details->mount_links);
monitor->details->mount_links = NULL;
nautilus_directory_unref (monitor->details->desktop_dir);
monitor->details->desktop_dir = NULL;
......@@ -473,6 +494,9 @@ desktop_link_monitor_finalize (GObject *object)
if (monitor->details->unmount_id != 0) {
g_source_remove (monitor->details->unmount_id);
}
if (monitor->details->changed_id != 0) {
g_source_remove (monitor->details->changed_id);
}
g_free (monitor->details);
......
......@@ -30,8 +30,8 @@
#include "nautilus-desktop-directory.h"
#include <glib/gi18n.h>
#include <gio/gthemedicon.h>
#include <gio/gmount.h>
#include <gio/gvolume.h>
#include <gio/gdrive.h>
#include <libnautilus-private/nautilus-file-utilities.h>
#include <libnautilus-private/nautilus-trash-monitor.h>
#include <libnautilus-private/nautilus-global-preferences.h>
......@@ -49,8 +49,8 @@ struct NautilusDesktopLinkDetails {
/* Just for trash icons: */
gulong trash_state_handler;
/* Just for volume icons: */
GVolume *volume;
/* Just for mount icons: */
GMount *mount;
};
G_DEFINE_TYPE(NautilusDesktopLink, nautilus_desktop_link, G_TYPE_OBJECT)
......@@ -201,7 +201,7 @@ nautilus_desktop_link_new (NautilusDesktopLinkType type)
break;
default:
case NAUTILUS_DESKTOP_LINK_VOLUME:
case NAUTILUS_DESKTOP_LINK_MOUNT:
g_assert_not_reached();
}
......@@ -211,26 +211,26 @@ nautilus_desktop_link_new (NautilusDesktopLinkType type)
}
NautilusDesktopLink *
nautilus_desktop_link_new_from_volume (GVolume *volume)
nautilus_desktop_link_new_from_mount (GMount *mount)
{
NautilusDesktopLink *link;
GDrive *drive;
GVolume *volume;
char *name, *filename;
link = NAUTILUS_DESKTOP_LINK (g_object_new (NAUTILUS_TYPE_DESKTOP_LINK, NULL));
link->details->type = NAUTILUS_DESKTOP_LINK_VOLUME;
link->details->type = NAUTILUS_DESKTOP_LINK_MOUNT;
link->details->volume = g_object_ref (volume);
link->details->mount = g_object_ref (mount);
/* We try to use the drive name to get somewhat stable filenames
for metadata */
drive = g_volume_get_drive (volume);
if (drive != NULL) {
name = g_drive_get_name (drive);
g_object_unref (drive);
} else {
volume = g_mount_get_volume (mount);
if (volume != NULL) {
name = g_volume_get_name (volume);
g_object_unref (volume);
} else {
name = g_mount_get_name (mount);
}
/* Replace slashes in name */
......@@ -241,21 +241,21 @@ nautilus_desktop_link_new_from_volume (GVolume *volume)
g_free (filename);
g_free (name);
link->details->display_name = g_volume_get_name (volume);
link->details->display_name = g_mount_get_name (mount);
link->details->activation_location = g_volume_get_root (volume);
link->details->icon = g_volume_get_icon (volume);
link->details->activation_location = g_mount_get_root (mount);
link->details->icon = g_mount_get_icon (mount);
create_icon_file (link);
return link;
}
GVolume *
nautilus_desktop_link_get_volume (NautilusDesktopLink *link)
GMount *
nautilus_desktop_link_get_mount (NautilusDesktopLink *link)
{
if (link->details->volume) {
return g_object_ref (link->details->volume);
if (link->details->mount) {
return g_object_ref (link->details->mount);
}
return NULL;
}
......@@ -394,8 +394,8 @@ desktop_link_finalize (GObject *object)
link);
}
if (link->details->type == NAUTILUS_DESKTOP_LINK_VOLUME) {
g_object_unref (link->details->volume);
if (link->details->type == NAUTILUS_DESKTOP_LINK_MOUNT) {
g_object_unref (link->details->mount);
}
g_free (link->details->filename);
......
......@@ -26,7 +26,7 @@
#define NAUTILUS_DESKTOP_LINK_H
#include <libnautilus-private/nautilus-file.h>
#include <gio/gvolume.h>
#include <gio/gmount.h>
#define NAUTILUS_TYPE_DESKTOP_LINK \
(nautilus_desktop_link_get_type ())
......@@ -54,14 +54,14 @@ typedef enum {
NAUTILUS_DESKTOP_LINK_HOME,
NAUTILUS_DESKTOP_LINK_COMPUTER,
NAUTILUS_DESKTOP_LINK_TRASH,
NAUTILUS_DESKTOP_LINK_VOLUME,
NAUTILUS_DESKTOP_LINK_MOUNT,
NAUTILUS_DESKTOP_LINK_NETWORK
} NautilusDesktopLinkType;
GType nautilus_desktop_link_get_type (void);
NautilusDesktopLink * nautilus_desktop_link_new (NautilusDesktopLinkType type);
NautilusDesktopLink * nautilus_desktop_link_new_from_volume (GVolume *volume);
NautilusDesktopLink * nautilus_desktop_link_new_from_mount (GMount *mount);
NautilusDesktopLinkType nautilus_desktop_link_get_link_type (NautilusDesktopLink *link);
char * nautilus_desktop_link_get_file_name (NautilusDesktopLink *link);
char * nautilus_desktop_link_get_display_name (NautilusDesktopLink *link);
......@@ -70,7 +70,7 @@ GFile * nautilus_desktop_link_get_activation_location (NautilusD
gboolean nautilus_desktop_link_get_date (NautilusDesktopLink *link,
NautilusDateType date_type,
time_t *date);
GVolume * nautilus_desktop_link_get_volume (NautilusDesktopLink *link);
GMount * nautilus_desktop_link_get_mount (NautilusDesktopLink *link);
gboolean nautilus_desktop_link_can_rename (NautilusDesktopLink *link);
gboolean nautilus_desktop_link_rename (NautilusDesktopLink *link,
const char *name);
......
......@@ -670,18 +670,18 @@ custom_time_skip (va_list *va)
}
static char *
custom_volume_to_string (char *format, va_list va)
custom_mount_to_string (char *format, va_list va)
{
GVolume *volume;
GMount *mount;
volume = va_arg (va, GVolume *);
return g_volume_get_name (volume);
mount = va_arg (va, GMount *);
return g_mount_get_name (mount);
}
static void
custom_volume_skip (va_list *va)
custom_mount_skip (va_list *va)
{
va_arg (*va, GVolume *);
va_arg (*va, GMount *);
}
......@@ -690,7 +690,7 @@ static EelPrintfHandler handlers[] = {
{ 'B', custom_basename_to_string, custom_basename_skip },
{ 'S', custom_size_to_string, custom_size_skip },
{ 'T', custom_time_to_string, custom_time_skip },
{ 'V', custom_volume_to_string, custom_volume_skip },
{ 'V', custom_mount_to_string, custom_mount_skip },
{ 0 }
};
......@@ -1705,12 +1705,12 @@ nautilus_file_operations_delete (GList *files,
typedef struct {
gboolean eject;
GVolume *volume;
GMount *mount;
GtkWindow *parent_window;
} UnmountData;
static void
unmount_volume_callback (GObject *source_object,
unmount_mount_callback (GObject *source_object,
GAsyncResult *res,
gpointer user_data)
{
......@@ -1719,7 +1719,7 @@ unmount_volume_callback (GObject *source_object,
char *primary;
error = NULL;
if (!g_volume_unmount_finish (G_VOLUME (source_object),
if (!g_mount_unmount_finish (G_MOUNT (source_object),
res, &error)) {
if (data->eject) {
primary = f (_("Unable to eject %V"), source_object);
......@@ -1736,7 +1736,7 @@ unmount_volume_callback (GObject *source_object,
if (data->parent_window) {
g_object_unref (data->parent_window);
}
g_object_unref (data->volume);
g_object_unref (data->mount);
g_free (data);
}
......@@ -1744,14 +1744,23 @@ static void
do_unmount (UnmountData *data)
{
if (data->eject) {
g_volume_eject (data->volume,
#if 0
/* TODO */
GDrive *drive;
drive = g_mount_get_drive (drive);
if (drive != NULL) {
g_drive_eject (drive,
NULL,
unmount_volume_callback,
unmount_mount_callback,
data);
g_object_unref (drive);
}
#endif
} else {
g_volume_unmount (data->volume,
g_mount_unmount (data->mount,
NULL,
unmount_volume_callback,
unmount_mount_callback,
data);
}
}
......@@ -1784,14 +1793,14 @@ dir_has_files (GFile *dir)
}
static GList *
get_trash_dirs_for_volume (GVolume *volume)
get_trash_dirs_for_mount (GMount *mount)
{
GFile *root;
GFile *trash;
char *relpath;
GList *list;
root = g_volume_get_root (volume);
root = g_mount_get_root (mount);
if (root == NULL) {
return NULL;
}
......@@ -1824,13 +1833,13 @@ get_trash_dirs_for_volume (GVolume *volume)
}
static gboolean
has_trash_files (GVolume *volume)
has_trash_files (GMount *mount)
{
GList *dirs, *l;
GFile *dir;
gboolean res;
dirs = get_trash_dirs_for_volume (volume);
dirs = get_trash_dirs_for_mount (mount);
res = FALSE;
......@@ -1896,8 +1905,8 @@ prompt_empty_trash (GtkWindow *parent_window)
}
void
nautilus_file_operations_unmount_volume (GtkWindow *parent_window,
GVolume *volume,
nautilus_file_operations_unmount_mount (GtkWindow *parent_window,
GMount *mount,
gboolean eject)
{
UnmountData *data;
......@@ -1908,16 +1917,16 @@ nautilus_file_operations_unmount_volume (GtkWindow *parent_
data->parent_window = g_object_ref (parent_window);
}
data->eject = eject;
data->volume = g_object_ref (volume);
data->mount = g_object_ref (mount);
if (has_trash_files (volume)) {
if (has_trash_files (mount)) {
response = prompt_empty_trash (parent_window);
if (response == GTK_RESPONSE_ACCEPT) {
EmptyTrashJob *job;
job = op_job_new (EmptyTrashJob, parent_window);
job->trash_dirs = get_trash_dirs_for_volume (volume);
job->trash_dirs = get_trash_dirs_for_mount (mount);
job->done_callback = (NautilusOpCallback)do_unmount;
job->done_callback_data = data;
g_schedule_io_job (empty_trash_job,
......@@ -1930,7 +1939,7 @@ nautilus_file_operations_unmount_volume (GtkWindow *parent_
if (data->parent_window) {
g_object_unref (data->parent_window);
}
g_object_unref (data->volume);
g_object_unref (data->mount);
g_free (data);
return;
}
......
......@@ -29,7 +29,7 @@
#include <gdk/gdkdnd.h>
#include <gtk/gtkwidget.h>
#include <gio/gvolume.h>
#include <gio/gmount.h>
typedef void (* NautilusCopyCallback) (GHashTable *debuting_uris,
gpointer callback_data);
......@@ -86,9 +86,9 @@ void nautilus_file_set_permissions_recursive (const char *di
NautilusOpCallback callback,
gpointer callback_data);
void nautilus_file_operations_unmount_volume (GtkWindow *parent_window,
GVolume *volume,
gboolean eject);
void nautilus_file_operations_unmount_mount (GtkWindow *parent_window,
GMount *mount,
gboolean eject);
void nautilus_file_operations_copy (GList *files,
......
......@@ -5677,15 +5677,15 @@ nautilus_file_get_volume_name (NautilusFile *file)
{
GFile *location;
char *res;
GVolume *volume;
GMount *mount;
res = NULL;
location = nautilus_file_get_location (file);
volume = g_file_find_enclosing_volume (location, NULL, NULL);
if (volume) {
res = g_strdup (g_volume_get_name (volume));
g_object_unref (volume);
mount = g_file_find_enclosing_mount (location, NULL, NULL);
if (mount) {
res = g_strdup (g_mount_get_name (mount));
g_object_unref (mount);
}
g_object_unref (location);
......
......@@ -371,7 +371,7 @@ get_sort_category (NautilusFile *file)
case NAUTILUS_DESKTOP_LINK_HOME:
category = SORT_HOME_LINK;
break;
case NAUTILUS_DESKTOP_LINK_VOLUME:
case NAUTILUS_DESKTOP_LINK_MOUNT:
category = SORT_MOUNT_LINK;
break;
case NAUTILUS_DESKTOP_LINK_TRASH:
......
......@@ -62,7 +62,7 @@ struct TreeNode {
NautilusFile *file;
char *display_name;
GIcon *icon;