From f99f7440006760ed67e1d991c8658b484f3aae90 Mon Sep 17 00:00:00 2001 From: Helloman892 <1565516+Helloman892@users.noreply.github.com> Date: Sat, 16 Sep 2017 17:23:35 +0100 Subject: [PATCH] fixed theme extdata corruption when installing shuffle themes after scanning a qr code --- include/common.h | 1 + source/main.c | 8 ++++++-- source/themes.c | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/include/common.h b/include/common.h index 6ce2674..db2f785 100644 --- a/include/common.h +++ b/include/common.h @@ -48,6 +48,7 @@ static const int THEMES_PER_SCREEN = 4; bool homebrew; bool splash_mode; +int shuffle_theme_count; enum TextureID { TEXTURE_FONT_RESERVED = 0, //used by pp2d for the font diff --git a/source/main.c b/source/main.c index 3959957..34675b7 100644 --- a/source/main.c +++ b/source/main.c @@ -96,7 +96,7 @@ int main(void) int selected_splash = 0; int selected_theme = 0; int previously_selected = 0; - int shuffle_theme_count = 0; + shuffle_theme_count = 0; bool preview_mode = false; while(aptMainLoop()) @@ -210,7 +210,11 @@ int main(void) draw_theme_install(SINGLE_INSTALL); single_install(*current_theme); } - //these two are here just so I don't forget how to implement them - HM + //these are here just so I don't forget how to implement them - HM + //if (current_theme->in_shuffle) { + // shuffle_theme_count--; + // current_theme->in_shuffle = false; + //} //del_theme(current_theme->path); //get_themes(&themes_list, &theme_count); } diff --git a/source/themes.c b/source/themes.c index 38c2ab9..9d4febb 100644 --- a/source/themes.c +++ b/source/themes.c @@ -152,6 +152,7 @@ static void parse_smdh(Theme_s *theme, ssize_t textureID, u16 *dir_name) Result get_themes(Theme_s **themes_list, int *theme_count) { + shuffle_theme_count = 0; Result res = 0; Handle dir_handle; res = FSUSER_OpenDirectory(&dir_handle, ArchiveSD, fsMakePath(PATH_ASCII, THEMES_PATH));