MCPcopy Create free account
hub / github.com/TheOfficialFloW/VitaShell / refreshFileList

Function refreshFileList

browser.c:270–310  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

268}
269
270int refreshFileList() {
271 int ret = 0, res = 0;
272
273 // always sort recent files by date
274 char *contains = strstr(file_list.path, VITASHELL_RECENT_PATH);
275 if (contains) {
276 sort_mode = SORT_BY_DATE;
277 } else {
278 sort_mode = last_set_sort_mode;
279 }
280
281 do {
282 fileListEmpty(&file_list);
283
284 res = fileListGetEntries(&file_list, file_list.path, sort_mode);
285
286 if (res < 0) {
287 ret = res;
288 dirUp();
289 }
290 } while (res < 0);
291
292 // Position correction
293 if (file_list.length >= MAX_POSITION) {
294 if ((base_pos + rel_pos) >= file_list.length) {
295 rel_pos = MAX_POSITION - 1;
296 }
297
298 if ((base_pos + MAX_POSITION - 1) >= file_list.length) {
299 base_pos = file_list.length - MAX_POSITION;
300 }
301 } else {
302 if ((base_pos + rel_pos) >= file_list.length) {
303 rel_pos = file_list.length - 1;
304 }
305
306 base_pos = 0;
307 }
308
309 return ret;
310}
311
312static void refreshMarkList() {
313 if (isInArchive())

Callers 12

change_to_directoryFunction · 0.85
fileBrowserMenuCtrlFunction · 0.85
fileBrowserHandleFileFunction · 0.85
fileBrowserHandleFolderFunction · 0.85
fileBrowserHandleSymlinkFunction · 0.85
browserMainFunction · 0.85
dialogStepsFunction · 0.85

Calls 3

fileListEmptyFunction · 0.85
fileListGetEntriesFunction · 0.85
dirUpFunction · 0.85

Tested by

no test coverage detected