Skip to content

Commit

Permalink
For Android ROMs use default icon if no custom icon is set
Browse files Browse the repository at this point in the history
  • Loading branch information
nkk71 authored and AdrianDC committed Nov 2, 2017
1 parent 93c8828 commit 0d54ccd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 12 additions & 3 deletions multirom.c
Expand Up @@ -3032,6 +3032,8 @@ int multirom_run_scripts(const char *type, struct multirom_rom *rom)
#define USER_IC_PATH_LEN 46
#define DEFAULT_ICON "/icons/romic_default.png"
#define DEFAULT_ICON_LEN 24
#define DEFAULT_ANDROID_ICON "/icons/romic_android_default.png"
#define DEFAULT_ANDROID_ICON_LEN 32

void multirom_find_rom_icon(struct multirom_rom *rom)
{
Expand Down Expand Up @@ -3096,7 +3098,14 @@ void multirom_find_rom_icon(struct multirom_rom *rom)
if(f)
fclose(f);

len = strlen(mrom_dir()) + DEFAULT_ICON_LEN + 1;
rom->icon_path = realloc(rom->icon_path, len);
snprintf(rom->icon_path, len, "%s%s", mrom_dir(), DEFAULT_ICON);
if (rom->type & MASK_ANDROID) {
len = strlen(mrom_dir()) + DEFAULT_ANDROID_ICON_LEN + 1;
rom->icon_path = realloc(rom->icon_path, len);
snprintf(rom->icon_path, len, "%s%s", mrom_dir(), DEFAULT_ANDROID_ICON);
}
else {
len = strlen(mrom_dir()) + DEFAULT_ICON_LEN + 1;
rom->icon_path = realloc(rom->icon_path, len);
snprintf(rom->icon_path, len, "%s%s", mrom_dir(), DEFAULT_ICON);
}
}

0 comments on commit 0d54ccd

Please sign in to comment.