diff options
author | Petr Mrázek <peterix@gmail.com> | 2015-05-23 16:07:47 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2015-05-23 16:07:47 +0200 |
commit | ce99fabe1396ed2956dc7ecb468760ef88f98765 (patch) | |
tree | 603f7c6f1a0f27805b21843ec3f829354ad0ff77 /logic/ftb/FTBPlugin.cpp | |
parent | 0e0ddf5494ab4a264b0dc18c4b94809844300dc0 (diff) | |
download | MultiMC-ce99fabe1396ed2956dc7ecb468760ef88f98765.tar MultiMC-ce99fabe1396ed2956dc7ecb468760ef88f98765.tar.gz MultiMC-ce99fabe1396ed2956dc7ecb468760ef88f98765.tar.lz MultiMC-ce99fabe1396ed2956dc7ecb468760ef88f98765.tar.xz MultiMC-ce99fabe1396ed2956dc7ecb468760ef88f98765.zip |
GH-992 Add a transaction/locking mechanism to settings objects
This can cut the FTB loading by ~66% - worth it, but not ideal.
Real solution will have to be implemented later.
Diffstat (limited to 'logic/ftb/FTBPlugin.cpp')
-rw-r--r-- | logic/ftb/FTBPlugin.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/logic/ftb/FTBPlugin.cpp b/logic/ftb/FTBPlugin.cpp index cbb13953..ffac46f7 100644 --- a/logic/ftb/FTBPlugin.cpp +++ b/logic/ftb/FTBPlugin.cpp @@ -155,21 +155,29 @@ InstancePtr loadInstance(SettingsObjectPtr globalSettings, QMap<QString, QString { return nullptr; } + qDebug() << "Construction " << record.instanceDir; + SettingsObject::Lock lock(inst->settings()); inst->init(); + qDebug() << "Init " << record.instanceDir; inst->setGroupInitial("FTB"); + qDebug() << "A " << record.instanceDir; inst->setName(record.name); + qDebug() << "B " << record.instanceDir; inst->setIconKey(record.iconKey); + qDebug() << "C " << record.instanceDir; if (inst->intendedVersionId() != record.mcVersion) { inst->setIntendedVersionId(record.mcVersion); } + qDebug() << "D " << record.instanceDir; inst->setNotes(record.description); + qDebug() << "Post-Process " << record.instanceDir; if (!InstanceList::continueProcessInstance(inst, InstanceList::NoCreateError, record.instanceDir, groupMap)) { return nullptr; } - + qDebug() << "Final " << record.instanceDir; return inst; } @@ -217,6 +225,7 @@ InstancePtr createInstance(SettingsObjectPtr globalSettings, QMap<QString, QStri inst->setIconKey(record.logo); inst->setIntendedVersionId(record.mcVersion); inst->setNotes(record.description); + qDebug() << "Post-Process " << record.instanceDir; if (!InstanceList::continueProcessInstance(inst, InstanceList::NoCreateError, record.instanceDir, groupMap)) { return nullptr; @@ -247,6 +256,7 @@ void FTBPlugin::loadInstances(SettingsObjectPtr globalSettings, QMap<QString, QS QString iconKey = record.iconKey; ENV.icons()->addIcon(iconKey, iconKey, PathCombine(record.templateDir, record.logo), MMCIcon::Transient); auto settingsFilePath = PathCombine(record.instanceDir, "instance.cfg"); + qDebug() << "ICON get!"; if (QFileInfo(settingsFilePath).exists()) { |