summaryrefslogtreecommitdiffstats
path: root/application/pages/global/PackagesPage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'application/pages/global/PackagesPage.cpp')
-rw-r--r--application/pages/global/PackagesPage.cpp25
1 files changed, 16 insertions, 9 deletions
diff --git a/application/pages/global/PackagesPage.cpp b/application/pages/global/PackagesPage.cpp
index e15ddbab..5fd4934c 100644
--- a/application/pages/global/PackagesPage.cpp
+++ b/application/pages/global/PackagesPage.cpp
@@ -1,4 +1,4 @@
-/* Copyright 2015-2017 MultiMC Contributors
+/* Copyright 2015-2018 MultiMC Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -38,10 +38,17 @@ static QString formatRequires(const VersionPtr &version)
auto iter = reqs.begin();
while (iter != reqs.end())
{
- auto &uid = iter.key();
- auto &version = iter.value();
+ auto &uid = iter->uid;
+ auto &version = iter->equalsVersion;
const QString readable = ENV.metadataIndex()->hasUid(uid) ? ENV.metadataIndex()->get(uid)->humanReadable() : uid;
- lines.append(QString("%1 (%2)").arg(readable, version));
+ if(!version.isEmpty())
+ {
+ lines.append(QString("%1 (%2)").arg(readable, version));
+ }
+ else
+ {
+ lines.append(QString("%1").arg(readable));
+ }
iter++;
}
return lines.join('\n');
@@ -95,7 +102,7 @@ QIcon PackagesPage::icon() const
void PackagesPage::on_refreshIndexBtn_clicked()
{
- ENV.metadataIndex()->load();
+ ENV.metadataIndex()->load(Net::Mode::Online);
}
void PackagesPage::on_refreshFileBtn_clicked()
{
@@ -104,7 +111,7 @@ void PackagesPage::on_refreshFileBtn_clicked()
{
return;
}
- list->load();
+ list->load(Net::Mode::Online);
}
void PackagesPage::on_refreshVersionBtn_clicked()
{
@@ -113,7 +120,7 @@ void PackagesPage::on_refreshVersionBtn_clicked()
{
return;
}
- version->load();
+ version->load(Net::Mode::Online);
}
void PackagesPage::on_fileSearchEdit_textChanged(const QString &search)
@@ -156,7 +163,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()));
- list->load();
+ list->load(Net::Mode::Offline);
}
else
{
@@ -213,5 +220,5 @@ void PackagesPage::updateVersion()
void PackagesPage::opened()
{
- ENV.metadataIndex()->load();
+ ENV.metadataIndex()->load(Net::Mode::Offline);
}