summaryrefslogtreecommitdiffstats
path: root/api/logic/minecraft
diff options
context:
space:
mode:
Diffstat (limited to 'api/logic/minecraft')
-rw-r--r--api/logic/minecraft/Component.cpp2
-rw-r--r--api/logic/minecraft/ComponentList.cpp4
-rw-r--r--api/logic/minecraft/ProfileUtils.cpp4
-rw-r--r--api/logic/minecraft/World.cpp10
-rw-r--r--api/logic/minecraft/forge/ForgeXzDownload.cpp2
5 files changed, 11 insertions, 11 deletions
diff --git a/api/logic/minecraft/Component.cpp b/api/logic/minecraft/Component.cpp
index 50a2ae16..c6e41e65 100644
--- a/api/logic/minecraft/Component.cpp
+++ b/api/logic/minecraft/Component.cpp
@@ -323,7 +323,7 @@ bool Component::customize()
m_metaVersion.reset();
emit dataChanged();
}
- catch (Exception &error)
+ catch (const Exception &error)
{
qWarning() << "Version could not be loaded:" << error.cause();
}
diff --git a/api/logic/minecraft/ComponentList.cpp b/api/logic/minecraft/ComponentList.cpp
index a207e987..e373d499 100644
--- a/api/logic/minecraft/ComponentList.cpp
+++ b/api/logic/minecraft/ComponentList.cpp
@@ -195,7 +195,7 @@ static bool loadComponentList(ComponentList * parent, const QString & filename,
container.append(componentFromJsonV1(parent, componentJsonPattern, obj));
}
}
- catch (JSONValidationError &err)
+ catch (const JSONValidationError &err)
{
qCritical() << "Couldn't parse" << componentsFile.fileName() << ": bad file format";
container.clear();
@@ -1150,7 +1150,7 @@ std::shared_ptr<LaunchProfile> ComponentList::getProfile() const
}
d->m_profile = profile;
}
- catch (Exception & error)
+ catch (const Exception &error)
{
qWarning() << "Couldn't apply profile patches because: " << error.cause();
}
diff --git a/api/logic/minecraft/ProfileUtils.cpp b/api/logic/minecraft/ProfileUtils.cpp
index a6d2028d..2227e438 100644
--- a/api/logic/minecraft/ProfileUtils.cpp
+++ b/api/logic/minecraft/ProfileUtils.cpp
@@ -57,7 +57,7 @@ bool readOverrideOrders(QString path, PatchOrder &order)
order.append(Json::requireString(item));
}
}
- catch (JSONValidationError &err)
+ catch (const JSONValidationError &err)
{
qCritical() << "Couldn't parse" << orderFile.fileName() << ": bad file format";
qWarning() << "Ignoring overriden order";
@@ -82,7 +82,7 @@ static VersionFilePtr guardedParseJson(const QJsonDocument & doc,const QString &
{
return OneSixVersionFormat::versionFileFromJson(doc, filepath, requireOrder);
}
- catch (Exception & e)
+ catch (const Exception &e)
{
return createErrorVersionFile(fileId, filepath, e.cause());
}
diff --git a/api/logic/minecraft/World.cpp b/api/logic/minecraft/World.cpp
index 68c0a5cc..227a9b75 100644
--- a/api/logic/minecraft/World.cpp
+++ b/api/logic/minecraft/World.cpp
@@ -263,13 +263,13 @@ static QString read_string (nbt::value& parent, const char * name, const QString
auto & tag_str = namedValue.as<nbt::tag_string>();
return QString::fromStdString(tag_str.get());
}
- catch(std::out_of_range e)
+ catch (const std::out_of_range &e)
{
// fallback for old world formats
qWarning() << "String NBT tag" << name << "could not be found. Defaulting to" << fallback;
return fallback;
}
- catch(std::bad_cast e)
+ catch (const std::bad_cast &e)
{
// type mismatch
qWarning() << "NBT tag" << name << "could not be converted to string. Defaulting to" << fallback;
@@ -289,13 +289,13 @@ static int64_t read_long (nbt::value& parent, const char * name, const int64_t &
auto & tag_str = namedValue.as<nbt::tag_long>();
return tag_str.get();
}
- catch(std::out_of_range e)
+ catch (const std::out_of_range &e)
{
// fallback for old world formats
qWarning() << "Long NBT tag" << name << "could not be found. Defaulting to" << fallback;
return fallback;
}
- catch(std::bad_cast e)
+ catch (const std::bad_cast &e)
{
// type mismatch
qWarning() << "NBT tag" << name << "could not be converted to long. Defaulting to" << fallback;
@@ -338,7 +338,7 @@ void World::loadFromLevelDat(QByteArray data)
qDebug() << "Last Played:" << m_lastPlayed.toString();
qDebug() << "Seed:" << m_randomSeed;
}
- catch (nbt::io::input_error e)
+ catch (const nbt::io::input_error &e)
{
qWarning() << "Unable to load" << m_folderName << ":" << e.what();
is_valid = false;
diff --git a/api/logic/minecraft/forge/ForgeXzDownload.cpp b/api/logic/minecraft/forge/ForgeXzDownload.cpp
index a05d0f8d..4d82a58a 100644
--- a/api/logic/minecraft/forge/ForgeXzDownload.cpp
+++ b/api/logic/minecraft/forge/ForgeXzDownload.cpp
@@ -345,7 +345,7 @@ void ForgeXzDownload::decompressAndInstall()
// NOTE: this takes ownership of both FILE pointers. That's why we duplicate them above.
unpack_200(file_in, file_out);
}
- catch (std::runtime_error &err)
+ catch (const std::runtime_error &err)
{
m_status = Job_Failed;
qCritical() << "Error unpacking " << pack200_file.fileName() << " : " << err.what();