[gnome-control-center] network: Remove unused functions



commit 87f02de5b7f9df9689d602cba5eeb33cce199db2
Author: Robert Ancell <robert ancell canonical com>
Date:   Tue Oct 1 12:27:29 2019 +1300

    network: Remove unused functions

 panels/network/panel-common.c | 149 ------------------------------------------
 panels/network/panel-common.h |   5 --
 2 files changed, 154 deletions(-)
---
diff --git a/panels/network/panel-common.c b/panels/network/panel-common.c
index de447ef27..7759360db 100644
--- a/panels/network/panel-common.c
+++ b/panels/network/panel-common.c
@@ -31,113 +31,6 @@
 
 #include "panel-common.h"
 
-/**
- * panel_device_to_icon_name:
- **/
-const gchar *
-panel_device_to_icon_name (NMDevice *device, gboolean symbolic)
-{
-        const gchar *value = NULL;
-        NMDeviceState state;
-        NMDeviceModemCapabilities caps;
-        switch (nm_device_get_device_type (device)) {
-        case NM_DEVICE_TYPE_ETHERNET:
-                state = nm_device_get_state (device);
-                if (state <= NM_DEVICE_STATE_DISCONNECTED) {
-                        value = symbolic ? "network-wired-disconnected-symbolic"
-                                         : "network-wired-disconnected";
-                } else {
-                        value = symbolic ? "network-wired-symbolic"
-                                         : "network-wired";
-                }
-                break;
-        case NM_DEVICE_TYPE_WIFI:
-        case NM_DEVICE_TYPE_BT:
-        case NM_DEVICE_TYPE_OLPC_MESH:
-                value = symbolic ? "network-wireless-signal-excellent-symbolic"
-                                 : "network-wireless";
-                break;
-        case NM_DEVICE_TYPE_MODEM:
-                caps = nm_device_modem_get_current_capabilities (NM_DEVICE_MODEM (device));
-                if ((caps & NM_DEVICE_MODEM_CAPABILITY_GSM_UMTS) ||
-                    (caps & NM_DEVICE_MODEM_CAPABILITY_CDMA_EVDO)) {
-                        value = symbolic ? "network-cellular-signal-excellent-symbolic"
-                                         : "network-cellular";
-                        break;
-                }
-                /* fall thru */
-        default:
-                value = symbolic ? "network-idle-symbolic"
-                                 : "network-idle";
-                break;
-        }
-        return value;
-}
-
-/**
- * panel_device_get_sort_category:
- *
- * Try to return order of approximate connection speed.
- * But sort wifi first, since thats the common case.
- **/
-gint
-panel_device_get_sort_category (NMDevice *device)
-{
-        gint value;
-        NMDeviceModemCapabilities caps;
-        switch (nm_device_get_device_type (device)) {
-        case NM_DEVICE_TYPE_ETHERNET:
-                value = 2;
-                break;
-        case NM_DEVICE_TYPE_WIFI:
-                value = 1;
-                break;
-        case NM_DEVICE_TYPE_MODEM:
-                caps = nm_device_modem_get_current_capabilities (NM_DEVICE_MODEM (device));
-                if ((caps & NM_DEVICE_MODEM_CAPABILITY_GSM_UMTS) ||
-                    (caps & NM_DEVICE_MODEM_CAPABILITY_CDMA_EVDO)) {
-                        value = 3;
-                }
-                break;
-        case NM_DEVICE_TYPE_BT:
-                value = 4;
-                break;
-        case NM_DEVICE_TYPE_OLPC_MESH:
-                value = 5;
-                break;
-        default:
-                value = 6;
-                break;
-        }
-        return value;
-}
-
-/**
- * panel_ap_mode_to_localized_string:
- **/
-const gchar *
-panel_ap_mode_to_localized_string (NM80211Mode mode)
-{
-        const gchar *value = NULL;
-        switch (mode) {
-        case NM_802_11_MODE_UNKNOWN:
-                /* TRANSLATORS: AP type */
-                value = _("Unknown");
-                break;
-        case NM_802_11_MODE_ADHOC:
-                /* TRANSLATORS: AP type */
-                value = _("Ad-hoc");
-                break;
-        case NM_802_11_MODE_INFRA:
-                /* TRANSLATORS: AP type */
-                value = _("Infrastructure");
-                break;
-        default:
-                break;
-        }
-        return value;
-}
-
 static const gchar *
 device_state_to_localized_string (NMDeviceState state)
 {
@@ -190,48 +83,6 @@ device_state_to_localized_string (NMDeviceState state)
         return value;
 }
 
-/**
- * panel_vpn_state_to_localized_string:
- **/
-const gchar *
-panel_vpn_state_to_localized_string (NMVpnConnectionState type)
-{
-        const gchar *value = NULL;
-        switch (type) {
-        case NM_DEVICE_STATE_UNKNOWN:
-                /* TRANSLATORS: VPN status */
-                value = _("Status unknown");
-                break;
-        case NM_VPN_CONNECTION_STATE_PREPARE:
-        case NM_VPN_CONNECTION_STATE_CONNECT:
-        case NM_VPN_CONNECTION_STATE_IP_CONFIG_GET:
-                /* TRANSLATORS: VPN status */
-                value = _("Connecting");
-                break;
-        case NM_VPN_CONNECTION_STATE_NEED_AUTH:
-                /* TRANSLATORS: VPN status */
-                value = _("Authentication required");
-                break;
-        case NM_VPN_CONNECTION_STATE_ACTIVATED:
-                /* TRANSLATORS: VPN status */
-                value = _("Connected");
-                break;
-        case NM_VPN_CONNECTION_STATE_FAILED:
-                /* TRANSLATORS: VPN status */
-                value = _("Connection failed");
-                break;
-        case NM_VPN_CONNECTION_STATE_DISCONNECTED:
-                /* TRANSLATORS: VPN status */
-                value = _("Not connected");
-                break;
-        default:
-                /* TRANSLATORS: VPN status */
-                value = _("Status unknown (missing)");
-                break;
-        }
-        return value;
-}
-
 static const gchar *
 device_state_reason_to_localized_string (NMDevice *device)
 {
diff --git a/panels/network/panel-common.h b/panels/network/panel-common.h
index 633813ca8..0fa3411ac 100644
--- a/panels/network/panel-common.h
+++ b/panels/network/panel-common.h
@@ -27,11 +27,6 @@
 
 G_BEGIN_DECLS
 
-const gchar     *panel_device_to_icon_name                     (NMDevice *device,
-                                                                gboolean  symbolic);
-gint             panel_device_get_sort_category                (NMDevice *device);
-const gchar     *panel_ap_mode_to_localized_string             (NM80211Mode mode);
-const gchar     *panel_vpn_state_to_localized_string           (NMVpnConnectionState type);
 void             panel_set_device_status                       (GtkBuilder *builder,
                                                                 const gchar *label_name,
                                                                 NMDevice *nm_device,


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