summaryrefslogtreecommitdiffstats
path: root/application/pages/modplatform/FtbListModel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'application/pages/modplatform/FtbListModel.cpp')
-rw-r--r--application/pages/modplatform/FtbListModel.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/application/pages/modplatform/FtbListModel.cpp b/application/pages/modplatform/FtbListModel.cpp
index 8e52f541..c14907c6 100644
--- a/application/pages/modplatform/FtbListModel.cpp
+++ b/application/pages/modplatform/FtbListModel.cpp
@@ -175,6 +175,9 @@ void FtbListModel::requestLogo(QString file)
auto fullPath = entry->getFullPath();
QObject::connect(job, &NetJob::finished, this, [this, file, fullPath]{
emit logoLoaded(file, QIcon(fullPath));
+ if(waitingCallbacks.contains(file)) {
+ waitingCallbacks.value(file)(fullPath);
+ }
});
QObject::connect(job, &NetJob::failed, this, [this, file]{
@@ -185,3 +188,12 @@ void FtbListModel::requestLogo(QString file)
m_loadingLogos.append(file);
}
+
+void FtbListModel::getLogo(const QString &logo, LogoCallback callback)
+{
+ if(m_logoMap.contains(logo)) {
+ callback(ENV.metacache()->resolveEntry("FTBPacks", QString("logos/%1").arg(logo.section(".", 0, 0)))->getFullPath());
+ } else {
+ requestLogo(logo);
+ }
+}