/** * @return Return 1 if the trash is empty or 0 if some file are in. * @brief Check if the trash is currently empty */ EAPI int efreet_trash_is_empty(void) { char buf[PATH_MAX]; snprintf(buf, sizeof(buf), "%s/files", efreet_trash_dir_get(NULL)); /* TODO Check also trash in other filesystems */ return ecore_file_dir_is_empty(buf); }
static void _walle_wall_populate(Walle *walle, const char *directory, const char *theme) { Evas_Object *o; Evas_Coord ow, oh, w, h; Eina_List *files = NULL; char *file = NULL; char filename[4096]; if (!ecore_file_is_dir(directory) && ecore_file_dir_is_empty(directory)) return; files = ecore_file_ls(directory); if (!files) return; EINA_LIST_FREE(files, file) { sprintf(filename, "%s/%s", directory, file); o = evas_object_image_add(walle->evas); evas_object_image_file_set(o, filename, NULL); switch(evas_object_image_load_error_get(o)) { case EVAS_LOAD_ERROR_NONE: { evas_object_event_callback_add(o, EVAS_CALLBACK_RESIZE, _walle_picture_cb_resize, o); evas_object_image_size_get(o, &w, &h); oh = 200; ow = oh * (float)w/(float)h; evas_object_image_load_size_set(o, ow, oh); evas_object_image_fill_set(o, 0, 0, ow, oh); evas_object_resize(o, ow, oh); evas_object_size_hint_min_set(o, ow, oh); walle_wall_append(walle->o_wall, o); walle->pictures = eina_list_append(walle->pictures, o); } break; default: evas_object_del(o); break; } }