diff options
Diffstat (limited to 'application')
-rw-r--r-- | application/MainWindow.cpp | 15 | ||||
-rw-r--r-- | application/pages/global/PackagesPage.cpp | 33 |
2 files changed, 6 insertions, 42 deletions
diff --git a/application/MainWindow.cpp b/application/MainWindow.cpp index 9073c006..e0870d06 100644 --- a/application/MainWindow.cpp +++ b/application/MainWindow.cpp @@ -554,21 +554,8 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new MainWindow job->start(); } - // run the things that load and download other things... FIXME: this is NOT the place - // FIXME: invisible actions in the background = NOPE. + // load the news { - /* - if (!MMC->minecraftlist()->isLoaded()) - { - m_versionLoadTask = MMC->minecraftlist()->getLoadTask(); - startTask(m_versionLoadTask); - } - if (!MMC->lwjgllist()->isLoaded()) - { - MMC->lwjgllist()->loadList(); - } - */ - m_newsChecker->reloadNews(); updateNewsLabel(); } 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(); } |