[Goodies-commits] r4981 - xfce4-sensors-plugin/trunk/panel-plugin

Fabian Nowak timystery at xfce.org
Sat Jun 21 15:01:36 CEST 2008


Author: timystery
Date: 2008-06-21 13:01:36 +0000 (Sat, 21 Jun 2008)
New Revision: 4981

Modified:
   xfce4-sensors-plugin/trunk/panel-plugin/acpi.c
   xfce4-sensors-plugin/trunk/panel-plugin/sensors.c
Log:
enable renaming of acpi features


Modified: xfce4-sensors-plugin/trunk/panel-plugin/acpi.c
===================================================================
--- xfce4-sensors-plugin/trunk/panel-plugin/acpi.c	2008-06-21 11:02:11 UTC (rev 4980)
+++ xfce4-sensors-plugin/trunk/panel-plugin/acpi.c	2008-06-21 13:01:36 UTC (rev 4981)
@@ -95,7 +95,8 @@
 
                 chipfeature->color = "#0000B0";
                 chipfeature->address = chip->chip_features->len;
-                chipfeature->name = g_strdup (de->d_name);
+                chipfeature->devicename = g_strdup (de->d_name);
+                chipfeature->name = g_strdup (chipfeature->devicename);
                 chipfeature->formatted_value = NULL; /*  Gonna refresh it in
                                                         sensors_get_wrapper or some
                                                         other functions */
@@ -236,7 +237,8 @@
                 if (file) {
                     chipfeature = g_new0 (t_chipfeature, 1);
                     chipfeature->address = chip->chip_features->len;
-                    chipfeature->name = g_strdup (de->d_name);
+                    chipfeature->devicename = g_strdup (de->d_name);
+                    chipfeature->name = g_strdup (chipfeature->devicename);
                     chipfeature->valid = TRUE;
                     chipfeature->min_value = 0.0;
                     chipfeature->raw_value = 0.0;
@@ -362,7 +364,8 @@
 
                 chipfeature->color = "#0000B0";
                 chipfeature->address = chip->chip_features->len;
-                chipfeature->name = g_strdup (de->d_name);
+                chipfeature->devicename = g_strdup (de->d_name);
+                chipfeature->name = g_strdup (chipfeature->devicename);
                 chipfeature->formatted_value = NULL; /*  Gonna refresh it in
                                                         sensors_get_wrapper or some
                                                         other functions */
@@ -453,7 +456,7 @@
 
     switch (cf->class) {
         case TEMPERATURE:
-            zone = g_strdup_printf ("%s/%s", ACPI_DIR_THERMAL, cf->name);
+            zone = g_strdup_printf ("%s/%s", ACPI_DIR_THERMAL, cf->devicename);
             cf->raw_value = get_acpi_zone_value (zone, ACPI_FILE_THERMAL);
             g_free (zone);
             /* g_free (cf->formatted_value);
@@ -461,7 +464,7 @@
             break;
 
         case ENERGY:
-            zone = g_strdup_printf ("%s/%s", ACPI_DIR_BATTERY, cf->name);
+            zone = g_strdup_printf ("%s/%s", ACPI_DIR_BATTERY, cf->devicename);
             cf->raw_value = get_battery_zone_value (zone);
             g_free (zone);
             /*  g_free (cf->formatted_value);
@@ -469,7 +472,7 @@
             break;
 
         case STATE:
-            file = g_strdup_printf ("%s/%s/state", ACPI_DIR_FAN, cf->name);
+            file = g_strdup_printf ("%s/%s/state", ACPI_DIR_FAN, cf->devicename);
             cf->raw_value = strcmp(get_acpi_value(file), "on")==0 ? 1.0 : 0.0;
             g_free (file);
             /* g_free (cf->formatted_value);
@@ -508,7 +511,7 @@
 
     version = get_acpi_value (filename);
     if (version!=NULL)
-    	version = g_strchomp (version);
+        version = g_strchomp (version);
 
     if (version==NULL)
         version = _("<Unknown>");

Modified: xfce4-sensors-plugin/trunk/panel-plugin/sensors.c
===================================================================
--- xfce4-sensors-plugin/trunk/panel-plugin/sensors.c	2008-06-21 11:02:11 UTC (rev 4980)
+++ xfce4-sensors-plugin/trunk/panel-plugin/sensors.c	2008-06-21 13:01:36 UTC (rev 4981)
@@ -1489,13 +1489,13 @@
     gtk_tree_store_set (GTK_TREE_STORE (model), &iter, 0, new_text, -1);
     chip = (t_chip *) g_ptr_array_index(sd->sensors->chips, gtk_combo_box_active);
 
-    if (chip->type!=ACPI) { /* No Bug. The cryptic filesystem names are
+    /* if (chip->type!=ACPI) { */ /* No Bug. The cryptic filesystem names are
                                   needed for the update in ACPI and hddtemp. */
         chipfeature = (t_chipfeature *) g_ptr_array_index (chip->chip_features,
                                                             atoi(path_str));
         g_free(chipfeature->name);
         chipfeature->name = g_strdup (new_text);
-    }
+    /* } */
 
     /* clean up */
     gtk_tree_path_free (path);




More information about the Goodies-commits mailing list