aboutsummaryrefslogtreecommitdiff
path: root/launcher/minecraft/PackProfile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'launcher/minecraft/PackProfile.cpp')
-rw-r--r--launcher/minecraft/PackProfile.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/launcher/minecraft/PackProfile.cpp b/launcher/minecraft/PackProfile.cpp
index 82fc779e..cf8270cd 100644
--- a/launcher/minecraft/PackProfile.cpp
+++ b/launcher/minecraft/PackProfile.cpp
@@ -204,10 +204,10 @@ static bool loadPackProfile(PackProfile* parent,
}
auto orderArray = Json::requireArray(obj.value("components"));
for (auto item : orderArray) {
- auto obj = Json::requireObject(item, "Component must be an object.");
- container.append(componentFromJsonV1(parent, componentJsonPattern, obj));
+ auto comp_obj = Json::requireObject(item, "Component must be an object.");
+ container.append(componentFromJsonV1(parent, componentJsonPattern, comp_obj));
}
- } catch (const JSONValidationError& err) {
+ } catch ([[maybe_unused]] const JSONValidationError& err) {
qCritical() << "Couldn't parse" << componentsFile.fileName() << ": bad file format";
container.clear();
return false;
@@ -377,7 +377,7 @@ void PackProfile::insertComponent(size_t index, ComponentPtr component)
qWarning() << "Attempt to add a component that is already present!";
return;
}
- beginInsertRows(QModelIndex(), index, index);
+ beginInsertRows(QModelIndex(), static_cast<int>(index), static_cast<int>(index));
d->components.insert(index, component);
d->componentIndex[id] = component;
endInsertRows();
@@ -389,7 +389,7 @@ void PackProfile::componentDataChanged()
{
auto objPtr = qobject_cast<Component*>(sender());
if (!objPtr) {
- qWarning() << "PackProfile got dataChenged signal from a non-Component!";
+ qWarning() << "PackProfile got dataChanged signal from a non-Component!";
return;
}
if (objPtr->getID() == "net.minecraft") {
@@ -405,7 +405,7 @@ void PackProfile::componentDataChanged()
}
index++;
}
- qWarning() << "PackProfile got dataChenged signal from a Component which does not belong to it!";
+ qWarning() << "PackProfile got dataChanged signal from a Component which does not belong to it!";
}
bool PackProfile::remove(const int index)
@@ -483,9 +483,9 @@ ComponentPtr PackProfile::getComponent(const QString& id)
return (*iter);
}
-ComponentPtr PackProfile::getComponent(int index)
+ComponentPtr PackProfile::getComponent(size_t index)
{
- if (index < 0 || index >= d->components.size()) {
+ if (index >= static_cast<size_t>(d->components.size())) {
return nullptr;
}
return d->components[index];
@@ -547,7 +547,7 @@ QVariant PackProfile::data(const QModelIndex& index, int role) const
return QVariant();
}
-bool PackProfile::setData(const QModelIndex& index, const QVariant& value, int role)
+bool PackProfile::setData(const QModelIndex& index, [[maybe_unused]] const QVariant& value, int role)
{
if (!index.isValid() || index.row() < 0 || index.row() >= rowCount(index.parent())) {
return false;