From f20e54698fb9fabd12eeda6a8f9cf885d5e4ccc2 Mon Sep 17 00:00:00 2001 From: Pascal Nowack Date: Tue, 16 Jun 2020 11:04:59 +0200 Subject: [PATCH] sharing: Remove vino preferences They are unused now. --- panels/sharing/meson.build | 1 - panels/sharing/vino-preferences.c | 111 ------------------------------ panels/sharing/vino-preferences.h | 45 ------------ 3 files changed, 157 deletions(-) delete mode 100644 panels/sharing/vino-preferences.c delete mode 100644 panels/sharing/vino-preferences.h diff --git a/panels/sharing/meson.build b/panels/sharing/meson.build index 1ad1878a3..b3803bcda 100644 --- a/panels/sharing/meson.build +++ b/panels/sharing/meson.build @@ -45,7 +45,6 @@ sources = files( 'cc-sharing-switch.c', 'cc-gnome-remote-desktop.c', 'file-share-properties.c', - 'vino-preferences.c' ) resource_data = files( diff --git a/panels/sharing/vino-preferences.c b/panels/sharing/vino-preferences.c deleted file mode 100644 index 029459dab..000000000 --- a/panels/sharing/vino-preferences.c +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright (C) 2003 Sun Microsystems, Inc. - * Copyright (C) 2006 Jonh Wendell - * Copyright © 2010 Codethink Limited - * Copyright (C) 2013 Intel, Inc - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . - * - * Authors: - * Mark McLoughlin - * Jonh Wendell - * Ryan Lortie - */ - -#include "vino-preferences.h" -#include - -#include - -gboolean -vino_get_authtype (GValue *value, - GVariant *variant, - gpointer user_data) -{ - GVariantIter iter; - const gchar *type; - - g_variant_iter_init (&iter, variant); - g_value_set_boolean (value, TRUE); - - while (g_variant_iter_next (&iter, "&s", &type)) - if (strcmp (type, "none") == 0) - g_value_set_boolean (value, FALSE); - - return TRUE; -} - -GVariant * -vino_set_authtype (const GValue *value, - const GVariantType *type, - gpointer user_data) -{ - const gchar *authtype; - - if (g_value_get_boolean (value)) - authtype = "vnc"; - else - authtype = "none"; - - return g_variant_new_strv (&authtype, 1); -} - -gboolean -vino_get_password (GValue *value, - GVariant *variant, - gpointer user_data) -{ - const gchar *setting; - - setting = g_variant_get_string (variant, NULL); - - if (strcmp (setting, "keyring") == 0) - { - /* "keyring" is the default value, even though vino doesn't support it at - * the moment */ - - g_value_set_static_string (value, ""); - return TRUE; - } - else - { - gchar *decoded; - gsize length; - gboolean ok; - - decoded = (gchar *) g_base64_decode (setting, &length); - - if ((ok = g_utf8_validate (decoded, length, NULL))) - g_value_take_string (value, g_strndup (decoded, length)); - - return ok; - } -} - -GVariant * -vino_set_password (const GValue *value, - const GVariantType *type, - gpointer user_data) -{ - const gchar *string; - gchar *base64; - - string = g_value_get_string (value); - - base64 = g_base64_encode ((guchar *) string, strlen (string)); - return g_variant_new_from_data (G_VARIANT_TYPE_STRING, - base64, strlen (base64) + 1, - TRUE, g_free, base64); -} - diff --git a/panels/sharing/vino-preferences.h b/panels/sharing/vino-preferences.h deleted file mode 100644 index f992d8d7c..000000000 --- a/panels/sharing/vino-preferences.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (C) 2003 Sun Microsystems, Inc. - * Copyright (C) 2006 Jonh Wendell - * Copyright © 2010 Codethink Limited - * Copyright (C) 2013 Intel, Inc - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . - * - * Authors: - * Mark McLoughlin - * Jonh Wendell - * Ryan Lortie - */ - -#pragma once - -#include -#include - -GVariant * vino_set_authtype (const GValue *value, - const GVariantType *type, - gpointer user_data); -gboolean vino_get_authtype (GValue *value, - GVariant *variant, - gpointer user_data); - -GVariant * -vino_set_password (const GValue *value, - const GVariantType *type, - gpointer user_data); -gboolean -vino_get_password (GValue *value, - GVariant *variant, - gpointer user_data);