1
0
mirror of https://github.com/libretro/RetroArch synced 2025-02-16 12:39:59 +00:00

remove dependence on configuration.h inside task_database.c

This commit is contained in:
twinaphex 2017-01-18 01:23:09 +01:00
parent 039064d0f1
commit a3f5590f41
3 changed files with 20 additions and 10 deletions

@ -54,6 +54,7 @@ int action_scan_file(const char *path,
const char *menu_label = NULL;
const char *menu_path = NULL;
menu_handle_t *menu = NULL;
settings_t *settings = config_get_ptr();
fullpath[0] = '\0';
@ -64,7 +65,10 @@ int action_scan_file(const char *path,
fill_pathname_join(fullpath, menu_path, path, sizeof(fullpath));
task_push_dbscan(fullpath, false, handle_dbscan_finished);
task_push_dbscan(
settings->directory.playlist,
settings->path.content_database,
fullpath, false, handle_dbscan_finished);
return 0;
}
@ -77,6 +81,7 @@ int action_scan_directory(const char *path,
const char *menu_label = NULL;
const char *menu_path = NULL;
menu_handle_t *menu = NULL;
settings_t *settings = config_get_ptr();
fullpath[0] = '\0';
@ -90,7 +95,10 @@ int action_scan_directory(const char *path,
if (path)
fill_pathname_join(fullpath, fullpath, path, sizeof(fullpath));
task_push_dbscan(fullpath, true, handle_dbscan_finished);
task_push_dbscan(
settings->directory.playlist,
settings->path.content_database,
fullpath, true, handle_dbscan_finished);
return 0;
}

@ -28,7 +28,6 @@
#include "../database_info.h"
#include "../configuration.h"
#include "../file_path_special.h"
#include "../list_special.h"
#include "../msg_hash.h"
@ -700,10 +699,12 @@ task_finished:
free(dbinfo);
}
bool task_push_dbscan(const char *fullpath,
bool task_push_dbscan(
const char *playlist_directory,
const char *content_database,
const char *fullpath,
bool directory, retro_task_callback_t cb)
{
settings_t *settings = config_get_ptr();
retro_task_t *t = (retro_task_t*)calloc(1, sizeof(*t));
db_handle_t *db = (db_handle_t*)calloc(1, sizeof(db_handle_t));
@ -714,11 +715,9 @@ bool task_push_dbscan(const char *fullpath,
t->state = db;
t->callback = cb;
strlcpy(db->playlist_directory,
settings->directory.playlist,
strlcpy(db->playlist_directory, playlist_directory,
sizeof(db->playlist_directory));
strlcpy(db->content_database_path,
settings->path.content_database,
strlcpy(db->content_database_path, content_database,
sizeof(db->content_database_path));
if (directory)

@ -104,7 +104,10 @@ bool task_push_image_load(const char *fullpath,
retro_task_callback_t cb, void *userdata);
#ifdef HAVE_LIBRETRODB
bool task_push_dbscan(const char *fullpath,
bool task_push_dbscan(
const char *playlist_directory,
const char *content_database,
const char *fullpath,
bool directory, retro_task_callback_t cb);
#endif