network: Remove unused virtual method
This commit is contained in:
parent
0c92c7b461
commit
d68cb14837
3 changed files with 10 additions and 43 deletions
|
@ -57,22 +57,6 @@ struct _NetDeviceEthernet
|
||||||
|
|
||||||
G_DEFINE_TYPE (NetDeviceEthernet, net_device_ethernet, NET_TYPE_DEVICE_SIMPLE)
|
G_DEFINE_TYPE (NetDeviceEthernet, net_device_ethernet, NET_TYPE_DEVICE_SIMPLE)
|
||||||
|
|
||||||
static char *
|
|
||||||
device_ethernet_get_speed (NetDeviceSimple *device_simple)
|
|
||||||
{
|
|
||||||
NMDevice *nm_device;
|
|
||||||
guint speed;
|
|
||||||
|
|
||||||
nm_device = net_device_get_nm_device (NET_DEVICE (device_simple));
|
|
||||||
|
|
||||||
speed = nm_device_ethernet_get_speed (NM_DEVICE_ETHERNET (nm_device));
|
|
||||||
if (speed > 0) {
|
|
||||||
/* Translators: network device speed */
|
|
||||||
return g_strdup_printf (_("%d Mb/s"), speed);
|
|
||||||
} else
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static GtkWidget *
|
static GtkWidget *
|
||||||
device_ethernet_add_to_stack (NetObject *object,
|
device_ethernet_add_to_stack (NetObject *object,
|
||||||
GtkStack *stack,
|
GtkStack *stack,
|
||||||
|
@ -214,7 +198,7 @@ device_ethernet_refresh_ui (NetDeviceEthernet *self)
|
||||||
{
|
{
|
||||||
NMDevice *nm_device;
|
NMDevice *nm_device;
|
||||||
NMDeviceState state;
|
NMDeviceState state;
|
||||||
g_autofree gchar *speed = NULL;
|
g_autofree gchar *speed_text = NULL;
|
||||||
g_autofree gchar *status = NULL;
|
g_autofree gchar *status = NULL;
|
||||||
|
|
||||||
nm_device = net_device_get_nm_device (NET_DEVICE (self));
|
nm_device = net_device_get_nm_device (NET_DEVICE (self));
|
||||||
|
@ -229,9 +213,14 @@ device_ethernet_refresh_ui (NetDeviceEthernet *self)
|
||||||
gtk_switch_set_active (self->device_off_switch, device_state_to_off_switch (state));
|
gtk_switch_set_active (self->device_off_switch, device_state_to_off_switch (state));
|
||||||
self->updating_device = FALSE;
|
self->updating_device = FALSE;
|
||||||
|
|
||||||
if (state != NM_DEVICE_STATE_UNAVAILABLE)
|
if (state != NM_DEVICE_STATE_UNAVAILABLE) {
|
||||||
speed = net_device_simple_get_speed (NET_DEVICE_SIMPLE (self));
|
guint speed = nm_device_ethernet_get_speed (NM_DEVICE_ETHERNET (nm_device));
|
||||||
status = panel_device_status_to_localized_string (nm_device, speed);
|
if (speed > 0) {
|
||||||
|
/* Translators: network device speed */
|
||||||
|
speed_text = g_strdup_printf (_("%d Mb/s"), speed);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
status = panel_device_status_to_localized_string (nm_device, speed_text);
|
||||||
hdy_action_row_set_title (self->details_row, status);
|
hdy_action_row_set_title (self->details_row, status);
|
||||||
|
|
||||||
populate_ui (self);
|
populate_ui (self);
|
||||||
|
@ -567,11 +556,9 @@ device_ethernet_refresh (NetObject *object)
|
||||||
static void
|
static void
|
||||||
net_device_ethernet_class_init (NetDeviceEthernetClass *klass)
|
net_device_ethernet_class_init (NetDeviceEthernetClass *klass)
|
||||||
{
|
{
|
||||||
NetDeviceSimpleClass *simple_class = NET_DEVICE_SIMPLE_CLASS (klass);
|
|
||||||
NetObjectClass *obj_class = NET_OBJECT_CLASS (klass);
|
NetObjectClass *obj_class = NET_OBJECT_CLASS (klass);
|
||||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
|
|
||||||
simple_class->get_speed = device_ethernet_get_speed;
|
|
||||||
obj_class->refresh = device_ethernet_refresh;
|
obj_class->refresh = device_ethernet_refresh;
|
||||||
obj_class->add_to_stack = device_ethernet_add_to_stack;
|
obj_class->add_to_stack = device_ethernet_add_to_stack;
|
||||||
object_class->constructed = device_ethernet_constructed;
|
object_class->constructed = device_ethernet_constructed;
|
||||||
|
|
|
@ -202,24 +202,16 @@ net_device_simple_finalize (GObject *object)
|
||||||
G_OBJECT_CLASS (net_device_simple_parent_class)->finalize (object);
|
G_OBJECT_CLASS (net_device_simple_parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *
|
|
||||||
device_simple_get_speed (NetDeviceSimple *simple)
|
|
||||||
{
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
net_device_simple_class_init (NetDeviceSimpleClass *klass)
|
net_device_simple_class_init (NetDeviceSimpleClass *klass)
|
||||||
{
|
{
|
||||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
NetObjectClass *parent_class = NET_OBJECT_CLASS (klass);
|
NetObjectClass *parent_class = NET_OBJECT_CLASS (klass);
|
||||||
NetDeviceSimpleClass *simple_class = NET_DEVICE_SIMPLE_CLASS (klass);
|
|
||||||
|
|
||||||
object_class->finalize = net_device_simple_finalize;
|
object_class->finalize = net_device_simple_finalize;
|
||||||
object_class->constructed = net_device_simple_constructed;
|
object_class->constructed = net_device_simple_constructed;
|
||||||
parent_class->add_to_stack = device_simple_proxy_add_to_stack;
|
parent_class->add_to_stack = device_simple_proxy_add_to_stack;
|
||||||
parent_class->refresh = device_simple_refresh;
|
parent_class->refresh = device_simple_refresh;
|
||||||
simple_class->get_speed = device_simple_get_speed;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -269,14 +261,6 @@ net_device_simple_new (CcPanel *panel,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
|
||||||
net_device_simple_get_speed (NetDeviceSimple *self)
|
|
||||||
{
|
|
||||||
NetDeviceSimpleClass *klass = NET_DEVICE_SIMPLE_GET_CLASS (self);
|
|
||||||
|
|
||||||
return klass->get_speed (self);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
net_device_simple_add_row (NetDeviceSimple *self,
|
net_device_simple_add_row (NetDeviceSimple *self,
|
||||||
const char *label_string,
|
const char *label_string,
|
||||||
|
|
|
@ -33,9 +33,7 @@ G_DECLARE_DERIVABLE_TYPE (NetDeviceSimple, net_device_simple, NET, DEVICE_SIMPLE
|
||||||
|
|
||||||
struct _NetDeviceSimpleClass
|
struct _NetDeviceSimpleClass
|
||||||
{
|
{
|
||||||
NetDeviceClass parent_class;
|
NetDeviceClass parent_class;
|
||||||
|
|
||||||
char *(*get_speed) (NetDeviceSimple *device_simple);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
NetDeviceSimple *net_device_simple_new (CcPanel *panel,
|
NetDeviceSimple *net_device_simple_new (CcPanel *panel,
|
||||||
|
@ -44,8 +42,6 @@ NetDeviceSimple *net_device_simple_new (CcPanel *panel,
|
||||||
NMDevice *device,
|
NMDevice *device,
|
||||||
const gchar *id);
|
const gchar *id);
|
||||||
|
|
||||||
char *net_device_simple_get_speed (NetDeviceSimple *device_simple);
|
|
||||||
|
|
||||||
void net_device_simple_add_row (NetDeviceSimple *device_simple,
|
void net_device_simple_add_row (NetDeviceSimple *device_simple,
|
||||||
const char *label,
|
const char *label,
|
||||||
const char *property_name);
|
const char *property_name);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue