[Spice-commits] gtk/spice-option.c

Hans de Goede jwrdegoede at kemper.freedesktop.org
Thu Oct 11 01:56:42 PDT 2012


 gtk/spice-option.c |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

New commits:
commit 0af80691680be769f3e9d1047ed27a0245cddab3
Author: Hans de Goede <hdegoede at redhat.com>
Date:   Thu Oct 11 10:00:02 2012 +0200

    Add spice-usbredir-filter alias for spice-usbredir-auto-redirect-filter (v2)
    
    For commandline backward compatibility with older spice-gtk versions.
    
    Changes in v2:
    -warn about spice-usbredir-filter being deprecated when it gets used
    
    Signed-off-by: Hans de Goede <hdegoede at redhat.com>

diff --git a/gtk/spice-option.c b/gtk/spice-option.c
index 85c9e55..56ec795 100644
--- a/gtk/spice-option.c
+++ b/gtk/spice-option.c
@@ -102,6 +102,17 @@ static gboolean parse_disable_effects(const gchar *option_name, const gchar *val
     return TRUE;
 }
 
+static gboolean parse_usbredir_filter(const gchar *option_name,
+                                      const gchar *value,
+                                      gpointer data, GError **error)
+
+{
+    g_warning("--spice-usbredir-filter is deprecated, please use --spice-usbredir-auto-redirect-filter instead");
+    g_free(usbredir_auto_redirect_filter);
+    usbredir_auto_redirect_filter = g_strdup(value);
+    return TRUE;
+}
+
 
 /**
  * spice_get_option_group:
@@ -132,6 +143,9 @@ GOptionGroup* spice_get_option_group(void)
           N_("Path to the local certificate database to use for software smartcard certificates"), N_("<certificate-db>") },
         { "spice-disable-usbredir", '\0', 0, G_OPTION_ARG_NONE, &disable_usbredir,
           N_("Disable USB redirection support"), NULL },
+        /* Backward compats version of spice-usbredir-auto-redirect-filter */
+        { "spice-usbredir-filter", '\0', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_CALLBACK, parse_usbredir_filter,
+          NULL, NULL },
         { "spice-usbredir-auto-redirect-filter", '\0', 0, G_OPTION_ARG_STRING, &usbredir_auto_redirect_filter,
           N_("Filter selecting USB devices to be auto-redirected when plugged in"), N_("<filter-string>") },
         { "spice-usbredir-redirect-on-connect", '\0', 0, G_OPTION_ARG_STRING, &usbredir_redirect_on_connect,


More information about the Spice-commits mailing list