Permalink
Browse files

NOISSUE rearrange profile loading slightly (one function)

  • Loading branch information...
peterix committed Sep 11, 2017
1 parent d8c8a41 commit 5290b9d0d4c1e5a358db526a2f550c93f387fdde
Showing with 3 additions and 15 deletions.
  1. +3 −13 api/logic/minecraft/MinecraftProfile.cpp
  2. +0 −2 api/logic/minecraft/MinecraftProfile.h
@@ -730,8 +730,10 @@ void MinecraftProfile::upgradeDeprecatedFiles_internal()
}
}
void MinecraftProfile::loadDefaultBuiltinPatches_internal()
void MinecraftProfile::load_internal()
{
clearPatches();
upgradeDeprecatedFiles_internal();
auto addBuiltinPatch = [&](const QString &uid, const QString intendedVersion, int order)
{
auto jsonFilePath = FS::PathCombine(m_instance->instanceRoot(), "patches" , uid + ".json");
@@ -759,10 +761,7 @@ void MinecraftProfile::loadDefaultBuiltinPatches_internal()
};
addBuiltinPatch("net.minecraft", m_instance->getComponentVersion("net.minecraft"), -2);
addBuiltinPatch("org.lwjgl", m_instance->getComponentVersion("org.lwjgl"), -1);
}
void MinecraftProfile::loadUserPatches_internal()
{
// first, collect all patches (that are not builtins of OneSix) and load them
QMap<QString, ProfilePatchPtr> loadedPatches;
QDir patchesDir(FS::PathCombine(m_instance->instanceRoot(),"patches"));
@@ -850,15 +849,6 @@ void MinecraftProfile::loadUserPatches_internal()
// TODO: save the order here?
}
void MinecraftProfile::load_internal()
{
clearPatches();
upgradeDeprecatedFiles_internal();
loadDefaultBuiltinPatches_internal();
loadUserPatches_internal();
}
bool MinecraftProfile::saveOrder_internal(ProfileUtils::PatchOrder order) const
{
return ProfileUtils::writeOverrideOrders(FS::PathCombine(m_instance->instanceRoot(), "order.json"), order);
@@ -144,8 +144,6 @@ class MULTIMC_LOGIC_EXPORT MinecraftProfile : public QAbstractListModel
bool removePatch_internal(ProfilePatchPtr patch);
bool customizePatch_internal(ProfilePatchPtr patch);
bool revertPatch_internal(ProfilePatchPtr patch);
void loadDefaultBuiltinPatches_internal();
void loadUserPatches_internal();
void upgradeDeprecatedFiles_internal();
private: /* data */

0 comments on commit 5290b9d

Please sign in to comment.