refactor: create mod pages and filter widget by factory methods

This takes most expensive operations out of the constructors.

Signed-off-by: flow <flowlnlnln@gmail.com>
This commit is contained in:
flow
2022-08-21 10:50:10 -03:00
parent 8a65726e9d
commit 42eb265624
7 changed files with 102 additions and 46 deletions

View File

@ -44,7 +44,12 @@ class ModrinthModPage : public ModPage {
Q_OBJECT
public:
explicit ModrinthModPage(ModDownloadDialog* dialog, BaseInstance* instance);
static ModrinthModPage* create(ModDownloadDialog* dialog, BaseInstance* instance)
{
return ModPage::create<ModrinthModPage>(dialog, instance);
}
ModrinthModPage(ModDownloadDialog* dialog, BaseInstance* instance);
~ModrinthModPage() override = default;
inline auto displayName() const -> QString override { return "Modrinth"; }