This commit is contained in:
LibretroAdmin 2025-02-11 10:28:16 +01:00
parent 98681ace4a
commit 0f5a990141
7 changed files with 282 additions and 277 deletions

View File

@ -54,27 +54,24 @@ const char* config_get_cloud_sync_driver_options(void)
return char_list_new_special(STRING_LIST_CLOUD_SYNC_DRIVERS, NULL);
}
void cloud_sync_find_driver(
settings_t *settings,
const char *prefix,
bool verbosity_enabled)
void cloud_sync_find_driver(const char *cloud_sync_driver,
const char *prefix, bool verbosity_enabled)
{
cloud_sync_driver_state_t
*cloud_sync_st = &cloud_sync_driver_st;
int i = (int)driver_find_index(
"cloud_sync_driver",
settings->arrays.cloud_sync_driver);
"cloud_sync_driver", cloud_sync_driver);
if (i >= 0)
cloud_sync_st->driver = (const cloud_sync_driver_t*)
cloud_sync_drivers[i];
else
{
if (verbosity_enabled && settings->arrays.cloud_sync_driver[0])
if (verbosity_enabled && cloud_sync_driver[0])
{
unsigned d;
RARCH_ERR("Couldn't find any %s named \"%s\"\n", prefix,
settings->arrays.cloud_sync_driver);
cloud_sync_driver);
RARCH_LOG_OUTPUT("Available %ss are:\n", prefix);
for (d = 0; cloud_sync_drivers[d]; d++)

View File

@ -19,8 +19,6 @@
#include <stddef.h>
#include <streams/file_stream.h>
#include "../configuration.h"
RETRO_BEGIN_DECLS
/*
@ -66,7 +64,8 @@ extern const cloud_sync_driver_t *cloud_sync_drivers[];
**/
const char* config_get_cloud_sync_driver_options(void);
void cloud_sync_find_driver(settings_t *settings, const char *prefix, bool verbosity_enabled);
void cloud_sync_find_driver(const char *drv, const char *prefix,
bool verbosity_enabled);
bool cloud_sync_begin(cloud_sync_complete_handler_t cb, void *user_data);
bool cloud_sync_end(cloud_sync_complete_handler_t cb, void *user_data);

View File

@ -163,8 +163,7 @@ bool recording_deinit(void)
{
recording_state_t *recording_st = &recording_state;
#ifdef HAVE_FFMPEG
settings_t *settings = config_get_ptr();
bool history_list_enable = settings->bools.history_list_enable;
bool history_list_enable = config_get_ptr()->bools.history_list_enable;
#endif
if ( !recording_st->data

View File

@ -5813,6 +5813,7 @@ void main_exit(void *args)
**/
int rarch_main(int argc, char *argv[], void *data)
{
settings_t *settings;
struct rarch_state *p_rarch = &rarch_st;
runloop_state_t *runloop_st = runloop_state_get_ptr();
video_driver_state_t *video_st = video_state_get_ptr();
@ -5894,7 +5895,18 @@ int rarch_main(int argc, char *argv[], void *data)
return 1;
}
ui_companion_driver_init_first();
settings = config_get_ptr();
ui_companion_driver_init_first(
#ifdef HAVE_QT
settings->bools.desktop_menu_enable,
settings->bools.ui_companion_toggle,
#else
false,
false,
#endif
settings->bools.ui_companion_start_on_boot
);
#if HAVE_CLOUDSYNC
task_push_cloud_sync();
#endif
@ -7770,7 +7782,7 @@ bool retroarch_main_init(int argc, char *argv[])
wifi_driver_ctl(RARCH_WIFI_CTL_FIND_DRIVER, NULL);
#endif
#ifdef HAVE_CLOUDSYNC
cloud_sync_find_driver(settings,
cloud_sync_find_driver(settings->arrays.cloud_sync_driver,
"cloud sync driver", verbosity_enabled);
#endif
location_driver_find_driver(settings->arrays.location_driver,

View File

@ -1279,10 +1279,11 @@ void task_push_cloud_sync(void)
void task_push_cloud_sync_update_driver(void)
{
char manifest_path[PATH_MAX_LENGTH];
char manifest_path[PATH_MAX_LENGTH];
settings_t *settings = config_get_ptr();
cloud_sync_find_driver(settings, "cloud sync driver", verbosity_is_enabled());
cloud_sync_find_driver(settings->arrays.cloud_sync_driver,
"cloud sync driver", verbosity_is_enabled());
/* The sync does a three-way diff: current local <- last sync -> current server.
* When the server changes it becomes a four way diff, which can lead to odd

View File

@ -21,8 +21,6 @@
#endif
#include "../list_special.h"
#include "../retroarch.h"
#include "../runloop.h"
#include "../verbosity.h"
#include "ui_companion_driver.h"
@ -134,25 +132,20 @@ void ui_companion_driver_toggle(
#endif
}
void ui_companion_driver_init_first(void)
void ui_companion_driver_init_first(
bool desktop_menu_enable,
bool ui_companion_toggle,
unsigned ui_companion_start_on_boot
)
{
uico_driver_state_t *uico_st = &uico_driver_st;
settings_t *settings = config_get_ptr();
#ifdef HAVE_QT
bool desktop_menu_enable = settings->bools.desktop_menu_enable;
bool ui_companion_toggle = settings->bools.ui_companion_toggle;
if (desktop_menu_enable && ui_companion_toggle)
{
uico_st->qt_data = ui_companion_qt.init();
uico_st->flags |= UICO_ST_FLAG_QT_IS_INITED;
}
#else
bool desktop_menu_enable = false;
bool ui_companion_toggle = false;
#endif
unsigned ui_companion_start_on_boot =
settings->bools.ui_companion_start_on_boot;
uico_st->drv = (ui_companion_driver_t*)ui_companion_drivers[0];
if (!uico_st->drv)

View File

@ -169,7 +169,11 @@ void *ui_companion_driver_get_main_window(void);
const char *ui_companion_driver_get_ident(void);
void ui_companion_driver_init_first(void);
void ui_companion_driver_init_first(
bool desktop_menu_enable,
bool ui_companion_toggle,
unsigned ui_companion_start_on_boot
);
void ui_companion_driver_msg_queue_push(
const char *msg, unsigned priority,