Skip to content

Commit

Permalink
Fix notification display of memory card
Browse files Browse the repository at this point in the history
  • Loading branch information
uyjulian committed Aug 3, 2020
1 parent ba2bc14 commit e967710
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
11 changes: 4 additions & 7 deletions src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,25 +163,22 @@ static char cfgDevice[8];

char *configGetDir(void)
{
if (!strncmp(cfgDevice, "mc", 2)) {
cfgDevice[2] = getmcID();
}

char *path = cfgDevice;
return path;
}

void configPrepareNotifications(char *prefix)
{
int mcID;
char *colpos;

snprintf(cfgDevice, sizeof(cfgDevice), prefix);
if (!strncmp(cfgDevice, "mc?", 3)) {
mcID = getmcID();
cfgDevice[2] = mcID;
}

if ((colpos = strchr(cfgDevice, ':')) != NULL)
*(colpos + 1) = '\0';

showCfgPopup = 1;
}

void configInit(char *prefix)
Expand Down
5 changes: 4 additions & 1 deletion src/opl.c
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,7 @@ static void _loadConfig()

lscret = result;
lscstatus = 0;
showCfgPopup = 1;
}

static int trySaveConfigUSB(int types)
Expand Down Expand Up @@ -896,8 +897,10 @@ static void _saveConfig()
}

char *path = configGetDir();
if (!strncmp(path, "mc", 2))
if (!strncmp(path, "mc", 2)) {
checkMCFolder();
configPrepareNotifications(gBaseMCDir);
}

lscret = configWriteMulti(lscstatus);
if (lscret == 0)
Expand Down

0 comments on commit e967710

Please sign in to comment.