[Pkg-e-commits] [SCM] Enlightenment 17 branch, upstream-vcs, updated. a8698069ec4eec9c2a189198fa5eec9854b168ac

raster raster at alioth.debian.org
Sun May 4 21:40:29 UTC 2008


The following commit has been merged in the upstream-vcs branch:
commit e43e4d9ac0d912aa3692770b23807b9ca8803b53
Author: raster <raster>
Date:   Wed Apr 30 05:33:44 2008 +0000

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

diff --git a/src/modules/battery/batget.c b/src/modules/battery/batget.c
index c376f97..aa4ae0d 100644
--- a/src/modules/battery/batget.c
+++ b/src/modules/battery/batget.c
@@ -1317,6 +1317,23 @@ linux_pmu_check(void)
 
 
 
+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 @@ init(void)
    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;

-- 
Enlightenment 17



More information about the Pkg-e-commits mailing list