Enlightenment CVS committal

Author  : raster
Project : e17
Module  : apps/e

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


Modified Files:
        batget.c 


Log Message:


better detection of apm vs powerclass... as i have no seen a system with BOTH
of them active! argh!

===================================================================
RCS file: /cvs/e/e17/apps/e/src/modules/battery/batget.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- batget.c    28 Apr 2008 11:12:25 -0000      1.9
+++ batget.c    30 Apr 2008 05:33:44 -0000      1.10
@@ -1317,6 +1317,23 @@
 
 
 
+static int
+dir_has_contents(const char *dir)
+{
+   Ecore_List *bats;
+   char *name;
+       
+   bats = ecore_file_ls(dir);
+   if (bats)
+     {
+       int count;
+       
+       count = ecore_list_count(bats);
+       ecore_list_destroy(bats);
+       if (count > 0) return 1;
+     }
+   return 0;
+}
 
 static void
 init(void)
@@ -1349,6 +1366,7 @@
    darwin_init();
 #else
    if ((ecore_file_is_dir("/sys/class/power_supply")) &&
+       (dir_has_contents("/sys/class/power_supply")) &&
        (!ecore_file_exists("/proc/apm"))) /* >= 2.6.24 */
      {
        mode = CHECK_SYS_CLASS_POWER_SUPPLY;



-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to