mirror of
https://github.com/d0k3/GodMode9.git
synced 2025-06-26 13:42:47 +00:00
Ignore directories when searching folders
This commit is contained in:
parent
6a8b97c3e5
commit
3a22496705
@ -137,7 +137,8 @@ bool GetDirContentsWorker(DirStruct* contents, char* fpath, int fnsize, const ch
|
|||||||
ret = true; // Too many entries, still okay
|
ret = true; // Too many entries, still okay
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
contents->n_entries++;
|
if (!recursive || (entry->type != T_DIR))
|
||||||
|
contents->n_entries++;
|
||||||
}
|
}
|
||||||
if (recursive && (fno.fattrib & AM_DIR)) {
|
if (recursive && (fno.fattrib & AM_DIR)) {
|
||||||
if (!GetDirContentsWorker(contents, fpath, fnsize, pattern, recursive))
|
if (!GetDirContentsWorker(contents, fpath, fnsize, pattern, recursive))
|
||||||
|
@ -1221,7 +1221,7 @@ u32 GodMode() {
|
|||||||
// basic navigation commands
|
// basic navigation commands
|
||||||
if ((pad_state & BUTTON_A) && (curr_entry->type != T_FILE) && (curr_entry->type != T_DOTDOT)) { // for dirs
|
if ((pad_state & BUTTON_A) && (curr_entry->type != T_FILE) && (curr_entry->type != T_DOTDOT)) { // for dirs
|
||||||
if (switched && !(DriveType(curr_entry->path) & DRV_SEARCH)) { // search directory
|
if (switched && !(DriveType(curr_entry->path) & DRV_SEARCH)) { // search directory
|
||||||
const char* optionstr[2] = { "Search files & subdirs", "Directory info" }; // search files only?
|
const char* optionstr[2] = { "Search for files...", "Directory info" }; // search files only?
|
||||||
char namestr[32+1];
|
char namestr[32+1];
|
||||||
TruncateString(namestr, (*current_path) ? curr_entry->path : curr_entry->name, 32, 8);
|
TruncateString(namestr, (*current_path) ? curr_entry->path : curr_entry->name, 32, 8);
|
||||||
u32 user_select = ShowSelectPrompt(2, optionstr, "%s", namestr);
|
u32 user_select = ShowSelectPrompt(2, optionstr, "%s", namestr);
|
||||||
|
@ -144,7 +144,10 @@ bool GetVirtualDirContents(DirStruct* contents, char* fpath, int fnsize, const c
|
|||||||
entry->size = vfile.size;
|
entry->size = vfile.size;
|
||||||
entry->type = (vfile.flags & VFLAG_DIR) ? T_DIR : T_FILE;
|
entry->type = (vfile.flags & VFLAG_DIR) ? T_DIR : T_FILE;
|
||||||
entry->marked = 0;
|
entry->marked = 0;
|
||||||
contents->n_entries++;
|
if (contents->n_entries >= MAX_DIR_ENTRIES)
|
||||||
|
break; // Too many entries, still okay
|
||||||
|
if (!recursive || (entry->type != T_DIR))
|
||||||
|
contents->n_entries++;
|
||||||
}
|
}
|
||||||
if (recursive && (vfile.flags & VFLAG_DIR)) {
|
if (recursive && (vfile.flags & VFLAG_DIR)) {
|
||||||
if (!GetVirtualDirContents(contents, fpath, fnsize, pattern, recursive))
|
if (!GetVirtualDirContents(contents, fpath, fnsize, pattern, recursive))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user