update battery module to use new ecore poller functions and avoid destroying poller objects every few seconds

SVN revision: 49003
This commit is contained in:
Mike Blumenkrantz 2010-05-19 09:17:09 +00:00
parent 4fad3f4501
commit 9a864815ef
1 changed files with 2 additions and 3 deletions

View File

@ -202,9 +202,8 @@ _battery_udev_battery_update(const char *syspath, Battery *bat)
if (!(bat = _battery_battery_find(syspath))) if (!(bat = _battery_battery_find(syspath)))
return _battery_udev_battery_add(syspath); return _battery_udev_battery_add(syspath);
} }
/* reset the poller */ /* update the poller interval */
ecore_poller_del(bat->poll); ecore_poller_poller_interval_set(bat->poll, battery_config->poll_interval);
bat->poll = ecore_poller_add(ECORE_POLLER_CORE, battery_config->poll_interval, _battery_udev_battery_update_poll, bat);
GET_NUM(bat, present, POWER_SUPPLY_PRESENT); GET_NUM(bat, present, POWER_SUPPLY_PRESENT);
if (!bat->got_prop) if (!bat->got_prop)