refactor(InstanceImport): require rvalue from 'extra_info' mappings
Signed-off-by: flow <flowlnlnln@gmail.com>
This commit is contained in:
parent
4e75419e08
commit
1630a23fb0
@ -55,8 +55,8 @@
|
||||
|
||||
#include <quazip/quazipdir.h>
|
||||
|
||||
InstanceImportTask::InstanceImportTask(const QUrl sourceUrl, QWidget* parent, QMap<QString, QString> extra_info)
|
||||
: m_sourceUrl(sourceUrl), m_extra_info(std::move(extra_info)), m_parent(parent)
|
||||
InstanceImportTask::InstanceImportTask(const QUrl sourceUrl, QWidget* parent, QMap<QString, QString>&& extra_info)
|
||||
: m_sourceUrl(sourceUrl), m_extra_info(extra_info), m_parent(parent)
|
||||
{}
|
||||
|
||||
bool InstanceImportTask::abort()
|
||||
|
@ -56,7 +56,7 @@ class InstanceImportTask : public InstanceTask
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit InstanceImportTask(const QUrl sourceUrl, QWidget* parent = nullptr, QMap<QString, QString> extra_info = {});
|
||||
explicit InstanceImportTask(const QUrl sourceUrl, QWidget* parent = nullptr, QMap<QString, QString>&& extra_info = {});
|
||||
|
||||
bool abort() override;
|
||||
const QVector<Flame::File> &getBlockedFiles() const
|
||||
|
@ -275,7 +275,7 @@ void ModrinthManagedPackPage::update()
|
||||
extra_info.insert("pack_id", m_pack.id);
|
||||
extra_info.insert("pack_version_id", version.id);
|
||||
|
||||
auto extracted = new InstanceImportTask(version.download_url, this, extra_info);
|
||||
auto extracted = new InstanceImportTask(version.download_url, this, std::move(extra_info));
|
||||
|
||||
InstanceName inst_name(m_inst->getManagedPackName(), version.version);
|
||||
inst_name.setName(m_inst->name().replace(m_inst->getManagedPackVersionName(), version.version));
|
||||
@ -413,7 +413,7 @@ void FlameManagedPackPage::update()
|
||||
extra_info.insert("pack_id", m_inst->getManagedPackID());
|
||||
extra_info.insert("pack_version_id", QString::number(version.fileId));
|
||||
|
||||
auto extracted = new InstanceImportTask(version.downloadUrl, this, extra_info);
|
||||
auto extracted = new InstanceImportTask(version.downloadUrl, this, std::move(extra_info));
|
||||
|
||||
InstanceName inst_name(m_inst->getManagedPackName(), version.version);
|
||||
inst_name.setName(m_inst->name().replace(m_inst->getManagedPackVersionName(), version.version));
|
||||
|
@ -208,7 +208,7 @@ void FlamePage::suggestCurrent()
|
||||
extra_info.insert("pack_id", QString::number(current.addonId));
|
||||
extra_info.insert("pack_version_id", QString::number(version.fileId));
|
||||
|
||||
dialog->setSuggestedPack(current.name, new InstanceImportTask(version.downloadUrl, this, extra_info));
|
||||
dialog->setSuggestedPack(current.name, new InstanceImportTask(version.downloadUrl, this, std::move(extra_info)));
|
||||
QString editedLogoName;
|
||||
editedLogoName = "curseforge_" + current.logoName.section(".", 0, 0);
|
||||
listModel->getLogo(current.logoName, current.logoUrl,
|
||||
|
@ -304,7 +304,7 @@ void ModrinthPage::suggestCurrent()
|
||||
extra_info.insert("pack_id", current.id);
|
||||
extra_info.insert("pack_version_id", ver.id);
|
||||
|
||||
dialog->setSuggestedPack(current.name, ver.version, new InstanceImportTask(ver.download_url, this, extra_info));
|
||||
dialog->setSuggestedPack(current.name, ver.version, new InstanceImportTask(ver.download_url, this, std::move(extra_info)));
|
||||
auto iconName = current.iconName;
|
||||
m_model->getLogo(iconName, current.iconUrl.toString(),
|
||||
[this, iconName](QString logo) { dialog->setSuggestedIconFromFile(logo, iconName); });
|
||||
|
Loading…
Reference in New Issue
Block a user