summaryrefslogtreecommitdiffstats
path: root/application
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2015-05-23 16:07:47 +0200
committerPetr Mrázek <peterix@gmail.com>2015-05-23 16:07:47 +0200
commitce99fabe1396ed2956dc7ecb468760ef88f98765 (patch)
tree603f7c6f1a0f27805b21843ec3f829354ad0ff77 /application
parent0e0ddf5494ab4a264b0dc18c4b94809844300dc0 (diff)
downloadMultiMC-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 'application')
-rw-r--r--application/ConsoleWindow.cpp4
-rw-r--r--application/MainWindow.cpp6
-rw-r--r--application/pages/InstanceSettingsPage.cpp2
-rw-r--r--application/pages/InstanceSettingsPage.h2
4 files changed, 7 insertions, 7 deletions
diff --git a/application/ConsoleWindow.cpp b/application/ConsoleWindow.cpp
index 52c68299..a96d84a1 100644
--- a/application/ConsoleWindow.cpp
+++ b/application/ConsoleWindow.cpp
@@ -138,7 +138,7 @@ ConsoleWindow::ConsoleWindow(BaseProcess *process, QWidget *parent)
setMayClose(false);
- if (m_proc->instance()->settings().get("ShowConsole").toBool())
+ if (m_proc->instance()->settings()->get("ShowConsole").toBool())
{
show();
}
@@ -225,7 +225,7 @@ void ConsoleWindow::onEnded(InstancePtr instance, int code, QProcess::ExitStatus
bool peacefulExit = code == 0 && status != QProcess::CrashExit;
m_killButton->setEnabled(false);
setMayClose(true);
- if (instance->settings().get("AutoCloseConsole").toBool())
+ if (instance->settings()->get("AutoCloseConsole").toBool())
{
if (peacefulExit)
{
diff --git a/application/MainWindow.cpp b/application/MainWindow.cpp
index 02052392..1409a924 100644
--- a/application/MainWindow.cpp
+++ b/application/MainWindow.cpp
@@ -1548,7 +1548,7 @@ void MainWindow::instanceActivated(QModelIndex index)
if (!inst)
return;
- JavaCommon::checkJVMArgs(inst->settings().get("JvmArgs").toString(), this);
+ JavaCommon::checkJVMArgs(inst->settings()->get("JvmArgs").toString(), this);
doLaunch();
}
@@ -1557,7 +1557,7 @@ void MainWindow::on_actionLaunchInstance_triggered()
{
if (m_selectedInstance)
{
- JavaCommon::checkJVMArgs(m_selectedInstance->settings().get("JvmArgs").toString(), this);
+ JavaCommon::checkJVMArgs(m_selectedInstance->settings()->get("JvmArgs").toString(), this);
doLaunch();
}
}
@@ -1566,7 +1566,7 @@ void MainWindow::on_actionLaunchInstanceOffline_triggered()
{
if (m_selectedInstance)
{
- JavaCommon::checkJVMArgs(m_selectedInstance->settings().get("JvmArgs").toString(), this);
+ JavaCommon::checkJVMArgs(m_selectedInstance->settings()->get("JvmArgs").toString(), this);
doLaunch(false);
}
}
diff --git a/application/pages/InstanceSettingsPage.cpp b/application/pages/InstanceSettingsPage.cpp
index 4fc812b2..3dc79688 100644
--- a/application/pages/InstanceSettingsPage.cpp
+++ b/application/pages/InstanceSettingsPage.cpp
@@ -14,7 +14,7 @@
InstanceSettingsPage::InstanceSettingsPage(BaseInstance *inst, QWidget *parent)
: QWidget(parent), ui(new Ui::InstanceSettingsPage), m_instance(inst)
{
- m_settings = &(inst->settings());
+ m_settings = inst->settings();
ui->setupUi(this);
loadSettings();
}
diff --git a/application/pages/InstanceSettingsPage.h b/application/pages/InstanceSettingsPage.h
index 55ae69db..f85de678 100644
--- a/application/pages/InstanceSettingsPage.h
+++ b/application/pages/InstanceSettingsPage.h
@@ -69,6 +69,6 @@ private slots:
private:
Ui::InstanceSettingsPage *ui;
BaseInstance *m_instance;
- SettingsObject *m_settings;
+ SettingsObjectPtr m_settings;
QObjectPtr<JavaCommon::TestCheck> checker;
};