Commit f6b23920 authored by Alexander Larsson's avatar Alexander Larsson Committed by Alexander Larsson

Remove unused callbacks in nautilus_file_unmount/eject. Patch from Tomas

2008-01-08  Alexander Larsson  <alexl@redhat.com>

        * libnautilus-private/nautilus-desktop-icon-file.c:
        * libnautilus-private/nautilus-file.[ch]:
        * libnautilus-private/nautilus-vfs-file.c:
        * src/file-manager/fm-directory-view.c:
	Remove unused callbacks in nautilus_file_unmount/eject.
	Patch from Tomas Bzatek <tbzatek@redhat.com>


svn path=/trunk/; revision=13572
parent 0059140a
2008-01-08 Alexander Larsson <alexl@redhat.com>
* libnautilus-private/nautilus-desktop-icon-file.c:
* libnautilus-private/nautilus-file.[ch]:
* libnautilus-private/nautilus-vfs-file.c:
* src/file-manager/fm-directory-view.c:
Remove unused callbacks in nautilus_file_unmount/eject.
Patch from Tomas Bzatek <tbzatek@redhat.com>
2008-01-08 Alexander Larsson <alexl@redhat.com>
* libnautilus-private/nautilus-desktop-icon-file.c:
......
......@@ -302,9 +302,7 @@ nautilus_desktop_icon_file_get_link (NautilusDesktopIconFile *icon_file)
}
static void
nautilus_desktop_icon_file_unmount (NautilusFile *file,
NautilusFileOperationCallback callback,
gpointer callback_data)
nautilus_desktop_icon_file_unmount (NautilusFile *file)
{
NautilusDesktopIconFile *desktop_file;
GMount *mount;
......@@ -320,9 +318,7 @@ nautilus_desktop_icon_file_unmount (NautilusFile *file,
}
static void
nautilus_desktop_icon_file_eject (NautilusFile *file,
NautilusFileOperationCallback callback,
gpointer callback_data)
nautilus_desktop_icon_file_eject (NautilusFile *file)
{
NautilusDesktopIconFile *desktop_file;
GMount *mount;
......
......@@ -874,42 +874,18 @@ nautilus_file_mount (NautilusFile *file,
}
void
nautilus_file_unmount (NautilusFile *file,
NautilusFileOperationCallback callback,
gpointer callback_data)
nautilus_file_unmount (NautilusFile *file)
{
GError *error;
if (NAUTILUS_FILE_GET_CLASS (file)->unmount == NULL) {
if (callback) {
error = NULL;
g_set_error (&error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
_("This file cannot be unmounted"));
callback (file, NULL, error, callback_data);
g_error_free (error);
}
} else {
NAUTILUS_FILE_GET_CLASS (file)->unmount (file, callback, callback_data);
if (NAUTILUS_FILE_GET_CLASS (file)->unmount != NULL) {
NAUTILUS_FILE_GET_CLASS (file)->unmount (file);
}
}
void
nautilus_file_eject (NautilusFile *file,
NautilusFileOperationCallback callback,
gpointer callback_data)
nautilus_file_eject (NautilusFile *file)
{
GError *error;
if (NAUTILUS_FILE_GET_CLASS (file)->eject == NULL) {
if (callback) {
error = NULL;
g_set_error (&error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
_("This file cannot be eject"));
callback (file, NULL, error, callback_data);
g_error_free (error);
}
} else {
NAUTILUS_FILE_GET_CLASS (file)->eject (file, callback, callback_data);
if (NAUTILUS_FILE_GET_CLASS (file)->eject != NULL) {
NAUTILUS_FILE_GET_CLASS (file)->eject (file);
}
}
......
......@@ -251,12 +251,8 @@ void nautilus_file_mount (Nautilu
GCancellable *cancellable,
NautilusFileOperationCallback callback,
gpointer callback_data);
void nautilus_file_unmount (NautilusFile *file,
NautilusFileOperationCallback callback,
gpointer callback_data);
void nautilus_file_eject (NautilusFile *file,
NautilusFileOperationCallback callback,
gpointer callback_data);
void nautilus_file_unmount (NautilusFile *file);
void nautilus_file_eject (NautilusFile *file);
/* Basic operations for file objects. */
void nautilus_file_set_owner (NautilusFile *file,
......@@ -478,12 +474,8 @@ typedef struct {
GCancellable *cancellable,
NautilusFileOperationCallback callback,
gpointer callback_data);
void (* unmount) (NautilusFile *file,
NautilusFileOperationCallback callback,
gpointer callback_data);
void (* eject) (NautilusFile *file,
NautilusFileOperationCallback callback,
gpointer callback_data);
void (* unmount) (NautilusFile *file);
void (* eject) (NautilusFile *file);
} NautilusFileClass;
#endif /* NAUTILUS_FILE_H */
......@@ -312,14 +312,12 @@ vfs_file_unmount_callback (GObject *source_object,
}
static void
vfs_file_unmount (NautilusFile *file,
NautilusFileOperationCallback callback,
gpointer callback_data)
vfs_file_unmount (NautilusFile *file)
{
NautilusFileOperation *op;
GFile *location;
op = nautilus_file_operation_new (file, callback, callback_data);
op = nautilus_file_operation_new (file, NULL, NULL);
location = nautilus_file_get_location (file);
g_file_unmount_mountable (location,
......@@ -358,14 +356,12 @@ vfs_file_eject_callback (GObject *source_object,
}
static void
vfs_file_eject (NautilusFile *file,
NautilusFileOperationCallback callback,
gpointer callback_data)
vfs_file_eject (NautilusFile *file)
{
NautilusFileOperation *op;
GFile *location;
op = nautilus_file_operation_new (file, callback, callback_data);
op = nautilus_file_operation_new (file, NULL, NULL);
location = nautilus_file_get_location (file);
g_file_eject_mountable (location,
......
......@@ -5727,8 +5727,7 @@ action_unmount_volume_callback (GtkAction *action,
for (l = selection; l != NULL; l = l->next) {
file = NAUTILUS_FILE (l->data);
if (nautilus_file_can_unmount (file)) {
nautilus_file_unmount (file,
NULL, NULL);
nautilus_file_unmount (file);
}
}
nautilus_file_list_free (selection);
......@@ -5772,7 +5771,7 @@ action_eject_volume_callback (GtkAction *action,
file = NAUTILUS_FILE (l->data);
if (nautilus_file_can_eject (file)) {
nautilus_file_eject (file, NULL, NULL);
nautilus_file_eject (file);
}
}
nautilus_file_list_free (selection);
......@@ -5812,7 +5811,7 @@ action_self_unmount_volume_callback (GtkAction *action,
return;
}
nautilus_file_unmount (file, NULL, NULL);
nautilus_file_unmount (file);
}
static void
......@@ -5829,7 +5828,7 @@ action_self_eject_volume_callback (GtkAction *action,
return;
}
nautilus_file_eject (file, NULL, NULL);
nautilus_file_eject (file);
}
static void
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment