Create dir_is_empty

This commit is contained in:
twinaphex 2016-10-01 23:30:09 +02:00
parent bdf379d568
commit 9050f75fc8
3 changed files with 18 additions and 25 deletions

31
dirs.c
View File

@ -172,24 +172,23 @@ void dir_check_shader(bool pressed_next, bool pressed_prev)
/* empty functions */
bool dir_is_system_empty(void)
bool dir_is_empty(enum rarch_dir_type type)
{
return string_is_empty(dir_savefile);
}
switch (type)
{
case RARCH_DIR_SYSTEM:
return string_is_empty(dir_savefile);
case RARCH_DIR_SAVEFILE:
return string_is_empty(dir_savefile);
case RARCH_DIR_SAVESTATE:
return string_is_empty(dir_savestate);
case RARCH_DIR_OSK_OVERLAY:
return string_is_empty(dir_osk_overlay);
case RARCH_DIR_NONE:
break;
}
bool dir_is_savefile_empty(void)
{
return string_is_empty(dir_savefile);
}
bool dir_is_savestate_empty(void)
{
return string_is_empty(dir_savestate);
}
bool dir_is_osk_overlay_empty(void)
{
return string_is_empty(dir_osk_overlay);
return false;
}
/* get size functions */

8
dirs.h
View File

@ -44,13 +44,7 @@ void dir_check_shader(bool pressed_next, bool pressed_prev);
/* empty functions */
bool dir_is_savefile_empty(void);
bool dir_is_savestate_empty(void);
bool dir_is_system_empty(void);
bool dir_is_osk_overlay_empty(void);
bool dir_is_empty(enum rarch_dir_type type);
/* clear functions */

View File

@ -847,9 +847,9 @@ static void menu_content_environment_get(int *argc, char *argv[],
if (!path_is_empty(RARCH_PATH_CONFIG))
wrap_args->config_path = path_get(RARCH_PATH_CONFIG);
if (!dir_is_savefile_empty())
if (!dir_is_empty(RARCH_DIR_SAVEFILE))
wrap_args->sram_path = dir_get_savefile();
if (!dir_is_savestate_empty())
if (!dir_is_empty(RARCH_DIR_SAVESTATE))
wrap_args->state_path = dir_get_savestate();
if (fullpath && *fullpath)
wrap_args->content_path = fullpath;