diff options
Diffstat (limited to 'launcher/ui/pages/modplatform/flame/FlamePage.cpp')
| -rw-r--r-- | launcher/ui/pages/modplatform/flame/FlamePage.cpp | 18 | 
1 files changed, 6 insertions, 12 deletions
diff --git a/launcher/ui/pages/modplatform/flame/FlamePage.cpp b/launcher/ui/pages/modplatform/flame/FlamePage.cpp index 95bb9d0f..aad37694 100644 --- a/launcher/ui/pages/modplatform/flame/FlamePage.cpp +++ b/launcher/ui/pages/modplatform/flame/FlamePage.cpp @@ -42,9 +42,9 @@  #include "FlameModel.h"  #include "InstanceImportTask.h"  #include "Json.h" +#include "modplatform/flame/FlameAPI.h"  #include "ui/dialogs/NewInstanceDialog.h"  #include "ui/widgets/ProjectItem.h" -#include "modplatform/flame/FlameAPI.h"  static FlameAPI api; @@ -130,7 +130,7 @@ void FlamePage::onSelectionChanged(QModelIndex curr, QModelIndex prev)      if (current.versionsLoaded == false) {          qDebug() << "Loading flame modpack versions";          auto netJob = new NetJob(QString("Flame::PackVersions(%1)").arg(current.name), APPLICATION->network()); -        auto response = new QByteArray(); +        auto response = std::make_shared<QByteArray>();          int addonId = current.addonId;          netJob->addNetAction(Net::Download::makeByteArray(QString("https://api.curseforge.com/v1/mods/%1/files").arg(addonId), response)); @@ -155,7 +155,7 @@ void FlamePage::onSelectionChanged(QModelIndex curr, QModelIndex prev)              }              for (auto version : current.versions) { -                auto release_type = version.version_type.isValid() ? QString(" : %1").arg(version.version_type.toString()) : ""; +                auto release_type = version.version_type.isValid() ? QString(" [%1]").arg(version.version_type.toString()) : "";                  ui->versionSelectionBox->addItem(QString("%1%2").arg(version.version, release_type), QVariant(version.downloadUrl));              } @@ -171,10 +171,7 @@ void FlamePage::onSelectionChanged(QModelIndex curr, QModelIndex prev)              }              suggestCurrent();          }); -        QObject::connect(netJob, &NetJob::finished, this, [response, netJob] { -            netJob->deleteLater(); -            delete response; -        }); +        QObject::connect(netJob, &NetJob::finished, this, [response, netJob] { netJob->deleteLater(); });          netJob->start();      } else {          for (auto version : current.versions) { @@ -256,10 +253,8 @@ void FlamePage::updateUi()          text += "<br>" + tr(" by ") + authorStrs.join(", ");      } -    if(current.extraInfoLoaded) { -        if (!current.extra.issuesUrl.isEmpty() -         || !current.extra.sourceUrl.isEmpty() -         || !current.extra.wikiUrl.isEmpty()) { +    if (current.extraInfoLoaded) { +        if (!current.extra.issuesUrl.isEmpty() || !current.extra.sourceUrl.isEmpty() || !current.extra.wikiUrl.isEmpty()) {              text += "<br><br>" + tr("External links:") + "<br>";          } @@ -271,7 +266,6 @@ void FlamePage::updateUi()              text += "- " + tr("Source code: <a href=%1>%1</a>").arg(current.extra.sourceUrl) + "<br>";      } -      text += "<hr>";      text += api.getModDescription(current.addonId).toUtf8();  | 
