mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-07-08 13:08:29 +02:00
fix: force metadata version list refreshes to reload (#5349)
This commit is contained in:
commit
ece83eb637
15 changed files with 34 additions and 25 deletions
|
|
@ -101,7 +101,7 @@ InstallLoaderDialog::InstallLoaderDialog(PackProfile* profile, const QString& ui
|
|||
buttonLayout->setContentsMargins(0, 0, 6, 6);
|
||||
#endif
|
||||
auto refreshButton = new QPushButton(tr("&Refresh"), this);
|
||||
connect(refreshButton, &QPushButton::clicked, this, [this] { pageCast(container->selectedPage())->loadList(); });
|
||||
connect(refreshButton, &QPushButton::clicked, this, [this] { pageCast(container->selectedPage())->loadList(true); });
|
||||
buttonLayout->addWidget(refreshButton);
|
||||
|
||||
buttons->setOrientation(Qt::Horizontal);
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ BaseVersion::Ptr VersionSelectDialog::selectedVersion() const
|
|||
|
||||
void VersionSelectDialog::on_refreshButton_clicked()
|
||||
{
|
||||
m_versionWidget->loadList();
|
||||
m_versionWidget->loadList(true);
|
||||
}
|
||||
|
||||
void VersionSelectDialog::setExactFilter(BaseVersionList::ModelRoles role, QString filter)
|
||||
|
|
|
|||
|
|
@ -121,8 +121,8 @@ class InstallJavaPage : public QWidget, public BasePage {
|
|||
void selectSearch() { javaVersionSelect->selectSearch(); }
|
||||
void loadList()
|
||||
{
|
||||
majorVersionSelect->loadList();
|
||||
javaVersionSelect->loadList();
|
||||
majorVersionSelect->loadList(true);
|
||||
javaVersionSelect->loadList(true);
|
||||
}
|
||||
|
||||
public slots:
|
||||
|
|
|
|||
|
|
@ -33,9 +33,9 @@ VersionList::VersionList(Meta::Version::Ptr version, QObject* parent) : BaseVers
|
|||
sortVersions();
|
||||
}
|
||||
|
||||
Task::Ptr VersionList::getLoadTask()
|
||||
Task::Ptr VersionList::getLoadTask(bool forceReload)
|
||||
{
|
||||
auto task = m_version->loadTask(Net::Mode::Online);
|
||||
auto task = m_version->loadTask(Net::Mode::Online, forceReload);
|
||||
connect(task.get(), &Task::finished, this, &VersionList::sortVersions);
|
||||
return task;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ class VersionList : public BaseVersionList {
|
|||
public:
|
||||
explicit VersionList(Meta::Version::Ptr m_version, QObject* parent = 0);
|
||||
|
||||
Task::Ptr getLoadTask() override;
|
||||
Task::Ptr getLoadTask(bool forceReload = false) override;
|
||||
bool isLoaded() override;
|
||||
const BaseVersion::Ptr at(int i) const override;
|
||||
int count() const override;
|
||||
|
|
|
|||
|
|
@ -80,14 +80,14 @@ void CustomPage::openedImpl()
|
|||
|
||||
void CustomPage::refresh()
|
||||
{
|
||||
ui->versionList->loadList();
|
||||
ui->versionList->loadList(true);
|
||||
}
|
||||
|
||||
void CustomPage::loaderRefresh()
|
||||
{
|
||||
if (ui->noneFilter->isChecked())
|
||||
return;
|
||||
ui->loaderVersionList->loadList();
|
||||
ui->loaderVersionList->loadList(true);
|
||||
}
|
||||
|
||||
void CustomPage::filterChanged()
|
||||
|
|
|
|||
|
|
@ -127,9 +127,9 @@ void VersionSelectWidget::closeEvent(QCloseEvent* event)
|
|||
QWidget::closeEvent(event);
|
||||
}
|
||||
|
||||
void VersionSelectWidget::loadList()
|
||||
void VersionSelectWidget::loadList(bool forceReload)
|
||||
{
|
||||
m_load_task = m_vlist->getLoadTask();
|
||||
m_load_task = m_vlist->getLoadTask(forceReload);
|
||||
connect(m_load_task.get(), &Task::succeeded, this, &VersionSelectWidget::onTaskSucceeded);
|
||||
connect(m_load_task.get(), &Task::failed, this, &VersionSelectWidget::onTaskFailed);
|
||||
connect(m_load_task.get(), &Task::progress, this, &VersionSelectWidget::changeProgress);
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ class VersionSelectWidget : public QWidget {
|
|||
void initialize(BaseVersionList* vlist, bool forceLoad = false);
|
||||
|
||||
//! Starts a task that loads the list.
|
||||
void loadList();
|
||||
void loadList(bool forceReload = false);
|
||||
|
||||
bool hasVersions() const;
|
||||
BaseVersion::Ptr selectedVersion() const;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue