feat+fix: cache versions and extra info in Modrinth packs

When you change a copy thinking you're changing the original data smh

Signed-off-by: flow <flowlnlnln@gmail.com>
This commit is contained in:
flow
2022-06-24 09:02:58 -03:00
parent 4bfc445cf8
commit 0ec4ade683
3 changed files with 31 additions and 6 deletions

View File

@ -104,6 +104,17 @@ auto ModpackListModel::data(const QModelIndex& index, int role) const -> QVarian
return {};
}
bool ModpackListModel::setData(const QModelIndex &index, const QVariant &value, int role)
{
int pos = index.row();
if (pos >= modpacks.size() || pos < 0 || !index.isValid())
return false;
modpacks[pos] = value.value<Modrinth::Modpack>();
return true;
}
void ModpackListModel::performPaginatedSearch()
{
// TODO: Move to standalone API