Commit bc88b9f7 authored by Carlos Garcia Campos's avatar Carlos Garcia Campos Committed by Carlos Garcia Campos

Use g_error_matches() instead of manually check error code and domain.

2009-04-08  Carlos Garcia Campos  <carlosgc@gnome.org>

	* shell/ev-window.c: (window_open_file_copy_ready_cb),
	(reload_remote_copy_ready_cb), (window_save_file_copy_ready_cb):

	Use g_error_matches() instead of manually check error code and
	domain.

svn path=/trunk/; revision=3583
parent dcbfea19
2009-04-08 Carlos Garcia Campos <carlosgc@gnome.org>
* shell/ev-window.c: (window_open_file_copy_ready_cb),
(reload_remote_copy_ready_cb), (window_save_file_copy_ready_cb):
Use g_error_matches() instead of manually check error code and
domain.
2009-04-08 Carlos Garcia Campos <carlosgc@gnome.org> 2009-04-08 Carlos Garcia Campos <carlosgc@gnome.org>
* shell/ev-window.c: (ev_window_clear_temp_symlink), * shell/ev-window.c: (ev_window_clear_temp_symlink),
......
...@@ -1689,8 +1689,7 @@ window_open_file_copy_ready_cb (GFile *source, ...@@ -1689,8 +1689,7 @@ window_open_file_copy_ready_cb (GFile *source,
return; return;
} }
if (error->domain == G_IO_ERROR && if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_MOUNTED)) {
error->code == G_IO_ERROR_NOT_MOUNTED) {
GMountOperation *operation; GMountOperation *operation;
operation = ev_mount_operation_new (GTK_WINDOW (ev_window)); operation = ev_mount_operation_new (GTK_WINDOW (ev_window));
...@@ -1700,8 +1699,7 @@ window_open_file_copy_ready_cb (GFile *source, ...@@ -1700,8 +1699,7 @@ window_open_file_copy_ready_cb (GFile *source,
(GAsyncReadyCallback)mount_volume_ready_cb, (GAsyncReadyCallback)mount_volume_ready_cb,
ev_window); ev_window);
g_object_unref (operation); g_object_unref (operation);
} else if (error->domain == G_IO_ERROR && } else if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
error->code == G_IO_ERROR_CANCELLED) {
ev_window_clear_load_job (ev_window); ev_window_clear_load_job (ev_window);
ev_window_clear_local_uri (ev_window); ev_window_clear_local_uri (ev_window);
g_free (ev_window->priv->uri); g_free (ev_window->priv->uri);
...@@ -1889,8 +1887,7 @@ reload_remote_copy_ready_cb (GFile *remote, ...@@ -1889,8 +1887,7 @@ reload_remote_copy_ready_cb (GFile *remote,
g_file_copy_finish (remote, async_result, &error); g_file_copy_finish (remote, async_result, &error);
if (error) { if (error) {
if (error->domain != G_IO_ERROR || if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
error->code != G_IO_ERROR_CANCELLED)
ev_window_error_message (ev_window, error, ev_window_error_message (ev_window, error,
"%s", _("Failed to reload document.")); "%s", _("Failed to reload document."));
g_error_free (error); g_error_free (error);
...@@ -2412,8 +2409,7 @@ window_save_file_copy_ready_cb (GFile *src, ...@@ -2412,8 +2409,7 @@ window_save_file_copy_ready_cb (GFile *src,
return; return;
} }
if (error->domain != G_IO_ERROR || if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
error->code != G_IO_ERROR_CANCELLED) {
gchar *name; gchar *name;
name = g_file_get_basename (dst); name = g_file_get_basename (dst);
......
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