[gnome-control-center] power: Remove unused `status` code in add_device
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] power: Remove unused `status` code in add_device
- Date: Wed, 14 Oct 2020 22:59:06 +0000 (UTC)
commit dc9a3c993a8bdf3148dd872bb61f219553d7432c
Author: Ian Douglas Scott <idscott system76 com>
Date: Mon Oct 12 11:02:32 2020 -0700
power: Remove unused `status` code in add_device
It seems this was added in ee36b0df91, but the `status` variable has
been unused since a9683772d9 (committed in 2012).
Seems safe to remove if it's been unused since 2012.
panels/power/cc-power-panel.c | 45 -------------------------------------------
1 file changed, 45 deletions(-)
---
diff --git a/panels/power/cc-power-panel.c b/panels/power/cc-power-panel.c
index c7109f277..079037cae 100644
--- a/panels/power/cc-power-panel.c
+++ b/panels/power/cc-power-panel.c
@@ -393,11 +393,9 @@ add_device (CcPowerPanel *panel, UpDevice *device)
GtkWidget *box2;
GtkWidget *widget;
GtkWidget *title;
- g_autoptr(GString) status = NULL;
g_autoptr(GString) description = NULL;
gdouble percentage;
g_autofree gchar *name = NULL;
- gboolean show_caution = FALSE;
gboolean is_present;
UpDeviceLevel battery_level;
@@ -413,54 +411,11 @@ add_device (CcPowerPanel *panel, UpDevice *device)
if (!is_present)
return;
- if (kind == UP_DEVICE_KIND_UPS)
- show_caution = TRUE;
-
if (name == NULL || *name == '\0')
description = g_string_new (_(kind_to_description (kind)));
else
description = g_string_new (name);
- switch (state)
- {
- case UP_DEVICE_STATE_CHARGING:
- case UP_DEVICE_STATE_PENDING_CHARGE:
- /* TRANSLATORS: secondary battery */
- status = g_string_new(C_("Battery power", "Charging"));
- break;
- case UP_DEVICE_STATE_DISCHARGING:
- case UP_DEVICE_STATE_PENDING_DISCHARGE:
- if (percentage < 10 && show_caution)
- {
- /* TRANSLATORS: secondary battery */
- status = g_string_new (C_("Battery power", "Caution"));
- }
- else if (percentage < 30)
- {
- /* TRANSLATORS: secondary battery */
- status = g_string_new (C_("Battery power", "Low"));
- }
- else
- {
- /* TRANSLATORS: secondary battery */
- status = g_string_new (C_("Battery power", "Good"));
- }
- break;
- case UP_DEVICE_STATE_FULLY_CHARGED:
- /* TRANSLATORS: primary battery */
- status = g_string_new (C_("Battery power", "Fully charged"));
- break;
- case UP_DEVICE_STATE_EMPTY:
- /* TRANSLATORS: primary battery */
- status = g_string_new (C_("Battery power", "Empty"));
- break;
- default:
- status = g_string_new (up_device_state_to_string (state));
- break;
- }
- g_string_prepend (status, "<small>");
- g_string_append (status, "</small>");
-
/* create the new widget */
row = no_prelight_row_new ();
gtk_widget_show (row);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]