mirror of
https://github.com/LNH-team/pico-launcher.git
synced 2026-06-02 00:56:55 +02:00
Add new shared pointer and make use of it
This commit is contained in:
@@ -11,27 +11,22 @@ void BannerListFileRecyclerAdapter::GetViewSize(int& width, int& height) const
|
||||
height = 44;
|
||||
}
|
||||
|
||||
View* BannerListFileRecyclerAdapter::CreateView() const
|
||||
SharedPtr<View> BannerListFileRecyclerAdapter::CreateView() const
|
||||
{
|
||||
return _romBrowserViewFactory->CreateBannerListItemView(_vblankTextureLoader);
|
||||
}
|
||||
|
||||
void BannerListFileRecyclerAdapter::DestroyView(View* view) const
|
||||
void BannerListFileRecyclerAdapter::BindView(SharedPtr<View> view, int index) const
|
||||
{
|
||||
delete static_cast<BannerListItemView*>(view);
|
||||
}
|
||||
|
||||
void BannerListFileRecyclerAdapter::BindView(View* view, int index) const
|
||||
{
|
||||
auto listItemView = static_cast<BannerListItemView*>(view);
|
||||
auto listItemView = static_cast<BannerListItemView*>(view.GetPointer());
|
||||
listItemView->SetGraphics(_bannerListItemViewGraphics);
|
||||
FileRecyclerAdapter::BindView(view, index);
|
||||
}
|
||||
|
||||
TaskResult<void> BannerListFileRecyclerAdapter::BindView(View* view, int index,
|
||||
TaskResult<void> BannerListFileRecyclerAdapter::BindView(SharedPtr<View> view, int index,
|
||||
const InternalFileInfo* internalFileInfo, const vu8& cancelRequested) const
|
||||
{
|
||||
auto listItemView = static_cast<BannerListItemView*>(view);
|
||||
auto listItemView = static_cast<BannerListItemView*>(view.GetPointer());
|
||||
const auto& fileInfo = _fileInfoManager->GetItem(index);
|
||||
bool fileNameAsTitle = true;
|
||||
if (internalFileInfo)
|
||||
@@ -70,10 +65,10 @@ TaskResult<void> BannerListFileRecyclerAdapter::BindView(View* view, int index,
|
||||
return TaskResult<void>::Completed();
|
||||
}
|
||||
|
||||
void BannerListFileRecyclerAdapter::ReleaseView(View* view, int index) const
|
||||
void BannerListFileRecyclerAdapter::ReleaseView(SharedPtr<View> view, int index) const
|
||||
{
|
||||
LOG_DEBUG("Releasing %d\n", index);
|
||||
auto listItemView = static_cast<BannerListItemView*>(view);
|
||||
auto listItemView = static_cast<BannerListItemView*>(view.GetPointer());
|
||||
listItemView->SetIcon(nullptr);
|
||||
listItemView->SetGameTitle(u"");
|
||||
_fileInfoManager->ReleaseFileInfo(index);
|
||||
|
||||
Reference in New Issue
Block a user