diff options
author | Petr Mrázek <peterix@gmail.com> | 2017-03-18 02:22:36 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2017-04-07 00:20:02 +0200 |
commit | e46aba9da584338db8d8a1a8a487bdcc6cf84343 (patch) | |
tree | 40deee806e1aa9ad19f438c066aca41737d42af0 /application/pages/global | |
parent | 0060b506257b906d40ef53d1e23404dba76afcee (diff) | |
download | MultiMC-e46aba9da584338db8d8a1a8a487bdcc6cf84343.tar MultiMC-e46aba9da584338db8d8a1a8a487bdcc6cf84343.tar.gz MultiMC-e46aba9da584338db8d8a1a8a487bdcc6cf84343.tar.lz MultiMC-e46aba9da584338db8d8a1a8a487bdcc6cf84343.tar.xz MultiMC-e46aba9da584338db8d8a1a8a487bdcc6cf84343.zip |
NOISSUE sanitize loading and downloading of metadata files
Diffstat (limited to 'application/pages/global')
-rw-r--r-- | application/pages/global/PackagesPage.cpp | 33 |
1 files changed, 5 insertions, 28 deletions
diff --git a/application/pages/global/PackagesPage.cpp b/application/pages/global/PackagesPage.cpp index 81ad4da1..e4967532 100644 --- a/application/pages/global/PackagesPage.cpp +++ b/application/pages/global/PackagesPage.cpp @@ -97,7 +97,7 @@ QIcon PackagesPage::icon() const void PackagesPage::on_refreshIndexBtn_clicked() { - ProgressDialog(this).execWithTask(ENV.metadataIndex()->remoteUpdateTask()); + ENV.metadataIndex()->load(); } void PackagesPage::on_refreshFileBtn_clicked() { @@ -106,7 +106,7 @@ void PackagesPage::on_refreshFileBtn_clicked() { return; } - ProgressDialog(this).execWithTask(list->remoteUpdateTask()); + list->load(); } void PackagesPage::on_refreshVersionBtn_clicked() { @@ -115,7 +115,7 @@ void PackagesPage::on_refreshVersionBtn_clicked() { return; } - ProgressDialog(this).execWithTask(version->remoteUpdateTask()); + version->load(); } void PackagesPage::on_fileSearchEdit_textChanged(const QString &search) @@ -158,19 +158,7 @@ void PackagesPage::updateCurrentVersionList(const QModelIndex &index) ui->fileName->setText(list->name()); m_versionProxy->setSourceModel(list.get()); ui->refreshFileBtn->setText(tr("Refresh %1").arg(list->humanReadable())); - - if (!list->isLocalLoaded()) - { - std::unique_ptr<Task> task = list->localUpdateTask(); - connect(task.get(), &Task::finished, this, [this, list]() - { - if (list->count() == 0 && !list->isRemoteLoaded()) - { - ProgressDialog(this).execWithTask(list->remoteUpdateTask()); - } - }); - ProgressDialog(this).execWithTask(task); - } + list->load(); } else { @@ -227,16 +215,5 @@ void PackagesPage::updateVersion() void PackagesPage::opened() { - if (!ENV.metadataIndex()->isLocalLoaded()) - { - std::unique_ptr<Task> task = ENV.metadataIndex()->localUpdateTask(); - connect(task.get(), &Task::finished, this, [this]() - { - if (!ENV.metadataIndex()->isRemoteLoaded()) - { - ProgressDialog(this).execWithTask(ENV.metadataIndex()->remoteUpdateTask()); - } - }); - ProgressDialog(this).execWithTask(task); - } + ENV.metadataIndex()->load(); } |