From 97a74d5c1f00a11d331a41b16690f7202fe102a3 Mon Sep 17 00:00:00 2001 From: flow Date: Wed, 10 Aug 2022 14:48:34 -0300 Subject: refactor: adapt rest of the codebase to the new resource model In order to access the ModFolderModel from the ModFolderPage, i created a new m_model for the correct type, shadowing the m_model of type ResourceFolderModel. This creates two shared_ptr references to the same object, but since they will have the same lifetime, it doesn't generate a memory leak. Signed-off-by: flow --- launcher/ui/pages/instance/TexturePackPage.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'launcher/ui/pages/instance/TexturePackPage.h') diff --git a/launcher/ui/pages/instance/TexturePackPage.h b/launcher/ui/pages/instance/TexturePackPage.h index f550a5bc..fa219eda 100644 --- a/launcher/ui/pages/instance/TexturePackPage.h +++ b/launcher/ui/pages/instance/TexturePackPage.h @@ -38,12 +38,14 @@ #include "ExternalResourcesPage.h" #include "ui_ExternalResourcesPage.h" +#include "minecraft/mod/TexturePackFolderModel.h" + class TexturePackPage : public ExternalResourcesPage { Q_OBJECT public: - explicit TexturePackPage(MinecraftInstance *instance, QWidget *parent = 0) - : ExternalResourcesPage(instance, instance->texturePackList(), parent) + explicit TexturePackPage(MinecraftInstance *instance, std::shared_ptr model, QWidget *parent = 0) + : ExternalResourcesPage(instance, model, parent) { ui->actionViewConfigs->setVisible(false); } -- cgit