| 327 | } |
| 328 | |
| 329 | int refresh_thread(SceSize args, void *argp) |
| 330 | { |
| 331 | SceUID thid = -1; |
| 332 | refresh_data_t refresh_data = { 0, 0, 0, 0 }; |
| 333 | |
| 334 | // Lock power timers |
| 335 | powerLock(); |
| 336 | |
| 337 | // Set progress to 0% |
| 338 | sceMsgDialogProgressBarSetValue(SCE_MSG_DIALOG_PROGRESSBAR_TARGET_BAR_DEFAULT, 0); |
| 339 | sceKernelDelayThread(DIALOG_WAIT); // Needed to see the percentage |
| 340 | |
| 341 | // Get the app count |
| 342 | if (parse_dir_with_callback(SCE_S_IFDIR, "ux0:app", app_callback, &refresh_data) < 0) |
| 343 | goto EXIT; |
| 344 | |
| 345 | // Get the dlc count |
| 346 | if (parse_dir_with_callback(SCE_S_IFDIR, "ux0:addcont", dlc_callback_outer, &refresh_data) < 0) |
| 347 | goto EXIT; |
| 348 | |
| 349 | // Get the patch count |
| 350 | if (parse_dir_with_callback(SCE_S_IFDIR, "ux0:patch", patch_callback, &refresh_data) < 0) |
| 351 | goto EXIT; |
| 352 | |
| 353 | // Update thread |
| 354 | thid = createStartUpdateThread(refresh_data.count, 0); |
| 355 | |
| 356 | // Make sure we have the temp directories we need |
| 357 | sceIoMkdir("ux0:temp", 0006); |
| 358 | sceIoMkdir("ux0:temp/addcont", 0006); |
| 359 | sceIoMkdir("ux0:temp/patch", 0006); |
| 360 | refresh_data.refresh_pass = 1; |
| 361 | |
| 362 | // Refresh apps |
| 363 | if (parse_dir_with_callback(SCE_S_IFDIR, "ux0:app", app_callback, &refresh_data) < 0) |
| 364 | goto EXIT; |
| 365 | |
| 366 | // Refresh dlc |
| 367 | if (parse_dir_with_callback(SCE_S_IFDIR, "ux0:addcont", dlc_callback_outer, &refresh_data) < 0) |
| 368 | goto EXIT; |
| 369 | |
| 370 | // Refresh patch |
| 371 | if (parse_dir_with_callback(SCE_S_IFDIR, "ux0:patch", patch_callback, &refresh_data) < 0) |
| 372 | goto EXIT; |
| 373 | |
| 374 | sceIoRmdir("ux0:temp/addcont"); |
| 375 | sceIoRmdir("ux0:temp/patch"); |
| 376 | |
| 377 | // Set progress to 100% |
| 378 | sceMsgDialogProgressBarSetValue(SCE_MSG_DIALOG_PROGRESSBAR_TARGET_BAR_DEFAULT, 100); |
| 379 | sceKernelDelayThread(COUNTUP_WAIT); |
| 380 | |
| 381 | // Close |
| 382 | closeWaitDialog(); |
| 383 | |
| 384 | infoDialog(language_container[REFRESHED], refresh_data.refreshed); |
| 385 | |
| 386 | EXIT: |
nothing calls this directly
no test coverage detected