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/minecraft/mod/Resource.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'launcher/minecraft/mod/Resource.h') diff --git a/launcher/minecraft/mod/Resource.h b/launcher/minecraft/mod/Resource.h index 68663ab0..bec7490f 100644 --- a/launcher/minecraft/mod/Resource.h +++ b/launcher/minecraft/mod/Resource.h @@ -34,6 +34,8 @@ class Resource : public QObject { Resource(QObject* parent = nullptr); Resource(QFileInfo file_info); + Resource(QString file_path) : Resource(QFileInfo(file_path)) {} + ~Resource() override = default; void setFile(QFileInfo file_info); -- cgit