removed some duplicate code

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97
2025-03-30 00:32:59 +02:00
parent ab3bfb0f74
commit 29cff14fd6
52 changed files with 928 additions and 2318 deletions

View File

@@ -20,14 +20,13 @@ class ResourcePackResourceModel : public ResourceModel {
Q_OBJECT
public:
ResourcePackResourceModel(BaseInstance const&, ResourceAPI*);
ResourcePackResourceModel(BaseInstance const&, ResourceAPI*, QString debugName, QString metaEntryBase);
/* Ask the API for more information */
void searchWithTerm(const QString& term, unsigned int sort);
void loadIndexedPack(ModPlatform::IndexedPack&, QJsonObject&) override = 0;
void loadExtraPackInfo(ModPlatform::IndexedPack&, QJsonObject&) override = 0;
void loadIndexedPackVersions(ModPlatform::IndexedPack&, QJsonArray&) override = 0;
[[nodiscard]] QString debugName() const override { return m_debugName; }
[[nodiscard]] QString metaEntryBase() const override { return m_metaEntryBase; }
public slots:
ResourceAPI::SearchArgs createSearchArguments() override;
@@ -37,7 +36,9 @@ class ResourcePackResourceModel : public ResourceModel {
protected:
const BaseInstance& m_base_instance;
auto documentToArray(QJsonDocument& obj) const -> QJsonArray override = 0;
private:
QString m_debugName;
QString m_metaEntryBase;
};
} // namespace ResourceDownload