skin_engine/quickscreen: get rid of unused code, update comment, naming

- remove quickscreen_set_option prototype left
  behind from commit a22749b
- make skin_load internal to the skin_engine
- remove skin_load's isfile parameter, since
  it's always true
- update comment for skin_data_load
- slight naming adjustments
- replace MAX_PATH with sizeof

Change-Id: I6fcbcf0d3e36730c5096f38d31f8e44b92498068
This commit is contained in:
Christian Soffke 2026-08-16 14:09:11 +02:00
parent b616047311
commit cacbd9aad2
5 changed files with 16 additions and 21 deletions

View file

@ -45,7 +45,6 @@ enum quickscreen_return {
};
extern int quick_screen_quick(int button_enter);
int quickscreen_set_option(void *data);
bool is_setting_quickscreenable(const struct settings_list *setting);
#endif /*_GUI_QUICK_SCREEN_H_*/

View file

@ -203,22 +203,22 @@ void settings_apply_skins(void)
skin_backdrop_show(sb_get_backdrop(i));
}
void skin_load(enum skinnable_screens skin, enum screen_type screen,
const char *buf, bool isfile)
static void skin_load(enum skinnable_screens skin, enum screen_type screen,
const char *filename)
{
bool loaded = false;
skin_helpers[skin]->process(screen, &skins[skin][screen].data, true);
if (buf && *buf)
loaded = skin_data_load(screen, &skins[skin][screen].data, buf, isfile,
&skins[skin][screen].stats);
if (filename && *filename)
loaded = skin_data_load(screen, &skins[skin][screen].data,
filename, true, &skins[skin][screen].stats);
if (!loaded && skin_helpers[skin]->default_skin)
{
loaded = skin_data_load(screen, &skins[skin][screen].data,
skin_helpers[skin]->default_skin(screen), false,
&skins[skin][screen].stats);
skin_helpers[skin]->default_skin(screen),
false, &skins[skin][screen].stats);
skins[skin][screen].failsafe_loaded = loaded;
}
@ -230,8 +230,8 @@ void skin_load(enum skinnable_screens skin, enum screen_type screen,
#endif
}
static char* get_skin_filename(char *buf, size_t buf_size,
enum skinnable_screens skin, enum screen_type screen)
static char* get_skin_filename(enum skinnable_screens skin, enum screen_type screen,
char *buf, size_t buf_size)
{
(void)screen;
char *setting = NULL, *ext = NULL;
@ -300,10 +300,10 @@ struct gui_wps *skin_get_gwps(enum skinnable_screens skin, enum screen_type scre
if (skins[skin][screen].data.wps_loaded == false)
{
char filename[MAX_PATH];
char *buf = get_skin_filename(filename, MAX_PATH, skin, screen);
char buf[MAX_PATH];
const char *filename = get_skin_filename(skin, screen, buf, sizeof buf);
cpu_boost(true);
skin_load(skin, screen, buf, true);
skin_load(skin, screen, filename);
cpu_boost(false);
}
return &skins[skin][screen].gui_wps;

View file

@ -73,8 +73,6 @@ void skin_backdrop_set_buffer(int backdrop_id, struct skin_viewport *svp);
*/
int skin_wait_for_action(enum skinnable_screens skin, int context, int timeout);
void skin_load(enum skinnable_screens skin, enum screen_type screen,
const char *buf, bool isfile);
struct gui_wps *skin_get_gwps(enum skinnable_screens skin, enum screen_type screen);
void gui_sync_skin_init(void);

View file

@ -2591,8 +2591,8 @@ static int skin_element_callback(struct skin_element* element, void* data)
return CALLBACK_OK;
}
/* to setup up the wps-data from a format-buffer (isfile = false)
from a (wps-)file (isfile = true)*/
/* Set up skin data from a format buffer (isfile = false)
or from skin file (isfile = true) */
bool skin_data_load(enum screen_type screen, struct wps_data *wps_data,
const char *buf, bool isfile, struct skin_stats *stats)
{

View file

@ -44,10 +44,8 @@ struct skin_stats *skin_get_stats(int number, int screen);
#define skin_clear_stats(stats) memset(stats, 0, sizeof(struct skin_stats))
bool skin_backdrop_get_debug(int index, char **path, int *ref_count, size_t *size);
/*
* setup up the skin-data from a format-buffer (isfile = false)
* or from a skinfile (isfile = true)
*/
/* Set up skin data from a format buffer (isfile = false)
or from skin file (isfile = true) */
bool skin_data_load(enum screen_type screen, struct wps_data *wps_data,
const char *buf, bool isfile, struct skin_stats *stats);