Skip to content

Commit 0a2c684

Browse files
authored
Warn when scanning with no database present + indicate task failure with icon (#18359)
1 parent ee59a4e commit 0a2c684

4 files changed

Lines changed: 13 additions & 2 deletions

File tree

gfx/gfx_widgets.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1290,7 +1290,8 @@ static void gfx_widgets_draw_task_msg(
12901290
texture = MENU_WIDGETS_ICON_ADD;
12911291
color = msg_queue_task_positive;
12921292
}
1293-
else if (msg->flags & DISPWIDG_FLAG_NEGATIVE)
1293+
else if ( msg->flags & DISPWIDG_FLAG_NEGATIVE
1294+
|| msg->flags & DISPWIDG_FLAG_TASK_ERROR)
12941295
{
12951296
texture = MENU_WIDGETS_ICON_EXIT;
12961297
color = msg_queue_task_negative;

intl/msg_hash_us.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15314,6 +15314,10 @@ MSG_HASH(
1531415314
MSG_SCANNING_OF_DIRECTORY_FINISHED,
1531515315
"Scanning of directory finished."
1531615316
)
15317+
MSG_HASH(
15318+
MSG_SCANNING_NO_DATABASE,
15319+
"Scanning unsuccessful, no database found."
15320+
)
1531715321
MSG_HASH(
1531815322
MSG_SENDING_COMMAND,
1531915323
"Sending command"

msg_hash.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,7 @@ enum msg_hash_enums
507507
MSG_SCANNING,
508508
MSG_SCANNING_OF_DIRECTORY_FINISHED,
509509
MSG_SCANNING_OF_FILE_FINISHED,
510+
MSG_SCANNING_NO_DATABASE,
510511
MSG_LOADED_STATE_FROM_SLOT,
511512
MSG_LOADED_STATE_FROM_SLOT_AUTO,
512513
MSG_REMOVING_TEMPORARY_CONTENT_FILE,

tasks/task_database.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1575,7 +1575,12 @@ static void task_database_handler(retro_task_t *task)
15751575
else
15761576
{
15771577
const char *msg = NULL;
1578-
if (db->flags & DB_HANDLE_FLAG_IS_DIRECTORY)
1578+
if (dbstate->list->size == 0)
1579+
{
1580+
msg = msg_hash_to_str(MSG_SCANNING_NO_DATABASE);
1581+
task_set_error(task, strdup(msg));
1582+
}
1583+
else if (db->flags & DB_HANDLE_FLAG_IS_DIRECTORY)
15791584
msg = msg_hash_to_str(MSG_SCANNING_OF_DIRECTORY_FINISHED);
15801585
else
15811586
msg = msg_hash_to_str(MSG_SCANNING_OF_FILE_FINISHED);

0 commit comments

Comments
 (0)