aboutsummaryrefslogtreecommitdiff
path: root/launcher/ui/pages/modplatform/flame/FlameModel.cpp
diff options
context:
space:
mode:
authortimoreo <timo.oreo34@gmail.com>2022-01-18 12:28:55 +0100
committertimoreo <timo.oreo34@gmail.com>2022-01-18 12:28:55 +0100
commitaffc2521aaa282a6ba7f051dd02594500add4e6a (patch)
treec809f9e78b4d32cf07768bff472ebef30199ac1e /launcher/ui/pages/modplatform/flame/FlameModel.cpp
parent975f77756d7ffeb94fb14355b622ee850e04bd8b (diff)
downloadPrismLauncher-affc2521aaa282a6ba7f051dd02594500add4e6a.tar.gz
PrismLauncher-affc2521aaa282a6ba7f051dd02594500add4e6a.tar.bz2
PrismLauncher-affc2521aaa282a6ba7f051dd02594500add4e6a.zip
Various fixes
Diffstat (limited to 'launcher/ui/pages/modplatform/flame/FlameModel.cpp')
-rw-r--r--launcher/ui/pages/modplatform/flame/FlameModel.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/launcher/ui/pages/modplatform/flame/FlameModel.cpp b/launcher/ui/pages/modplatform/flame/FlameModel.cpp
index 891676cf..fe163cae 100644
--- a/launcher/ui/pages/modplatform/flame/FlameModel.cpp
+++ b/launcher/ui/pages/modplatform/flame/FlameModel.cpp
@@ -6,9 +6,6 @@
#include <Version.h>
#include <QtMath>
-#include <QLabel>
-
-#include <RWStorage.h>
namespace Flame {
@@ -100,12 +97,13 @@ void ListModel::requestLogo(QString logo, QString url)
}
MetaEntryPtr entry = APPLICATION->metacache()->resolveEntry("FlamePacks", QString("logos/%1").arg(logo.section(".", 0, 0)));
- NetJob *job = new NetJob(QString("Flame Icon Download %1").arg(logo), APPLICATION->network());
+ auto job = new NetJob(QString("Flame Icon Download %1").arg(logo), APPLICATION->network());
job->addNetAction(Net::Download::makeCached(QUrl(url), entry));
auto fullPath = entry->getFullPath();
- QObject::connect(job, &NetJob::succeeded, this, [this, logo, fullPath]
+ QObject::connect(job, &NetJob::succeeded, this, [this, logo, fullPath, job]
{
+ job->deleteLater();
emit logoLoaded(logo, QIcon(fullPath));
if(waitingCallbacks.contains(logo))
{
@@ -113,8 +111,9 @@ void ListModel::requestLogo(QString logo, QString url)
}
});
- QObject::connect(job, &NetJob::failed, this, [this, logo]
+ QObject::connect(job, &NetJob::failed, this, [this, logo, job]
{
+ job->deleteLater();
emit logoFailed(logo);
});