fixed code scaning

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97 2023-08-18 21:43:57 +03:00
parent 4c52b18bdd
commit 58efd3e9e2
No known key found for this signature in database
GPG Key ID: 55EF5DA53DB36318
2 changed files with 4 additions and 3 deletions

View File

@ -108,7 +108,7 @@ class ResourceAPI {
void operator=(ProjectInfoArgs other) { pack = other.pack; } void operator=(ProjectInfoArgs other) { pack = other.pack; }
}; };
struct ProjectInfoCallbacks { struct ProjectInfoCallbacks {
std::function<void(QJsonDocument&, ModPlatform::IndexedPack)> on_succeed; std::function<void(QJsonDocument&, const ModPlatform::IndexedPack&)> on_succeed;
std::function<void(QString const& reason)> on_fail; std::function<void(QString const& reason)> on_fail;
std::function<void()> on_abort; std::function<void()> on_abort;
}; };

View File

@ -152,7 +152,7 @@ void ResourceModel::search()
}; };
if (!callbacks.on_succeed) if (!callbacks.on_succeed)
callbacks.on_succeed = [this](auto& doc, auto pack) { callbacks.on_succeed = [this](auto& doc, auto& pack) {
if (!s_running_models.constFind(this).value()) if (!s_running_models.constFind(this).value())
return; return;
searchRequestForOneSucceeded(doc); searchRequestForOneSucceeded(doc);
@ -219,9 +219,10 @@ void ResourceModel::loadEntry(QModelIndex& entry)
// Use default if no callbacks are set // Use default if no callbacks are set
if (!callbacks.on_succeed) if (!callbacks.on_succeed)
callbacks.on_succeed = [this, entry](auto& doc, auto pack) { callbacks.on_succeed = [this, entry](auto& doc, auto& newpack) {
if (!s_running_models.constFind(this).value()) if (!s_running_models.constFind(this).value())
return; return;
auto pack = newpack;
infoRequestSucceeded(doc, pack, entry); infoRequestSucceeded(doc, pack, entry);
}; };
if (!callbacks.on_fail) if (!callbacks.on_fail)