background: init before main loop.
This commit is contained in:
parent
fca5360b16
commit
99eb28c2bc
|
@ -1,17 +1,14 @@
|
|||
#include "evisum_background.h"
|
||||
#include "../system/filesystems.h"
|
||||
#include "../ui/evisum_ui.h"
|
||||
|
||||
#include <Eina.h>
|
||||
|
||||
void
|
||||
background_poller_cb(void *data, Ecore_Thread *thread)
|
||||
background_init(Evisum_Ui *ui)
|
||||
{
|
||||
meminfo_t memory;
|
||||
power_t power;
|
||||
int32_t poll_count = 0;
|
||||
Battery *bat;
|
||||
Evisum_Ui *ui = data;
|
||||
|
||||
system_memory_usage_get(&memory);
|
||||
ui->mem_total = memory.total;
|
||||
|
@ -33,6 +30,16 @@ background_poller_cb(void *data, Ecore_Thread *thread)
|
|||
}
|
||||
}
|
||||
system_power_state_free(&power);
|
||||
}
|
||||
|
||||
void
|
||||
background_poller_cb(void *data, Ecore_Thread *thread)
|
||||
{
|
||||
meminfo_t memory;
|
||||
power_t power;
|
||||
int32_t poll_count = 0;
|
||||
Battery *bat;
|
||||
Evisum_Ui *ui = data;
|
||||
|
||||
while (!ecore_thread_check(thread))
|
||||
{
|
||||
|
|
|
@ -1,9 +1,13 @@
|
|||
#ifndef EVISUM_BACKGROUND_H
|
||||
#define EVISUM_BACKGROUND_H
|
||||
|
||||
#include "../ui/evisum_ui.h"
|
||||
#include <Ecore.h>
|
||||
|
||||
void
|
||||
background_poller_cb(void *data, Ecore_Thread *thread);
|
||||
|
||||
void
|
||||
background_init(Evisum_Ui *ui);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -109,6 +109,7 @@ elm_main(int argc, char **argv)
|
|||
evisum_server_init(ui);
|
||||
evisum_ui_activate(ui, action, pid);
|
||||
|
||||
background_init(ui);
|
||||
ui->background_poll_thread = ecore_thread_run(background_poller_cb, NULL, NULL, ui);
|
||||
|
||||
ecore_main_loop_begin();
|
||||
|
|
Loading…
Reference in New Issue