mirror of
https://github.com/LNH-team/pico-launcher.git
synced 2025-12-05 13:16:06 +01:00
27 lines
800 B
C++
27 lines
800 B
C++
#include "common.h"
|
|
#include "core/task/TaskQueue.h"
|
|
#include "FileInfoManager.h"
|
|
#include "FileRecyclerAdapter.h"
|
|
|
|
u32 FileRecyclerAdapter::GetItemCount() const
|
|
{
|
|
return _fileInfoManager->GetItemCount();
|
|
}
|
|
|
|
void FileRecyclerAdapter::BindView(View* view, int index) const
|
|
{
|
|
LOG_DEBUG("Binding %d\n", index);
|
|
_taskQueue->Enqueue([=, this] (const vu8& cancelRequested)
|
|
{
|
|
LOG_DEBUG("Started task to load %d\n", index);
|
|
_fileInfoManager->LoadFileInfo(index);
|
|
auto internalFileInfo = _fileInfoManager->GetInternalFileInfo(index);
|
|
if (cancelRequested)
|
|
{
|
|
_fileInfoManager->ReleaseFileInfo(index);
|
|
return TaskResult<void>::Canceled();
|
|
}
|
|
return BindView(view, index, internalFileInfo, cancelRequested);
|
|
});
|
|
}
|