Skip to content
Snippets Groups Projects
Commit bc2eda0f authored by rswindell's avatar rswindell
Browse files

Fixed issues with newly created or imported subs and dirs being re-sorted by

index (the sub/dir constructor wasn't setting the initial subnum/dirnum
property).
parent 7bbc0a11
No related branches found
No related tags found
No related merge requests found
...@@ -88,6 +88,7 @@ bool new_sub(unsigned new_subnum, unsigned group_num) ...@@ -88,6 +88,7 @@ bool new_sub(unsigned new_subnum, unsigned group_num)
cfg.qhub[q]->sub[s]++; cfg.qhub[q]->sub[s]++;
#endif #endif
new_subboard->subnum = new_subnum;
cfg.sub[new_subnum] = new_subboard; cfg.sub[new_subnum] = new_subboard;
cfg.total_subs++; cfg.total_subs++;
return true; return true;
......
...@@ -72,6 +72,7 @@ static bool new_dir(unsigned new_dirnum, unsigned libnum) ...@@ -72,6 +72,7 @@ static bool new_dir(unsigned new_dirnum, unsigned libnum)
for (unsigned u = cfg.total_dirs; u > new_dirnum; u--) for (unsigned u = cfg.total_dirs; u > new_dirnum; u--)
cfg.dir[u] = cfg.dir[u - 1]; cfg.dir[u] = cfg.dir[u - 1];
new_directory->dirnum = new_dirnum;
cfg.dir[new_dirnum] = new_directory; cfg.dir[new_dirnum] = new_directory;
cfg.total_dirs++; cfg.total_dirs++;
return true; return true;
...@@ -900,7 +901,7 @@ void xfer_cfg() ...@@ -900,7 +901,7 @@ void xfer_cfg()
uifc.changes=1; uifc.changes=1;
} }
fclose(stream); fclose(stream);
if(ported) if(ported && cfg.lib[i]->sort)
sort_dirs(i); sort_dirs(i);
uifc.pop(0); uifc.pop(0);
sprintf(str,"%lu File Areas Imported Successfully (%lu added)",ported, added); sprintf(str,"%lu File Areas Imported Successfully (%lu added)",ported, added);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment