Skip to content

Commit

Permalink
removed line
Browse files Browse the repository at this point in the history
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
  • Loading branch information
Trial97 committed Aug 16, 2023
1 parent c94ee67 commit 5e2d1ff
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion launcher/modplatform/flame/FlameAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ Task::Ptr FlameAPI::getFiles(const QStringList& fileIds, std::shared_ptr<QByteAr
return netJob;
}

Task::Ptr FlameAPI::getFile(const QString& addonId, const QString& fileId, std::shared_ptr<QByteArray>response) const
Task::Ptr FlameAPI::getFile(const QString& addonId, const QString& fileId, std::shared_ptr<QByteArray> response) const
{
auto netJob = makeShared<NetJob>(QString("Flame::GetFile"), APPLICATION->network());
netJob->addNetAction(
Expand Down
16 changes: 8 additions & 8 deletions launcher/ui/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,7 @@ void MainWindow::processURLs(QList<QUrl> urls)
QUrl local_url;
if (!url.isLocalFile()) { // download the remote resource and identify
QUrl dl_url;
if(url.scheme() == "curseforge") {
if (url.scheme() == "curseforge") {
// need to find the download link for the modpack / resource
// format of url curseforge://install?addonId=IDHERE&fileId=IDHERE
QUrlQuery query(url);
Expand Down Expand Up @@ -1027,19 +1027,18 @@ void MainWindow::processURLs(QList<QUrl> urls)
resource_name = Json::ensureString(data, "displayName", dl_file.completeBaseName(), "displayName");
});

{ // drop stack
{ // drop stack
ProgressDialog dlUrlDialod(this);
dlUrlDialod.setSkipButton(true, tr("Abort"));
dlUrlDialod.execWithTask(job.get());
}


} else {
dl_url = url;
}

if (!dl_url.isValid()) {
continue; // no valid url to download this resource
continue; // no valid url to download this resource
}

const QString path = dl_url.host() + '/' + dl_url.path();
Expand All @@ -1050,17 +1049,18 @@ void MainWindow::processURLs(QList<QUrl> urls)
auto archivePath = entry->getFullPath();

bool dl_success = false;
connect(dl_job.get(), &Task::failed, this, [this](QString reason){CustomMessageBox::selectable(this, tr("Error"), reason, QMessageBox::Critical)->show(); });
connect(dl_job.get(), &Task::succeeded, this, [&dl_success]{dl_success = true;});
connect(dl_job.get(), &Task::failed, this,
[this](QString reason) { CustomMessageBox::selectable(this, tr("Error"), reason, QMessageBox::Critical)->show(); });
connect(dl_job.get(), &Task::succeeded, this, [&dl_success] { dl_success = true; });

{ // drop stack
{ // drop stack
ProgressDialog dlUrlDialod(this);
dlUrlDialod.setSkipButton(true, tr("Abort"));
dlUrlDialod.execWithTask(dl_job.get());
}

if (!dl_success) {
continue; // no local file to identify
continue; // no local file to identify
}
local_url = QUrl::fromLocalFile(archivePath);

Expand Down
1 change: 0 additions & 1 deletion launcher/ui/pages/modplatform/ImportPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ void ImportPage::updateState()
bool isMRPack = fi.suffix() == "mrpack";

if (fi.exists() && (isZip || isMRPack)) {
QFileInfo fi(url.fileName());
auto extra_info = QMap(m_extra_info);
qDebug() << "Pack Extra Info" << extra_info << m_extra_info;
dialog->setSuggestedPack(fi.completeBaseName(), new InstanceImportTask(url, this, std::move(extra_info)));
Expand Down

0 comments on commit 5e2d1ff

Please sign in to comment.