disk: update.

This commit is contained in:
Alastair Poole 2020-12-28 23:05:58 +00:00
parent f03f80e9f2
commit d2d19823d2
1 changed files with 13 additions and 4 deletions

View File

@ -16,6 +16,7 @@ typedef struct
Ecore_Thread *thread;
int (*sort_cb)(const void *, const void *);
Eina_Bool sort_reverse;
Eina_Bool skip_wait;
Ui *ui;
} Ui_Data;
@ -235,10 +236,20 @@ _item_disk_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info
static void
_disks_poll(void *data, Ecore_Thread *thread)
{
Ui_Data *pd = data;
while (!ecore_thread_check(thread))
{
ecore_thread_feedback(thread, file_system_info_all_get());
usleep(1000000);
for (int i = 0; i < 8; i++)
{
if (pd->skip_wait)
{
pd->skip_wait = 0;
break;
}
usleep(125000);
}
}
}
@ -273,9 +284,7 @@ _disks_poll_feedback_cb(void *data, Ecore_Thread *thread, void *msgdata)
static void
_disks_poll_update(Ui_Data *pd)
{
Eina_List *mounted = file_system_info_all_get();
_disks_poll_feedback_cb(pd, NULL, mounted);
pd->skip_wait = 1;
}
static void