diff options
| author | Petr Mrázek <peterix@gmail.com> | 2020-06-27 12:02:31 +0200 |
|---|---|---|
| committer | Petr Mrázek <peterix@gmail.com> | 2020-06-27 12:02:31 +0200 |
| commit | a0ef20a264656c127dd62eb9140e89a2fda6a8e0 (patch) | |
| tree | 43b9262f501e9ec835939ec50cc23473e661b291 /api/logic | |
| parent | 4ca62916f562ca2d233d0fb4771054a106f1afc3 (diff) | |
| download | PrismLauncher-a0ef20a264656c127dd62eb9140e89a2fda6a8e0.tar.gz PrismLauncher-a0ef20a264656c127dd62eb9140e89a2fda6a8e0.tar.bz2 PrismLauncher-a0ef20a264656c127dd62eb9140e89a2fda6a8e0.zip | |
NOISSUE rename ComponentList to PackProfile
It's not just components, so the naming needed cleaning up.
Diffstat (limited to 'api/logic')
26 files changed, 131 insertions, 131 deletions
diff --git a/api/logic/CMakeLists.txt b/api/logic/CMakeLists.txt index 50c2cb6e..cf9f9a17 100644 --- a/api/logic/CMakeLists.txt +++ b/api/logic/CMakeLists.txt @@ -259,8 +259,8 @@ set(MINECRAFT_SOURCES minecraft/LaunchProfile.h minecraft/Component.cpp minecraft/Component.h - minecraft/ComponentList.cpp - minecraft/ComponentList.h + minecraft/PackProfile.cpp + minecraft/PackProfile.h minecraft/ComponentUpdateTask.cpp minecraft/ComponentUpdateTask.h minecraft/MinecraftLoadAndCheck.h diff --git a/api/logic/InstanceCreationTask.cpp b/api/logic/InstanceCreationTask.cpp index 978d4687..eafc5126 100644 --- a/api/logic/InstanceCreationTask.cpp +++ b/api/logic/InstanceCreationTask.cpp @@ -4,7 +4,7 @@ //FIXME: remove this #include "minecraft/MinecraftInstance.h" -#include "minecraft/ComponentList.h" +#include "minecraft/PackProfile.h" InstanceCreationTask::InstanceCreationTask(BaseVersionPtr version) { @@ -20,7 +20,7 @@ void InstanceCreationTask::executeTask() instanceSettings->registerSetting("InstanceType", "Legacy"); instanceSettings->set("InstanceType", "OneSix"); MinecraftInstance inst(m_globalSettings, instanceSettings, m_stagingPath); - auto components = inst.getComponentList(); + auto components = inst.getPackProfile(); components->buildingFromScratch(); components->setComponentVersion("net.minecraft", m_version->descriptor(), true); inst.setName(m_instName); diff --git a/api/logic/InstanceImportTask.cpp b/api/logic/InstanceImportTask.cpp index 1e93174c..e2187416 100644 --- a/api/logic/InstanceImportTask.cpp +++ b/api/logic/InstanceImportTask.cpp @@ -11,7 +11,7 @@ // FIXME: this does not belong here, it's Minecraft/Flame specific #include "minecraft/MinecraftInstance.h" -#include "minecraft/ComponentList.h" +#include "minecraft/PackProfile.h" #include "modplatform/flame/FileResolvingTask.h" #include "modplatform/flame/PackManifest.h" #include "Json.h" @@ -236,7 +236,7 @@ void InstanceImportTask::processFlame() mcVersion.remove(QRegExp("[.]+$")); logWarning(tr("Mysterious trailing dots removed from Minecraft version while importing pack.")); } - auto components = instance.getComponentList(); + auto components = instance.getPackProfile(); components->buildingFromScratch(); components->setComponentVersion("net.minecraft", mcVersion, true); if(!forgeVersion.isEmpty()) @@ -288,7 +288,7 @@ void InstanceImportTask::processFlame() qDebug() << info.fileName(); jarMods.push_back(info.absoluteFilePath()); } - auto profile = instance.getComponentList(); + auto profile = instance.getPackProfile(); profile->installJarMods(jarMods); // nuke the original files FS::deletePath(jarmodsPath); diff --git a/api/logic/meta/Version.cpp b/api/logic/meta/Version.cpp index ca889550..2bbe19a7 100644 --- a/api/logic/meta/Version.cpp +++ b/api/logic/meta/Version.cpp @@ -18,7 +18,7 @@ #include <QDateTime> #include "JsonFormat.h" -#include "minecraft/ComponentList.h" +#include "minecraft/PackProfile.h" Meta::Version::Version(const QString &uid, const QString &version) : BaseVersion(), m_uid(uid), m_version(version) diff --git a/api/logic/minecraft/Component.cpp b/api/logic/minecraft/Component.cpp index 51957d17..92821065 100644 --- a/api/logic/minecraft/Component.cpp +++ b/api/logic/minecraft/Component.cpp @@ -5,13 +5,13 @@ #include "meta/Version.h" #include "VersionFile.h" -#include "minecraft/ComponentList.h" +#include "minecraft/PackProfile.h" #include <FileSystem.h> #include <QSaveFile> #include "OneSixVersionFormat.h" #include <assert.h> -Component::Component(ComponentList * parent, const QString& uid) +Component::Component(PackProfile * parent, const QString& uid) { assert(parent); m_parent = parent; @@ -19,7 +19,7 @@ Component::Component(ComponentList * parent, const QString& uid) m_uid = uid; } -Component::Component(ComponentList * parent, std::shared_ptr<Meta::Version> version) +Component::Component(PackProfile * parent, std::shared_ptr<Meta::Version> version) { assert(parent); m_parent = parent; @@ -31,7 +31,7 @@ Component::Component(ComponentList * parent, std::shared_ptr<Meta::Version> vers m_loaded = version->isLoaded(); } -Component::Component(ComponentList * parent, const QString& uid, std::shared_ptr<VersionFile> file) +Component::Component(PackProfile * parent, const QString& uid, std::shared_ptr<VersionFile> file) { assert(parent); m_parent = parent; diff --git a/api/logic/minecraft/Component.h b/api/logic/minecraft/Component.h index 6a0f86c8..cb202f7f 100644 --- a/api/logic/minecraft/Component.h +++ b/api/logic/minecraft/Component.h @@ -9,7 +9,7 @@ #include "QObjectPtr.h" #include "multimc_logic_export.h" -class ComponentList; +class PackProfile; class LaunchProfile; namespace Meta { @@ -22,11 +22,11 @@ class MULTIMC_LOGIC_EXPORT Component : public QObject, public ProblemProvider { Q_OBJECT public: - Component(ComponentList * parent, const QString &uid); + Component(PackProfile * parent, const QString &uid); // DEPRECATED: remove these constructors? - Component(ComponentList * parent, std::shared_ptr<Meta::Version> version); - Component(ComponentList * parent, const QString & uid, std::shared_ptr<VersionFile> file); + Component(PackProfile * parent, std::shared_ptr<Meta::Version> version); + Component(PackProfile * parent, const QString & uid, std::shared_ptr<VersionFile> file); virtual ~Component(){}; void applyTo(LaunchProfile *profile); @@ -73,7 +73,7 @@ signals: void dataChanged(); public: /* data */ - ComponentList * m_parent; + PackProfile * m_parent; // BEGIN: persistent component list properties /// ID of the component diff --git a/api/logic/minecraft/ComponentUpdateTask.cpp b/api/logic/minecraft/ComponentUpdateTask.cpp index 84c0474c..241d9a49 100644 --- a/api/logic/minecraft/ComponentUpdateTask.cpp +++ b/api/logic/minecraft/ComponentUpdateTask.cpp @@ -1,7 +1,7 @@ #include "ComponentUpdateTask.h" -#include "ComponentList_p.h" -#include "ComponentList.h" +#include "PackProfile_p.h" +#include "PackProfile.h" #include "Component.h" #include <Env.h> #include <meta/Index.h> @@ -22,16 +22,16 @@ * Really, it should be a reactor/state machine that receives input from the application * and dynamically adapts to changing requirements... * - * The reactor should be the only entry into manipulating the ComponentList. + * The reactor should be the only entry into manipulating the PackProfile. * See: https://en.wikipedia.org/wiki/Reactor_pattern */ /* - * Or make this operate on a snapshot of the ComponentList state, then merge results in as long as the snapshot and ComponentList didn't change? + * Or make this operate on a snapshot of the PackProfile state, then merge results in as long as the snapshot and PackProfile didn't change? * If the component list changes, start over. */ -ComponentUpdateTask::ComponentUpdateTask(Mode mode, Net::Mode netmode, ComponentList* list, QObject* parent) +ComponentUpdateTask::ComponentUpdateTask(Mode mode, Net::Mode netmode, PackProfile* list, QObject* parent) : Task(parent) { d.reset(new ComponentUpdateTaskData); @@ -126,7 +126,7 @@ static LoadResult loadComponent(ComponentPtr component, shared_qobject_ptr<Task> // FIXME: dead code. determine if this can still be useful? /* -static LoadResult loadComponentList(ComponentPtr component, shared_qobject_ptr<Task>& loadTask, Net::Mode netmode) +static LoadResult loadPackProfile(ComponentPtr component, shared_qobject_ptr<Task>& loadTask, Net::Mode netmode) { if(component->m_loaded) { @@ -217,7 +217,7 @@ void ComponentUpdateTask::loadComponents() } case Mode::Resolution: { - singleResult = loadComponentList(component, loadTask, d->netmode); + singleResult = loadPackProfile(component, loadTask, d->netmode); loadType = RemoteLoadStatus::Type::List; break; } @@ -244,7 +244,7 @@ void ComponentUpdateTask::loadComponents() }); RemoteLoadStatus status; status.type = loadType; - status.componentListIndex = componentIndex; + status.PackProfileIndex = componentIndex; d->remoteLoadStatusList.append(status); taskIndex++; } @@ -495,7 +495,7 @@ static bool getTrivialComponentChanges(const ComponentIndex & index, const Requi } // FIXME, TODO: decouple dependency resolution from loading -// FIXME: This works directly with the ComponentList internals. It shouldn't! It needs richer data types than ComponentList uses. +// FIXME: This works directly with the PackProfile internals. It shouldn't! It needs richer data types than PackProfile uses. // FIXME: throw all this away and use a graph void ComponentUpdateTask::resolveDependencies(bool checkOnly) { @@ -648,7 +648,7 @@ void ComponentUpdateTask::remoteLoadSucceeded(size_t taskIndex) // update the cached data of the component from the downloaded version file. if (taskSlot.type == RemoteLoadStatus::Type::Version) { - auto component = d->m_list->getComponent(taskSlot.componentListIndex); + auto component = d->m_list->getComponent(taskSlot.PackProfileIndex); component->m_loaded = true; component->updateCachedData(); } diff --git a/api/logic/minecraft/ComponentUpdateTask.h b/api/logic/minecraft/ComponentUpdateTask.h index 4cb29a89..4274cabb 100644 --- a/api/logic/minecraft/ComponentUpdateTask.h +++ b/api/logic/minecraft/ComponentUpdateTask.h @@ -4,7 +4,7 @@ #include "net/Mode.h" #include <memory> -class ComponentList; +class PackProfile; struct ComponentUpdateTaskData; class ComponentUpdateTask : public Task @@ -18,7 +18,7 @@ public: }; public: - explicit ComponentUpdateTask(Mode mode, Net::Mode netmode, ComponentList * list, QObject *parent = 0); + explicit ComponentUpdateTask(Mode mode, Net::Mode netmode, PackProfile * list, QObject *parent = 0); virtual ~ComponentUpdateTask(); protected: diff --git a/api/logic/minecraft/ComponentUpdateTask_p.h b/api/logic/minecraft/ComponentUpdateTask_p.h index 5989cf07..5b02431b 100644 --- a/api/logic/minecraft/ComponentUpdateTask_p.h +++ b/api/logic/minecraft/ComponentUpdateTask_p.h @@ -5,7 +5,7 @@ #include <QList> #include "net/Mode.h" -class ComponentList; +class PackProfile; struct RemoteLoadStatus { @@ -15,7 +15,7 @@ struct RemoteLoadStatus List, Version } type = Type::Version; - size_t componentListIndex = 0; + size_t PackProfileIndex = 0; bool finished = false; bool succeeded = false; QString error; @@ -23,7 +23,7 @@ struct RemoteLoadStatus struct ComponentUpdateTaskData { - ComponentList * m_list = nullptr; + PackProfile * m_list = nullptr; QList<RemoteLoadStatus> remoteLoadStatusList; bool remoteLoadSuccessful = true; size_t remoteTasksInProgress = 0; diff --git a/api/logic/minecraft/MinecraftInstance.cpp b/api/logic/minecraft/MinecraftInstance.cpp index 28073edf..db259395 100644 --- a/api/logic/minecraft/MinecraftInstance.cpp +++ b/api/logic/minecraft/MinecraftInstance.cpp @@ -33,7 +33,7 @@ #include "icons/IIconList.h" #include <QCoreApplication> -#include "ComponentList.h" +#include "PackProfile.h" #include "AssetsUtils.h" #include "MinecraftUpdate.h" #include "MinecraftLoadAndCheck.h" @@ -106,7 +106,7 @@ MinecraftInstance::MinecraftInstance(SettingsObjectPtr globalSettings, SettingsO m_settings->registerSetting("ForgeVersion", ""); m_settings->registerSetting("LiteloaderVersion", ""); - m_components.reset(new ComponentList(this)); + m_components.reset(new PackProfile(this)); m_components->setOldConfigVersion("net.minecraft", m_settings->get("IntendedVersion").toString()); auto setting = m_settings->getSetting("LWJGLVersion"); m_components->setOldConfigVersion("org.lwjgl", m_settings->get("LWJGLVersion").toString()); @@ -124,14 +124,14 @@ QString MinecraftInstance::typeName() const return "Minecraft"; } -std::shared_ptr<ComponentList> MinecraftInstance::getComponentList() const +std::shared_ptr<PackProfile> MinecraftInstance::getPackProfile() const { return m_components; } QSet<QString> MinecraftInstance::traits() const { - auto components = getComponentList(); + auto components = getPackProfile(); if (!components) { return {"version-incomplete"}; @@ -265,7 +265,7 @@ QStringList MinecraftInstance::getNativeJars() const QStringList MinecraftInstance::extraArguments() const { auto list = BaseInstance::extraArguments(); - auto version = getComponentList(); + auto version = getPackProfile(); if (!version) return list; auto jarMods = getJarMods(); diff --git a/api/logic/minecraft/MinecraftInstance.h b/api/logic/minecraft/MinecraftInstance.h index a8f64109..985a8a76 100644 --- a/api/logic/minecraft/MinecraftInstance.h +++ b/api/logic/minecraft/MinecraftInstance.h @@ -10,7 +10,7 @@ class ModFolderModel; class WorldList; class GameOptions; class LaunchStep; -class ComponentList; +class PackProfile; class MULTIMC_LOGIC_EXPORT MinecraftInstance: public BaseInstance { @@ -64,7 +64,7 @@ public: ////// Profile management ////// - std::shared_ptr<ComponentList> getComponentList() const; + std::shared_ptr<PackProfile> getPackProfile() const; ////// Mod Lists ////// std::shared_ptr<ModFolderModel> loaderModList() const; @@ -120,7 +120,7 @@ private: QString prettifyTimeDuration(int64_t duration); protected: // data - std::shared_ptr<ComponentList> m_components; + std::shared_ptr<PackProfile> m_components; mutable std::shared_ptr<ModFolderModel> m_loader_mod_list; mutable std::shared_ptr<ModFolderModel> m_core_mod_list; mutable std::shared_ptr<ModFolderModel> m_resource_pack_list; diff --git a/api/logic/minecraft/MinecraftLoadAndCheck.cpp b/api/logic/minecraft/MinecraftLoadAndCheck.cpp index 593e2fc4..79b0c484 100644 --- a/api/logic/minecraft/MinecraftLoadAndCheck.cpp +++ b/api/logic/minecraft/MinecraftLoadAndCheck.cpp @@ -1,6 +1,6 @@ #include "MinecraftLoadAndCheck.h" #include "MinecraftInstance.h" -#include "ComponentList.h" +#include "PackProfile.h" MinecraftLoadAndCheck::MinecraftLoadAndCheck(MinecraftInstance *inst, QObject *parent) : Task(parent), m_inst(inst) { @@ -9,7 +9,7 @@ MinecraftLoadAndCheck::MinecraftLoadAndCheck(MinecraftInstance *inst, QObject *p void MinecraftLoadAndCheck::executeTask() { // add offline metadata load task - auto components = m_inst->getComponentList(); + auto components = m_inst->getPackProfile(); components->reload(Net::Mode::Offline); m_task = components->getCurrentTask(); diff --git a/api/logic/minecraft/MinecraftUpdate.cpp b/api/logic/minecraft/MinecraftUpdate.cpp index f9ff114d..ca3e7617 100644 --- a/api/logic/minecraft/MinecraftUpdate.cpp +++ b/api/logic/minecraft/MinecraftUpdate.cpp @@ -23,7 +23,7 @@ #include <QDataStream> #include "BaseInstance.h" -#include "minecraft/ComponentList.h" +#include "minecraft/PackProfile.h" #include "minecraft/Library.h" #include "net/URLConstants.h" #include <FileSystem.h> @@ -50,7 +50,7 @@ void MinecraftUpdate::executeTask() // add metadata update task if necessary { - auto components = m_inst->getComponentList(); + auto components = m_inst->getPackProfile(); components->reload(Net::Mode::Online); auto task = components->getCurrentTask(); if(task) diff --git a/api/logic/minecraft/OneSixVersionFormat.h b/api/logic/minecraft/OneSixVersionFormat.h index 6bbebca0..14ae385c 100644 --- a/api/logic/minecraft/OneSixVersionFormat.h +++ b/api/logic/minecraft/OneSixVersionFormat.h @@ -1,7 +1,7 @@ #pragma once #include <minecraft/VersionFile.h> -#include <minecraft/ComponentList.h> +#include <minecraft/PackProfile.h> #include <minecraft/Library.h> #include <QJsonDocument> diff --git a/api/logic/minecraft/ComponentList.cpp b/api/logic/minecraft/PackProfile.cpp index 51fe214d..15f2f55d 100644 --- a/api/logic/minecraft/ComponentList.cpp +++ b/api/logic/minecraft/PackProfile.cpp @@ -32,23 +32,23 @@ #include <QTimer> #include <Json.h> -#include "ComponentList.h" -#include "ComponentList_p.h" +#include "PackProfile.h" +#include "PackProfile_p.h" #include "ComponentUpdateTask.h" -ComponentList::ComponentList(MinecraftInstance * instance) +PackProfile::PackProfile(MinecraftInstance * instance) : QAbstractListModel() { - d.reset(new ComponentListData); + d.reset(new PackProfileData); d->m_instance = instance; d->m_saveTimer.setSingleShot(true); d->m_saveTimer.setInterval(5000); d->interactionDisabled = instance->isRunning(); - connect(d->m_instance, &BaseInstance::runningStatusChanged, this, &ComponentList::disableInteraction); - connect(&d->m_saveTimer, &QTimer::timeout, this, &ComponentList::save_internal); + connect(d->m_instance, &BaseInstance::runningStatusChanged, this, &PackProfile::disableInteraction); + connect(&d->m_saveTimer, &QTimer::timeout, this, &PackProfile::save_internal); } -ComponentList::~ComponentList() +PackProfile::~PackProfile() { saveNow(); } @@ -97,7 +97,7 @@ static QJsonObject componentToJsonV1(ComponentPtr component) return obj; } -static ComponentPtr componentFromJsonV1(ComponentList * parent, const QString & componentJsonPattern, const QJsonObject &obj) +static ComponentPtr componentFromJsonV1(PackProfile * parent, const QString & componentJsonPattern, const QJsonObject &obj) { // critical auto uid = Json::requireString(obj.value("uid")); @@ -120,7 +120,7 @@ static ComponentPtr componentFromJsonV1(ComponentList * parent, const QString & } // Save the given component container data to a file -static bool saveComponentList(const QString & filename, const ComponentContainer & container) +static bool savePackProfile(const QString & filename, const ComponentContainer & container) { QJsonObject obj; obj.insert("formatVersion", currentComponentsFileVersion); @@ -153,7 +153,7 @@ static bool saveComponentList(const QString & filename, const ComponentContainer } // Read the given file into component containers -static bool loadComponentList(ComponentList * parent, const QString & filename, const QString & componentJsonPattern, ComponentContainer & container) +static bool loadPackProfile(PackProfile * parent, const QString & filename, const QString & componentJsonPattern, ComponentContainer & container) { QFile componentsFile(filename); if (!componentsFile.exists()) @@ -210,7 +210,7 @@ static bool loadComponentList(ComponentList * parent, const QString & filename, // BEGIN: save/load logic -void ComponentList::saveNow() +void PackProfile::saveNow() { if(saveIsScheduled()) { @@ -219,18 +219,18 @@ void ComponentList::saveNow() } } -bool ComponentList::saveIsScheduled() const +bool PackProfile::saveIsScheduled() const { return d->dirty; } -void ComponentList::buildingFromScratch() +void PackProfile::buildingFromScratch() { d->loaded = true; d->dirty = true; } -void ComponentList::scheduleSave() +void PackProfile::scheduleSave() { if(!d->loaded) { @@ -245,30 +245,30 @@ void ComponentList::scheduleSave() d->m_saveTimer.start(); } -QString ComponentList::componentsFilePath() const +QString PackProfile::componentsFilePath() const { return FS::PathCombine(d->m_instance->instanceRoot(), "mmc-pack.json"); } -QString ComponentList::patchesPattern() const +QString PackProfile::patchesPattern() const { return FS::PathCombine(d->m_instance->instanceRoot(), "patches", "%1.json"); } -QString ComponentList::patchFilePathForUid(const QString& uid) const +QString PackProfile::patchFilePathForUid(const QString& uid) const { return patchesPattern().arg(uid); } -void ComponentList::save_internal() +void PackProfile::save_internal() { qDebug() << "Component list save performed now for" << d->m_instance->name(); auto filename = componentsFilePath(); - saveComponentList(filename, d->components); + savePackProfile(filename, d->components); d->dirty = false; } -bool ComponentList::load() +bool PackProfile::load() { auto filename = componentsFilePath(); QFile componentsFile(filename); @@ -286,7 +286,7 @@ bool ComponentList::load() // load the new component list and swap it with the current one... ComponentContainer newComponents; - if(!loadComponentList(this, filename, patchesPattern(), newComponents)) + if(!loadPackProfile(this, filename, patchesPattern(), newComponents)) { qCritical() << "Failed to load the component config for instance" << d->m_instance->name(); return false; @@ -298,7 +298,7 @@ bool ComponentList::load() // disconnect all the old components for(auto component: d->components) { - disconnect(component.get(), &Component::dataChanged, this, &ComponentList::componentDataChanged); + disconnect(component.get(), &Component::dataChanged, this, &PackProfile::componentDataChanged); } d->components.clear(); d->componentIndex.clear(); @@ -309,7 +309,7 @@ bool ComponentList::load() qWarning() << "Ignoring duplicate component entry" << component->m_uid; continue; } - connect(component.get(), &Component::dataChanged, this, &ComponentList::componentDataChanged); + connect(component.get(), &Component::dataChanged, this, &PackProfile::componentDataChanged); d->components.append(component); d->componentIndex[component->m_uid] = component; } @@ -319,7 +319,7 @@ bool ComponentList::load() } } -void ComponentList::reload(Net::Mode netmode) +void PackProfile::reload(Net::Mode netmode) { // Do not reload when the update/resolve task is running. It is in control. if(d->m_updateTask) @@ -339,29 +339,29 @@ void ComponentList::reload(Net::Mode netmode) } } -shared_qobject_ptr<Task> ComponentList::getCurrentTask() +shared_qobject_ptr<Task> PackProfile::getCurrentTask() { return d->m_updateTask; } -void ComponentList::resolve(Net::Mode netmode) +void PackProfile::resolve(Net::Mode netmode) { auto updateTask = new ComponentUpdateTask(ComponentUpdateTask::Mode::Resolution, netmode, this); d->m_updateTask.reset(updateTask); - connect(updateTask, &ComponentUpdateTask::succeeded, this, &ComponentList::updateSucceeded); - connect(updateTask, &ComponentUpdateTask::failed, this, &ComponentList::updateFailed); + connect(updateTask, &ComponentUpdateTask::succeeded, this, &PackProfile::updateSucceeded); + connect(updateTask, &ComponentUpdateTask::failed, this, &PackProfile::updateFailed); d->m_updateTask->start(); } -void ComponentList::updateSucceeded() +void PackProfile::updateSucceeded() { qDebug() << "Component list update/resolve task succeeded for" << d->m_instance->name(); d->m_updateTask.reset(); invalidateLaunchProfile(); } -void ComponentList::updateFailed(const QString& error) +void PackProfile::updateFailed(const QString& error) { qDebug() << "Component list update/resolve task failed for" << d->m_instance->name() << "Reason:" << error; d->m_updateTask.reset(); @@ -431,7 +431,7 @@ static void upgradeDeprecatedFiles(QString root, QString instanceName) * - Part is taken from the old order.json file. * - Part is loaded from loose json files in the instance's `patches` directory. */ -bool ComponentList::migratePreComponentConfig() +bool PackProfile::migratePreComponentConfig() { // upgrade the very old files from the beginnings of MultiMC 5 upgradeDeprecatedFiles(d->m_instance->instanceRoot(), d->m_instance->name()); @@ -598,17 +598,17 @@ bool ComponentList::migratePreComponentConfig() } } // new we have a complete list of components... - return saveComponentList(componentsFilePath(), components); + return savePackProfile(componentsFilePath(), components); } // END: save/load -void ComponentList::appendComponent(ComponentPtr component) +void PackProfile::appendComponent(ComponentPtr component) { insertComponent(d->components.size(), component); } -void ComponentList::insertComponent(size_t index, ComponentPtr component) +void PackProfile::insertComponent(size_t index, ComponentPtr component) { auto id = component->getID(); if(id.isEmpty()) @@ -625,16 +625,16 @@ void ComponentList::insertComponent(size_t index, ComponentPtr component) d->components.insert(index, component); d->componentIndex[id] = component; endInsertRows(); - connect(component.get(), &Component::dataChanged, this, &ComponentList::componentDataChanged); + connect(component.get(), &Component::dataChanged, this, &PackProfile::componentDataChanged); scheduleSave(); } -void ComponentList::componentDataChanged() +void PackProfile::componentDataChanged() { auto objPtr = qobject_cast<Component *>(sender()); if(!objPtr) { - qWarning() << "ComponentList got dataChenged signal from a non-Component!"; + qWarning() << "PackProfile got dataChenged signal from a non-Component!"; return; } if(objPtr->getID() == "net.minecraft") { @@ -652,10 +652,10 @@ void ComponentList::componentDataChanged() } index++; } - qWarning() << "ComponentList got dataChenged signal from a Component which does not belong to it!"; + qWarning() << "PackProfile got dataChenged signal from a Component which does not belong to it!"; } -bool ComponentList::remove(const int index) +bool PackProfile::remove(const int index) { auto patch = getComponent(index); if (!patch->isRemovable()) @@ -679,7 +679,7 @@ bool ComponentList::remove(const int index) return true; } -bool ComponentList::remove(const QString id) +bool PackProfile::remove(const QString id) { int i = 0; for (auto patch : d->components) @@ -693,7 +693,7 @@ bool ComponentList::remove(const QString id) return false; } -bool ComponentList::customize(int index) +bool PackProfile::customize(int index) { auto patch = getComponent(index); if (!patch->isCustomizable()) @@ -711,7 +711,7 @@ bool ComponentList::customize(int index) return true; } -bool ComponentList::revertToBase(int index) +bool PackProfile::revertToBase(int index) { auto patch = getComponent(index); if (!patch->isRevertible()) @@ -729,7 +729,7 @@ bool ComponentList::revertToBase(int index) return true; } -Component * ComponentList::getComponent(const QString &id) +Component * PackProfile::getComponent(const QString &id) |
