chore: fix some codeql warnings (#3838)
This commit is contained in:
commit
f17e443b12
11 changed files with 14 additions and 11 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
#pragma once
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
namespace SysInfo {
|
namespace SysInfo {
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
#pragma once
|
||||||
#include <QAnyStringView>
|
#include <QAnyStringView>
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
|
|
|
@ -159,7 +159,7 @@ bool loadAssetsIndexJson(const QString& assetsId, const QString& path, AssetsInd
|
||||||
if (key == "hash") {
|
if (key == "hash") {
|
||||||
object.hash = value.toString();
|
object.hash = value.toString();
|
||||||
} else if (key == "size") {
|
} else if (key == "size") {
|
||||||
object.size = value.toDouble();
|
object.size = value.toLongLong();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -462,7 +462,7 @@ void Component::waitLoadMeta()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Component::setUpdateAction(UpdateAction action)
|
void Component::setUpdateAction(const UpdateAction& action)
|
||||||
{
|
{
|
||||||
m_updateAction = action;
|
m_updateAction = action;
|
||||||
}
|
}
|
||||||
|
|
|
@ -106,7 +106,7 @@ class Component : public QObject, public ProblemProvider {
|
||||||
|
|
||||||
void waitLoadMeta();
|
void waitLoadMeta();
|
||||||
|
|
||||||
void setUpdateAction(UpdateAction action);
|
void setUpdateAction(const UpdateAction& action);
|
||||||
void clearUpdateAction();
|
void clearUpdateAction();
|
||||||
UpdateAction getUpdateAction();
|
UpdateAction getUpdateAction();
|
||||||
|
|
||||||
|
|
|
@ -570,7 +570,7 @@ void ComponentUpdateTask::performUpdateActions()
|
||||||
component->setVersion(cv.targetVersion);
|
component->setVersion(cv.targetVersion);
|
||||||
component->waitLoadMeta();
|
component->waitLoadMeta();
|
||||||
},
|
},
|
||||||
[&component, &instance](const UpdateActionLatestRecommendedCompatible lrc) {
|
[&component, &instance](const UpdateActionLatestRecommendedCompatible& lrc) {
|
||||||
qCDebug(instanceProfileResolveC)
|
qCDebug(instanceProfileResolveC)
|
||||||
<< instance->name() << "|"
|
<< instance->name() << "|"
|
||||||
<< "UpdateActionLatestRecommendedCompatible" << component->getID() << ":" << component->getVersion()
|
<< "UpdateActionLatestRecommendedCompatible" << component->getID() << ":" << component->getVersion()
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
#include <QUuid>
|
#include <QUuid>
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
void tokenToJSONV3(QJsonObject& parent, Token t, const char* tokenName)
|
void tokenToJSONV3(QJsonObject& parent, const Token& t, const char* tokenName)
|
||||||
{
|
{
|
||||||
if (!t.persistent) {
|
if (!t.persistent) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -87,7 +87,7 @@ ModPlatform::Dependency GetModDependenciesTask::getOverride(const ModPlatform::D
|
||||||
{
|
{
|
||||||
if (auto isQuilt = m_loaderType & ModPlatform::Quilt; isQuilt || m_loaderType & ModPlatform::Fabric) {
|
if (auto isQuilt = m_loaderType & ModPlatform::Quilt; isQuilt || m_loaderType & ModPlatform::Fabric) {
|
||||||
auto overide = ModPlatform::getOverrideDeps();
|
auto overide = ModPlatform::getOverrideDeps();
|
||||||
auto over = std::find_if(overide.cbegin(), overide.cend(), [dep, providerName, isQuilt](auto o) {
|
auto over = std::find_if(overide.cbegin(), overide.cend(), [dep, providerName, isQuilt](const auto& o) {
|
||||||
return o.provider == providerName && dep.addonId == (isQuilt ? o.fabric : o.quilt);
|
return o.provider == providerName && dep.addonId == (isQuilt ? o.fabric : o.quilt);
|
||||||
});
|
});
|
||||||
if (over != overide.cend()) {
|
if (over != overide.cend()) {
|
||||||
|
@ -207,8 +207,9 @@ Task::Ptr GetModDependenciesTask::prepareDependencyTask(const ModPlatform::Depen
|
||||||
if (!pDep->version.addonId.isValid()) {
|
if (!pDep->version.addonId.isValid()) {
|
||||||
if (m_loaderType & ModPlatform::Quilt) { // falback for quilt
|
if (m_loaderType & ModPlatform::Quilt) { // falback for quilt
|
||||||
auto overide = ModPlatform::getOverrideDeps();
|
auto overide = ModPlatform::getOverrideDeps();
|
||||||
auto over = std::find_if(overide.cbegin(), overide.cend(),
|
auto over = std::find_if(overide.cbegin(), overide.cend(), [dep, provider](const auto& o) {
|
||||||
[dep, provider](auto o) { return o.provider == provider.name && dep.addonId == o.quilt; });
|
return o.provider == provider.name && dep.addonId == o.quilt;
|
||||||
|
});
|
||||||
if (over != overide.cend()) {
|
if (over != overide.cend()) {
|
||||||
removePack(dep.addonId);
|
removePack(dep.addonId);
|
||||||
addTask(prepareDependencyTask({ over->fabric, dep.type }, provider.name, level));
|
addTask(prepareDependencyTask({ over->fabric, dep.type }, provider.name, level));
|
||||||
|
|
|
@ -391,7 +391,7 @@ QString PackInstallTask::getVersionForLoader(QString uid)
|
||||||
return m_version.loader.version;
|
return m_version.loader.version;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString PackInstallTask::detectLibrary(VersionLibrary library)
|
QString PackInstallTask::detectLibrary(const VersionLibrary& library)
|
||||||
{
|
{
|
||||||
// Try to detect what the library is
|
// Try to detect what the library is
|
||||||
if (!library.server.isEmpty() && library.server.split("/").length() >= 3) {
|
if (!library.server.isEmpty() && library.server.split("/").length() >= 3) {
|
||||||
|
|
|
@ -105,7 +105,7 @@ class PackInstallTask : public InstanceTask {
|
||||||
private:
|
private:
|
||||||
QString getDirForModType(ModType type, QString raw);
|
QString getDirForModType(ModType type, QString raw);
|
||||||
QString getVersionForLoader(QString uid);
|
QString getVersionForLoader(QString uid);
|
||||||
QString detectLibrary(VersionLibrary library);
|
QString detectLibrary(const VersionLibrary& library);
|
||||||
|
|
||||||
bool createLibrariesComponent(QString instanceRoot, std::shared_ptr<PackProfile> profile);
|
bool createLibrariesComponent(QString instanceRoot, std::shared_ptr<PackProfile> profile);
|
||||||
bool createPackComponent(QString instanceRoot, std::shared_ptr<PackProfile> profile);
|
bool createPackComponent(QString instanceRoot, std::shared_ptr<PackProfile> profile);
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#pragma once
|
||||||
#include <QFuture>
|
#include <QFuture>
|
||||||
#include <QJsonDocument>
|
#include <QJsonDocument>
|
||||||
#include <QJsonObject>
|
#include <QJsonObject>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue