Commit f0a7acaf authored by Kai Lüke's avatar Kai Lüke

Remove redundant error showing

The gdu_*_ensure_unused machinery already
displays the unmounting error. At many places
in the UI (but not in every case) the error
was shown again a second time.

This error was discovered as part of
GNOME/gnome-disk-utility#101
parent 6a0fd3ac
......@@ -118,18 +118,8 @@ ensure_unused_cb (UDisksObject *object,
gpointer user_data)
{
EditFilesystemData *data = user_data;
GError *error = NULL;
if (!gdu_window_ensure_unused_finish (data->window,
res,
&error))
{
gdu_utils_show_error (GTK_WINDOW (data->window),
_("Error unmounting filesystem"),
error);
g_error_free (error);
}
else
if (gdu_window_ensure_unused_finish (data->window, res, NULL))
{
udisks_filesystem_call_set_label (data->filesystem,
data->new_label,
......
......@@ -543,15 +543,9 @@ ensure_unused_cb_offline_next_repair (GObject *source_object,
gpointer user_data)
{
ResizeDialogData *data = user_data;
GError *error = NULL;
if (!gdu_utils_ensure_unused_finish (data->client, res, &error))
if (!gdu_utils_ensure_unused_finish (data->client, res, NULL))
{
gdu_utils_show_error (GTK_WINDOW (data->window),
_("Error unmounting filesystem for repairing"),
error);
g_error_free (error);
resize_dialog_data_unref (data);
}
else
......@@ -684,15 +678,9 @@ unmount_cb (GObject *source_object,
gpointer user_data)
{
ResizeDialogData *data = user_data;
GError *error = NULL;
if (!gdu_utils_ensure_unused_finish (data->client, res, &error))
if (!gdu_utils_ensure_unused_finish (data->client, res, NULL))
{
gdu_utils_show_error (GTK_WINDOW (data->window),
_("Error unmounting filesystem for resizing"),
error);
g_error_free (error);
resize_dialog_data_unref (data);
}
else
......
......@@ -3200,18 +3200,8 @@ fs_repair_unmount_cb (GduWindow *window,
gpointer user_data)
{
UDisksObject *object = UDISKS_OBJECT (user_data);
GError *error = NULL;
if (!gdu_window_ensure_unused_finish (window,
res,
&error))
{
gdu_utils_show_error (GTK_WINDOW (window),
_("Error unmounting filesystem"),
error);
g_error_free (error);
}
else
if (gdu_window_ensure_unused_finish (window, res, NULL))
{
UDisksFilesystem *filesystem;
......@@ -3328,18 +3318,8 @@ fs_check_unmount_cb (GduWindow *window,
gpointer user_data)
{
UDisksObject *object = UDISKS_OBJECT (user_data);
GError *error = NULL;
if (!gdu_window_ensure_unused_finish (window,
res,
&error))
{
gdu_utils_show_error (GTK_WINDOW (window),
_("Error unmounting filesystem"),
error);
g_error_free (error);
}
else
if (gdu_window_ensure_unused_finish (window, res, NULL))
{
UDisksFilesystem *filesystem;
......@@ -3824,24 +3804,6 @@ on_mount_tool_button_clicked (GtkToolButton *button, gpointer user_data)
/* ---------------------------------------------------------------------------------------------------- */
static void
unmount_cb (GduWindow *window,
GAsyncResult *res,
gpointer user_data)
{
GError *error = NULL;
if (!gdu_window_ensure_unused_finish (window,
res,
&error))
{
gdu_utils_show_error (GTK_WINDOW (window),
_("Error unmounting filesystem"),
error);
g_error_free (error);
}
}
static void
on_unmount_tool_button_clicked (GtkToolButton *button, gpointer user_data)
{
......@@ -3851,7 +3813,7 @@ on_unmount_tool_button_clicked (GtkToolButton *button, gpointer user_data)
object = gdu_volume_grid_get_selected_device (GDU_VOLUME_GRID (window->volume_grid));
gdu_window_ensure_unused (window,
object,
(GAsyncReadyCallback) unmount_cb,
NULL,
NULL,
NULL);
}
......@@ -4031,24 +3993,6 @@ on_unlock_tool_button_clicked (GtkToolButton *button, gpointer user_data)
/* ---------------------------------------------------------------------------------------------------- */
static void
lock_cb (GduWindow *window,
GAsyncResult *res,
gpointer user_data)
{
GError *error = NULL;
if (!gdu_window_ensure_unused_finish (window,
res,
&error))
{
gdu_utils_show_error (GTK_WINDOW (window),
_("Error locking encrypted device"),
error);
g_error_free (error);
}
}
static void
on_lock_tool_button_clicked (GtkToolButton *button, gpointer user_data)
{
......@@ -4058,7 +4002,7 @@ on_lock_tool_button_clicked (GtkToolButton *button, gpointer user_data)
object = gdu_volume_grid_get_selected_device (GDU_VOLUME_GRID (window->volume_grid));
gdu_window_ensure_unused (window,
object,
(GAsyncReadyCallback) lock_cb,
NULL,
NULL, /* GCancellable */
NULL);
}
......
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