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

rockbox-gerrit-noreply--- via rockbox-cvs <[email protected]>
Newsgroups gmane.comp.systems.archos.rockbox.cvs
Message-ID <[email protected]>
commit cacbd9aad2b9b523ddeb04cd67fdf7c5adbec885
Author: Christian Soffke <[email protected]>
Date:   Sun Aug 16 14:09:11 2026 +0200

    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

diff --git a/apps/gui/quickscreen.h b/apps/gui/quickscreen.h
index 28a012669b..1631a62e02 100644
--- a/apps/gui/quickscreen.h
+++ b/apps/gui/quickscreen.h
@@ -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_*/
diff --git a/apps/gui/skin_engine/skin_engine.c b/apps/gui/skin_engine/skin_engine.c
index 61a0c65e02..b7aaf65a6b 100644
--- a/apps/gui/skin_engine/skin_engine.c
+++ b/apps/gui/skin_engine/skin_engine.c
@@ -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;
diff --git a/apps/gui/skin_engine/skin_engine.h b/apps/gui/skin_engine/skin_engine.h
index f06c4c86f0..6fe3f7248b 100644
--- a/apps/gui/skin_engine/skin_engine.h
+++ b/apps/gui/skin_engine/skin_engine.h
@@ -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);
 
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c
index af0c83a8b2..0bbabb9f3f 100644
--- a/apps/gui/skin_engine/skin_parser.c
+++ b/apps/gui/skin_engine/skin_parser.c
@@ -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)
 {
diff --git a/apps/gui/skin_engine/wps_internals.h b/apps/gui/skin_engine/wps_internals.h
index e39358b80d..092f0991b0 100644
--- a/apps/gui/skin_engine/wps_internals.h
+++ b/apps/gui/skin_engine/wps_internals.h
@@ -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);
 
-- 
rockbox-cvs mailing list
[email protected]
https://lists.haxx.se/mailman/listinfo/rockbox-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.