Enlightenment CVS committal

Author  : englebass
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/modules/temperature


Modified Files:
        e_mod_main.c 


Log Message:
Don't set a default ACPI temperature sensor.
Use the first available temperature sensor if none is set.

===================================================================
RCS file: /cvs/e/e17/apps/e/src/modules/temperature/e_mod_main.c,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -3 -r1.71 -r1.72
--- e_mod_main.c        21 Oct 2006 02:32:14 -0000      1.71
+++ e_mod_main.c        14 Dec 2006 15:07:47 -0000      1.72
@@ -269,14 +269,15 @@
      }
    else
      {
-       char *name;
+       const char *name;
 
-       ret = 1;
-       while ((name = ecore_list_next(therms)))
+       ret = 0;
+       name = temperature_config->acpi_sel;
+       if (!name) name = ecore_list_next(therms);
+       if (name)
          {
             char *p, *q;
             FILE *f;
-            name = temperature_config->acpi_sel;
             snprintf(buf, sizeof(buf), 
"/proc/acpi/thermal_zone/%s/temperature", name);
             f = fopen(buf, "rb");
             if (f)
@@ -284,16 +285,15 @@
                  fgets(buf, sizeof(buf), f); buf[sizeof(buf) - 1] = 0;
                  fclose(f);
                  p = strchr(buf, ':');
-                 if (!p)
+                 if (p)
                    {
-                      ret = 0;
-                      continue;
+                      p++;
+                      while (*p == ' ') p++;
+                      q = strchr(p, ' ');
+                      if (q) *q = 0;
+                      temp = atoi(p);
+                      ret = 1;
                    }
-                 p++;
-                 while (*p == ' ') p++;
-                 q = strchr(p, ' ');
-                 if (q) *q = 0;
-                 temp = atoi(p);
               }
          }
        ecore_list_destroy(therms);
@@ -414,7 +414,7 @@
        temperature_config->high = 80;
        temperature_config->sensor_name = evas_stringshare_add("temp1");
        temperature_config->units = CELCIUS;
-       temperature_config->acpi_sel = evas_stringshare_add("TZ1");
+       temperature_config->acpi_sel = NULL;
      }
    E_CONFIG_LIMIT(temperature_config->poll_time, 0.5, 1000.0);
    E_CONFIG_LIMIT(temperature_config->low, 0, 100);



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to