diff options
author | Janrupf <werbung.janrupf@t-online.de> | 2018-04-05 19:33:31 +0200 |
---|---|---|
committer | Janrupf <werbung.janrupf@t-online.de> | 2018-04-05 19:33:31 +0200 |
commit | df6e66101c2ce5635f20df2f1d7954a681845ab1 (patch) | |
tree | 7a9d417631b2dd9f58977d68b847b132da3eb25e /application/FtbListModel.cpp | |
parent | bbd523acb8bf846d27a7859d1d79f28ea92de245 (diff) | |
download | MultiMC-df6e66101c2ce5635f20df2f1d7954a681845ab1.tar MultiMC-df6e66101c2ce5635f20df2f1d7954a681845ab1.tar.gz MultiMC-df6e66101c2ce5635f20df2f1d7954a681845ab1.tar.lz MultiMC-df6e66101c2ce5635f20df2f1d7954a681845ab1.tar.xz MultiMC-df6e66101c2ce5635f20df2f1d7954a681845ab1.zip |
NOISSUE Added 3rd party pack support
Diffstat (limited to 'application/FtbListModel.cpp')
-rw-r--r-- | application/FtbListModel.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/application/FtbListModel.cpp b/application/FtbListModel.cpp index d8c18ee5..41e49b65 100644 --- a/application/FtbListModel.cpp +++ b/application/FtbListModel.cpp @@ -172,22 +172,20 @@ void FtbListModel::requestLogo(QString file) return; } - MetaEntryPtr entry = ENV.metacache()->resolveEntry("FTBPacks", QString("logos/%1").arg(file)); + MetaEntryPtr entry = ENV.metacache()->resolveEntry("FTBPacks", QString("logos/%1").arg(file.section(".", 0, 0))); NetJob *job = new NetJob(QString("FTB Icon Download for %1").arg(file)); job->addNetAction(Net::Download::makeCached(QUrl(QString("https://ftb.cursecdn.com/FTB2/static/%1").arg(file)), entry)); - QString *_file = new QString(file); - MetaEntry *_entry = entry.get(); - - QObject::connect(job, &NetJob::finished, this, [this, _file, _entry]{ + auto fullPath = entry->getFullPath(); + QObject::connect(job, &NetJob::finished, this, [this, file, fullPath]{ QPixmap pixmap; - pixmap.load(_entry->getFullPath()); + pixmap.load(fullPath); pixmap = pixmap.scaled(QSize(42, 42)); - emit logoLoaded(*_file, pixmap); + emit logoLoaded(file, pixmap); }); - QObject::connect(job, &NetJob::failed, this, [this, _file]{ - emit logoFailed(*_file); + QObject::connect(job, &NetJob::failed, this, [this, file]{ + emit logoFailed(file); }); job->start(); |