From 07019909f307bb5566178d9794b2fd36af862fcf Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 24 May 2015 07:36:30 +0200 Subject: [PATCH] (task_database.c) Start creating directory list of database entries to browse over --- tasks/task_database.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tasks/task_database.c b/tasks/task_database.c index 785645cce5..21c8b462ed 100644 --- a/tasks/task_database.c +++ b/tasks/task_database.c @@ -12,9 +12,8 @@ * You should have received a copy of the GNU General Public License along with RetroArch. * If not, see . */ -#include -#include -#include "../file_ext.h" + +#include "../dir_list_special.h" #include "../file_ops.h" #include "../general.h" @@ -179,6 +178,12 @@ void rarch_main_data_db_iterate(bool is_thread, void *data) switch (db->status) { case DATABASE_STATUS_ITERATE_BEGIN: + if (!runloop->db.list) + { + runloop->db.list = dir_list_new_special(NULL, DIR_LIST_DATABASES); + runloop->db.list_index = 0; + runloop->db.entry_index = 0; + } db->status = DATABASE_STATUS_ITERATE_START; break; case DATABASE_STATUS_ITERATE_START: @@ -201,6 +206,9 @@ void rarch_main_data_db_iterate(bool is_thread, void *data) } break; case DATABASE_STATUS_FREE: + if (runloop->db.list) + dir_list_free(runloop->db.list); + runloop->db.list = NULL; rarch_main_data_db_cleanup_state(data); database_info_free(db); if (runloop->db.handle)