[gvfs/wip/goa: 5/5] gdbus: Do not emit ask-password if the password has already been set



commit 27ebbafd8a51341ee8718e9af643b8374bd5646d
Author: Debarshi Ray <debarshir gnome org>
Date:   Fri Nov 23 23:31:55 2012 +0100

    gdbus: Do not emit ask-password if the password has already been set
    
    When mounting volumes exposed by GVfsGoaVolumeMonitor the password
    should be seamlessly picked up from GOA, instead of prompting the
    user.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=686526

 common/gmountoperationdbus.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/common/gmountoperationdbus.c b/common/gmountoperationdbus.c
index cfd99ef..3e8cf65 100644
--- a/common/gmountoperationdbus.c
+++ b/common/gmountoperationdbus.c
@@ -102,9 +102,18 @@ handle_ask_password (GVfsDBusMountOperation *object,
                      gpointer data)
 {
   GMountOperationDBus *op_dbus = data;
+  const char *password;
 
   op_dbus->object = object;
   op_dbus->invocation = invocation;
+
+  password = g_mount_operation_get_password (op_dbus->op);
+  if (password != NULL)
+    {
+      ask_password_reply (op_dbus->op, G_MOUNT_OPERATION_HANDLED, op_dbus);
+      return TRUE;
+    }
+
   g_signal_connect (op_dbus->op, "reply",
                     G_CALLBACK (ask_password_reply),
                     op_dbus);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]