[gvfs] Use FAILED_HANDLED error code when user aborts
- From: Benjamin Otte <otte src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gvfs] Use FAILED_HANDLED error code when user aborts
- Date: Mon, 12 Oct 2009 10:17:34 +0000 (UTC)
commit bcc92d779f6e5d1d2bd960ff20d8b4c944cebe91
Author: Benjamin Otte <otte gnome org>
Date: Mon Oct 12 11:57:19 2009 +0200
Use FAILED_HANDLED error code when user aborts
This allows Nautilus to check for FAILED_HANDLED and not displaying an
error dialog to the user. Users don't like error dialogs thatdo nothing
but tell them what they just did.
Partial fix for https://bugzilla.gnome.org/show_bug.cgi?id=594495
daemon/gvfsbackendftp.c | 3 ++-
daemon/gvfsbackendsftp.c | 4 ++--
daemon/gvfsbackendsmb.c | 2 +-
daemon/gvfsbackendsmbbrowse.c | 2 +-
4 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/daemon/gvfsbackendftp.c b/daemon/gvfsbackendftp.c
index 15cb733..41eb493 100644
--- a/daemon/gvfsbackendftp.c
+++ b/daemon/gvfsbackendftp.c
@@ -354,7 +354,8 @@ do_mount (GVfsBackend *backend,
&password_save) ||
aborted)
{
- g_set_error_literal (&task.error, G_IO_ERROR, G_IO_ERROR_PERMISSION_DENIED,
+ g_set_error_literal (&task.error, G_IO_ERROR,
+ aborted ? G_IO_ERROR_FAILED_HANDLED : G_IO_ERROR_PERMISSION_DENIED,
_("Password dialog cancelled"));
break;
}
diff --git a/daemon/gvfsbackendsftp.c b/daemon/gvfsbackendsftp.c
index 51e2157..23b482b 100644
--- a/daemon/gvfsbackendsftp.c
+++ b/daemon/gvfsbackendsftp.c
@@ -964,8 +964,8 @@ handle_login (GVfsBackend *backend,
&password_save) ||
aborted)
{
- g_set_error_literal (error,
- G_IO_ERROR, G_IO_ERROR_PERMISSION_DENIED,
+ g_set_error_literal (error, G_IO_ERROR,
+ aborted ? G_IO_ERROR_FAILED_HANDLED : G_IO_ERROR_PERMISSION_DENIED,
_("Password dialog cancelled"));
ret_val = FALSE;
break;
diff --git a/daemon/gvfsbackendsmb.c b/daemon/gvfsbackendsmb.c
index ae547ab..bc8c415 100644
--- a/daemon/gvfsbackendsmb.c
+++ b/daemon/gvfsbackendsmb.c
@@ -602,7 +602,7 @@ do_mount (GVfsBackend *backend,
if (op_backend->mount_cancelled)
g_vfs_job_failed (G_VFS_JOB (job),
- G_IO_ERROR, G_IO_ERROR_PERMISSION_DENIED,
+ G_IO_ERROR, G_IO_ERROR_FAILED_HANDLED,
_("Password dialog cancelled"));
else
g_vfs_job_failed (G_VFS_JOB (job),
diff --git a/daemon/gvfsbackendsmbbrowse.c b/daemon/gvfsbackendsmbbrowse.c
index 23b9938..97d3c99 100644
--- a/daemon/gvfsbackendsmbbrowse.c
+++ b/daemon/gvfsbackendsmbbrowse.c
@@ -982,7 +982,7 @@ do_mount (GVfsBackend *backend,
{
if (op_backend->mount_cancelled)
g_vfs_job_failed (G_VFS_JOB (job),
- G_IO_ERROR, G_IO_ERROR_PERMISSION_DENIED,
+ G_IO_ERROR, G_IO_ERROR_FAILED_HANDLED,
_("Password dialog cancelled"));
else
/* TODO: Error from errno? */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]