summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinQt2/Config/Mapping/MappingWindow.cpp
diff options
context:
space:
mode:
authorMichael Maltese <mchtly@gmail.com>2017-05-31 00:17:39 -0700
committerMichael Maltese <mchtly@gmail.com>2017-06-05 16:46:10 -0700
commit548522877a36a696fad4868605625bb714b4c5b6 (patch)
treeef99749401ca9e10b5b9bb82c2291aad6d937269 /Source/Core/DolphinQt2/Config/Mapping/MappingWindow.cpp
parent95ef785b1f181e3bbbc359d2bb20890bba8a1d60 (diff)
DolphinQt2: make Settings a singleton
With this, we can get signals when properties change.
Diffstat (limited to 'Source/Core/DolphinQt2/Config/Mapping/MappingWindow.cpp')
-rw-r--r--Source/Core/DolphinQt2/Config/Mapping/MappingWindow.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/Source/Core/DolphinQt2/Config/Mapping/MappingWindow.cpp b/Source/Core/DolphinQt2/Config/Mapping/MappingWindow.cpp
index 7b24f1c678..04e20485b2 100644
--- a/Source/Core/DolphinQt2/Config/Mapping/MappingWindow.cpp
+++ b/Source/Core/DolphinQt2/Config/Mapping/MappingWindow.cpp
@@ -126,8 +126,9 @@ void MappingWindow::ConnectWidgets()
void MappingWindow::OnDeleteProfilePressed()
{
+ auto& settings = Settings::Instance();
const QString profile_name = m_profiles_combo->currentText();
- if (!Settings().GetProfiles(m_config).contains(profile_name))
+ if (!settings.GetProfiles(m_config).contains(profile_name))
{
QMessageBox error;
error.setIcon(QMessageBox::Critical);
@@ -153,7 +154,7 @@ void MappingWindow::OnDeleteProfilePressed()
QMessageBox result(this);
- std::string profile_path = Settings().GetProfileINIPath(m_config, profile_name).toStdString();
+ std::string profile_path = settings.GetProfileINIPath(m_config, profile_name).toStdString();
File::CreateFullPath(profile_path);
@@ -170,7 +171,8 @@ void MappingWindow::OnLoadProfilePressed()
if (profile_name.isEmpty())
return;
- std::string profile_path = Settings().GetProfileINIPath(m_config, profile_name).toStdString();
+ std::string profile_path =
+ Settings::Instance().GetProfileINIPath(m_config, profile_name).toStdString();
File::CreateFullPath(profile_path);
@@ -192,7 +194,8 @@ void MappingWindow::OnSaveProfilePressed()
if (profile_name.isEmpty())
return;
- std::string profile_path = Settings().GetProfileINIPath(m_config, profile_name).toStdString();
+ std::string profile_path =
+ Settings::Instance().GetProfileINIPath(m_config, profile_name).toStdString();
File::CreateFullPath(profile_path);
@@ -297,7 +300,7 @@ void MappingWindow::ChangeMappingType(MappingWindow::Type type)
m_controller = m_config->GetController(GetPort());
m_profiles_combo->addItem(QStringLiteral(""));
- for (const auto& item : Settings().GetProfiles(m_config))
+ for (const auto& item : Settings::Instance().GetProfiles(m_config))
m_profiles_combo->addItem(item);
}