[vino/gnome-3-8] Back out "authentication-method" setting change



commit 6b6349b204d8b4e576ba8f682d201a8de656945d
Author: David King <amigadave amigadave com>
Date:   Fri Mar 22 15:13:56 2013 +0000

    Back out "authentication-method" setting change
    
    This partially reverts commit 130d6a4a1f4f6e90586d42903484e5899459c403.
    The schema changes to remove the (bogus) choices remain, but the code
    changes were incorrect, as discussed in bug 683103.

 capplet/vino-preferences.c        |   20 +++++++++++---------
 common/org.gnome.Vino.gschema.xml |    2 +-
 2 files changed, 12 insertions(+), 10 deletions(-)
---
diff --git a/capplet/vino-preferences.c b/capplet/vino-preferences.c
index 8ee178d..13615e2 100644
--- a/capplet/vino-preferences.c
+++ b/capplet/vino-preferences.c
@@ -68,9 +68,9 @@ set_inverted (const GValue       *value,
   return g_variant_new_boolean (!g_value_get_boolean (value));
 }
 
-/* Next, one that maps between the array-of-strings list of authentication
- * mechanisms and a boolean that is TRUE only if "vnc" is in the list and FALSE
- * otherwise.
+/* Next, one that maps between the array-of-strings list of
+ * authentication mechanisms and a boolean that is FALSE if the 'none'
+ * and TRUE otherwise (ie: for 'vnc' in the list).
  */
 static gboolean
 get_authtype (GValue   *value,
@@ -81,11 +81,11 @@ get_authtype (GValue   *value,
   const gchar *type;
 
   g_variant_iter_init (&iter, variant);
-  g_value_set_boolean (value, FALSE);
+  g_value_set_boolean (value, TRUE);
 
   while (g_variant_iter_next (&iter, "s", &type))
-    if (strcmp (type, "vnc") == 0)
-      g_value_set_boolean (value, TRUE);
+    if (strcmp (type, "none") == 0)
+      g_value_set_boolean (value, FALSE);
 
   return TRUE;
 }
@@ -95,12 +95,14 @@ set_authtype (const GValue       *value,
               const GVariantType *type,
               gpointer            user_data)
 {
-  const gchar *vnc_auth = "vnc";
+  const gchar *authtype;
 
   if (g_value_get_boolean (value))
-    return g_variant_new_strv (&vnc_auth, 1);
+    authtype = "vnc";
   else
-    return g_variant_new_strv (NULL, 0);
+    authtype = "none";
+
+  return g_variant_new_strv (&authtype, 1);
 }
 
 
diff --git a/common/org.gnome.Vino.gschema.xml b/common/org.gnome.Vino.gschema.xml
index d4479c5..01b6ea9 100644
--- a/common/org.gnome.Vino.gschema.xml
+++ b/common/org.gnome.Vino.gschema.xml
@@ -82,7 +82,7 @@
         specified by the vnc-password key) before connecting and "none"
         which allows any remote user to connect.
       </description>
-      <default>[]</default>
+      <default>['none']</default>
     </key>
 
     <key name='vnc-password' type='s'>


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