From 5bc67d3f6b03bae6ff861d6641d22bbddefe2202 Mon Sep 17 00:00:00 2001 From: flow Date: Mon, 18 Jul 2022 19:17:44 -0300 Subject: feat: cache extra mod info (like links and body) Signed-off-by: flow --- launcher/ui/pages/modplatform/ModPage.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'launcher/ui/pages/modplatform/ModPage.cpp') diff --git a/launcher/ui/pages/modplatform/ModPage.cpp b/launcher/ui/pages/modplatform/ModPage.cpp index 176f8fde..59831dd9 100644 --- a/launcher/ui/pages/modplatform/ModPage.cpp +++ b/launcher/ui/pages/modplatform/ModPage.cpp @@ -169,13 +169,13 @@ void ModPage::setSearchTerm(QString term) ui->searchEdit->setText(term); } -void ModPage::onSelectionChanged(QModelIndex first, QModelIndex second) +void ModPage::onSelectionChanged(QModelIndex curr, QModelIndex prev) { ui->versionSelectionBox->clear(); - if (!first.isValid()) { return; } + if (!curr.isValid()) { return; } - current = listModel->data(first, Qt::UserRole).value(); + current = listModel->data(curr, Qt::UserRole).value(); if (!current.versionsLoaded) { qDebug() << QString("Loading %1 mod versions").arg(debugName()); @@ -195,7 +195,8 @@ void ModPage::onSelectionChanged(QModelIndex first, QModelIndex second) if(!current.extraDataLoaded){ qDebug() << QString("Loading %1 mod info").arg(debugName()); - listModel->requestModInfo(current); + + listModel->requestModInfo(current, curr); } updateUi(); -- cgit