aboutsummaryrefslogtreecommitdiff
path: root/launcher/ui/pages/modplatform/modrinth/ModrinthModel.cpp
diff options
context:
space:
mode:
authorflow <flowlnlnln@gmail.com>2022-06-24 09:02:58 -0300
committerflow <flowlnlnln@gmail.com>2022-07-03 12:43:04 -0300
commit0ec4ade6837259a93db47acd5a12df591c69efb5 (patch)
tree48e77a1bd2ac450da6f759ff5f0777843629a648 /launcher/ui/pages/modplatform/modrinth/ModrinthModel.cpp
parent4bfc445cf8f2a9b0e1d704e43f5a81f841159f79 (diff)
downloadPrismLauncher-0ec4ade6837259a93db47acd5a12df591c69efb5.tar.gz
PrismLauncher-0ec4ade6837259a93db47acd5a12df591c69efb5.tar.bz2
PrismLauncher-0ec4ade6837259a93db47acd5a12df591c69efb5.zip
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>
Diffstat (limited to 'launcher/ui/pages/modplatform/modrinth/ModrinthModel.cpp')
-rw-r--r--launcher/ui/pages/modplatform/modrinth/ModrinthModel.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/launcher/ui/pages/modplatform/modrinth/ModrinthModel.cpp b/launcher/ui/pages/modplatform/modrinth/ModrinthModel.cpp
index 39b935a6..5018faa2 100644
--- a/launcher/ui/pages/modplatform/modrinth/ModrinthModel.cpp
+++ b/launcher/ui/pages/modplatform/modrinth/ModrinthModel.cpp
@@ -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