Don't delete the fileassoc entry when loading the icon failed.
This commit is contained in:
parent
7f1a9f4f29
commit
88fe495bd8
@ -527,7 +527,7 @@ bool menuEntryLoad(menuEntry_s* me, const char* name, bool shortcut, bool check_
|
|||||||
}
|
}
|
||||||
|
|
||||||
void menuEntryFileassocLoad(const char* filepath) {
|
void menuEntryFileassocLoad(const char* filepath) {
|
||||||
bool success=0, success2=0;
|
bool success=0, iconLoaded=0;
|
||||||
menuEntry_s* me = NULL;
|
menuEntry_s* me = NULL;
|
||||||
|
|
||||||
config_setting_t *fileassoc = NULL, *targets = NULL, *target = NULL;
|
config_setting_t *fileassoc = NULL, *targets = NULL, *target = NULL;
|
||||||
@ -615,7 +615,7 @@ void menuEntryFileassocLoad(const char* filepath) {
|
|||||||
if ((target_file_extension[0]!=0) == (target_filename[0]!=0)) continue;
|
if ((target_file_extension[0]!=0) == (target_filename[0]!=0)) continue;
|
||||||
|
|
||||||
me = menuCreateEntry(ENTRY_TYPE_FILEASSOC);
|
me = menuCreateEntry(ENTRY_TYPE_FILEASSOC);
|
||||||
success2 = 0;
|
iconLoaded = 0;
|
||||||
|
|
||||||
if (me) {
|
if (me) {
|
||||||
strncpy(me->path, app_path, sizeof(me->path));
|
strncpy(me->path, app_path, sizeof(me->path));
|
||||||
@ -634,22 +634,17 @@ void menuEntryFileassocLoad(const char* filepath) {
|
|||||||
}
|
}
|
||||||
me->fileassoc_str[sizeof(me->fileassoc_str)-1] = 0;
|
me->fileassoc_str[sizeof(me->fileassoc_str)-1] = 0;
|
||||||
|
|
||||||
if (target_icon_path[0]) success2 = menuEntryLoadExternalIcon(me, target_icon_path);
|
if (target_icon_path[0]) iconLoaded = menuEntryLoadExternalIcon(me, target_icon_path);
|
||||||
if (!success2 && main_icon_path[0]) success2 = menuEntryLoadExternalIcon(me, main_icon_path);
|
if (!iconLoaded && main_icon_path[0]) iconLoaded = menuEntryLoadExternalIcon(me, main_icon_path);
|
||||||
|
|
||||||
if (success2) {
|
if (iconLoaded) {
|
||||||
menuEntryParseIcon(me);
|
menuEntryParseIcon(me);
|
||||||
} else {
|
} else {
|
||||||
success2 = menuEntryImportIconGfx(me, app_icon_gfx, app_icon_gfx_small);
|
iconLoaded = menuEntryImportIconGfx(me, app_icon_gfx, app_icon_gfx_small);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (me) {
|
if (me) menuFileassocAddEntry(me);
|
||||||
if (success2)
|
|
||||||
menuFileassocAddEntry(me);
|
|
||||||
else
|
|
||||||
menuDeleteEntry(me, 0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user