Qt: Remove usage of QString where possible for settings

This commit is contained in:
Connor McLaughlin
2020-07-21 19:49:04 +10:00
parent eb7da791ea
commit 68d98af497
31 changed files with 336 additions and 337 deletions

View File

@@ -1,4 +1,5 @@
#include "memorycardsettingswidget.h"
#include "common/string_util.h"
#include "core/controller.h"
#include "core/settings.h"
#include "inputbindingwidgets.h"
@@ -65,15 +66,15 @@ void MemoryCardSettingsWidget::createPortSettingsUi(int index, PortSettingsUI* u
const MemoryCardType default_value = (index == 0) ? MemoryCardType::PerGameTitle : MemoryCardType::None;
SettingWidgetBinder::BindWidgetToEnumSetting(
m_host_interface, ui->memory_card_type, QStringLiteral("MemoryCards"), QStringLiteral("Card%1Type").arg(index + 1),
m_host_interface, ui->memory_card_type, "MemoryCards", StringUtil::StdStringFromFormat("Card%dType", index + 1),
&Settings::ParseMemoryCardTypeName, &Settings::GetMemoryCardTypeName, default_value);
ui->layout->addWidget(new QLabel(tr("Memory Card Type:"), ui->container));
ui->layout->addWidget(ui->memory_card_type);
QHBoxLayout* memory_card_layout = new QHBoxLayout();
ui->memory_card_path = new QLineEdit(ui->container);
SettingWidgetBinder::BindWidgetToStringSetting(m_host_interface, ui->memory_card_path,
QStringLiteral("MemoryCards"), QStringLiteral("Card%1Path").arg(index + 1));
SettingWidgetBinder::BindWidgetToStringSetting(m_host_interface, ui->memory_card_path, "MemoryCards",
StringUtil::StdStringFromFormat("Card%dPath", index + 1));
memory_card_layout->addWidget(ui->memory_card_path);
QPushButton* memory_card_path_browse = new QPushButton(tr("Browse..."), ui->container);