[vino] Remove choices from authentication-methods setting



commit 130d6a4a1f4f6e90586d42903484e5899459c403
Author: David King <amigadave amigadave com>
Date:   Mon Mar 18 23:01:50 2013 +0000

    Remove choices from authentication-methods setting
    
    The "authentication-methods" setting was intended to list the valid
    authentication methods. In practice, only VNC authentication is
    supported. Remove the incorrect choices listed in the schema, and set
    the default method to be the empty list rather than ['none'].
    
    Fixes bug 683103.

 capplet/vino-preferences.c        |   20 +++++++++-----------
 common/org.gnome.Vino.gschema.xml |    6 +-----
 2 files changed, 10 insertions(+), 16 deletions(-)
---
diff --git a/capplet/vino-preferences.c b/capplet/vino-preferences.c
index 13615e2..8ee178d 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 FALSE if the 'none'
- * and TRUE otherwise (ie: for 'vnc' in the list).
+/* 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.
  */
 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, TRUE);
+  g_value_set_boolean (value, FALSE);
 
   while (g_variant_iter_next (&iter, "s", &type))
-    if (strcmp (type, "none") == 0)
-      g_value_set_boolean (value, FALSE);
+    if (strcmp (type, "vnc") == 0)
+      g_value_set_boolean (value, TRUE);
 
   return TRUE;
 }
@@ -95,14 +95,12 @@ set_authtype (const GValue       *value,
               const GVariantType *type,
               gpointer            user_data)
 {
-  const gchar *authtype;
+  const gchar *vnc_auth = "vnc";
 
   if (g_value_get_boolean (value))
-    authtype = "vnc";
+    return g_variant_new_strv (&vnc_auth, 1);
   else
-    authtype = "none";
-
-  return g_variant_new_strv (&authtype, 1);
+    return g_variant_new_strv (NULL, 0);
 }
 
 
diff --git a/common/org.gnome.Vino.gschema.xml b/common/org.gnome.Vino.gschema.xml
index 8d110eb..d4479c5 100644
--- a/common/org.gnome.Vino.gschema.xml
+++ b/common/org.gnome.Vino.gschema.xml
@@ -82,11 +82,7 @@
         specified by the vnc-password key) before connecting and "none"
         which allows any remote user to connect.
       </description>
-      <choices>
-        <choice value='none'/>
-        <choice value='vnc'/>
-      </choices>
-      <default>['none']</default>
+      <default>[]</default>
     </key>
 
     <key name='vnc-password' type='s'>


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