diff options
| author | 2016-09-18 09:38:01 +0900 | |
|---|---|---|
| committer | 2016-09-18 09:38:01 +0900 | |
| commit | dc8479928c5aee4c6ad6fe4f59006fb604cee701 (patch) | |
| tree | 569a7f13128450bbab973236615587ff00bced5f /src/citra_qt/configure_system.cpp | |
| parent | Travis: Import Dolphin’s clang-format hook. (diff) | |
| download | yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.gz yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.xz yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.zip | |
Sources: Run clang-format on everything.
Diffstat (limited to '')
| -rw-r--r-- | src/citra_qt/configure_system.cpp | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/src/citra_qt/configure_system.cpp b/src/citra_qt/configure_system.cpp index 5c5d83ff3..d89b342df 100644 --- a/src/citra_qt/configure_system.cpp +++ b/src/citra_qt/configure_system.cpp | |||
| @@ -6,19 +6,16 @@ | |||
| 6 | #include "citra_qt/ui_settings.h" | 6 | #include "citra_qt/ui_settings.h" |
| 7 | #include "ui_configure_system.h" | 7 | #include "ui_configure_system.h" |
| 8 | 8 | ||
| 9 | #include "core/hle/service/fs/archive.h" | ||
| 10 | #include "core/hle/service/cfg/cfg.h" | 9 | #include "core/hle/service/cfg/cfg.h" |
| 10 | #include "core/hle/service/fs/archive.h" | ||
| 11 | #include "core/system.h" | 11 | #include "core/system.h" |
| 12 | 12 | ||
| 13 | static const std::array<int, 12> days_in_month = {{ | 13 | static const std::array<int, 12> days_in_month = {{31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}}; |
| 14 | 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 | ||
| 15 | }}; | ||
| 16 | 14 | ||
| 17 | ConfigureSystem::ConfigureSystem(QWidget *parent) : | 15 | ConfigureSystem::ConfigureSystem(QWidget* parent) : QWidget(parent), ui(new Ui::ConfigureSystem) { |
| 18 | QWidget(parent), | ||
| 19 | ui(new Ui::ConfigureSystem) { | ||
| 20 | ui->setupUi(this); | 16 | ui->setupUi(this); |
| 21 | connect(ui->combo_birthmonth, SIGNAL(currentIndexChanged(int)), SLOT(updateBirthdayComboBox(int))); | 17 | connect(ui->combo_birthmonth, SIGNAL(currentIndexChanged(int)), |
| 18 | SLOT(updateBirthdayComboBox(int))); | ||
| 22 | 19 | ||
| 23 | this->setConfiguration(); | 20 | this->setConfiguration(); |
| 24 | } | 21 | } |
| @@ -54,13 +51,17 @@ void ConfigureSystem::setConfiguration() { | |||
| 54 | void ConfigureSystem::ReadSystemSettings() { | 51 | void ConfigureSystem::ReadSystemSettings() { |
| 55 | // set username | 52 | // set username |
| 56 | username = Service::CFG::GetUsername(); | 53 | username = Service::CFG::GetUsername(); |
| 57 | // ui->edit_username->setText(QString::fromStdU16String(username)); // TODO(wwylele): Use this when we move to Qt 5.5 | 54 | // ui->edit_username->setText(QString::fromStdU16String(username)); // TODO(wwylele): Use this |
| 58 | ui->edit_username->setText(QString::fromUtf16(reinterpret_cast<const ushort*>(username.data()))); | 55 | // when we move to Qt 5.5 |
| 56 | ui->edit_username->setText( | ||
| 57 | QString::fromUtf16(reinterpret_cast<const ushort*>(username.data()))); | ||
| 59 | 58 | ||
| 60 | // set birthday | 59 | // set birthday |
| 61 | std::tie(birthmonth, birthday) = Service::CFG::GetBirthday(); | 60 | std::tie(birthmonth, birthday) = Service::CFG::GetBirthday(); |
| 62 | ui->combo_birthmonth->setCurrentIndex(birthmonth - 1); | 61 | ui->combo_birthmonth->setCurrentIndex(birthmonth - 1); |
| 63 | updateBirthdayComboBox(birthmonth - 1); // explicitly update it because the signal from setCurrentIndex is not reliable | 62 | updateBirthdayComboBox( |
| 63 | birthmonth - | ||
| 64 | 1); // explicitly update it because the signal from setCurrentIndex is not reliable | ||
| 64 | ui->combo_birthday->setCurrentIndex(birthday - 1); | 65 | ui->combo_birthday->setCurrentIndex(birthday - 1); |
| 65 | 66 | ||
| 66 | // set system language | 67 | // set system language |
| @@ -79,8 +80,10 @@ void ConfigureSystem::applyConfiguration() { | |||
| 79 | bool modified = false; | 80 | bool modified = false; |
| 80 | 81 | ||
| 81 | // apply username | 82 | // apply username |
| 82 | // std::u16string new_username = ui->edit_username->text().toStdU16String(); // TODO(wwylele): Use this when we move to Qt 5.5 | 83 | // std::u16string new_username = ui->edit_username->text().toStdU16String(); // TODO(wwylele): |
| 83 | std::u16string new_username(reinterpret_cast<const char16_t*>(ui->edit_username->text().utf16())); | 84 | // Use this when we move to Qt 5.5 |
| 85 | std::u16string new_username( | ||
| 86 | reinterpret_cast<const char16_t*>(ui->edit_username->text().utf16())); | ||
| 84 | if (new_username != username) { | 87 | if (new_username != username) { |
| 85 | Service::CFG::SetUsername(new_username); | 88 | Service::CFG::SetUsername(new_username); |
| 86 | modified = true; | 89 | modified = true; |