diff options
author | Petr Mrázek <peterix@gmail.com> | 2018-07-28 22:08:09 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2018-07-28 22:08:09 +0200 |
commit | 12f2716f31e09d18d47ffdbb6c06dfb71c6ec8fb (patch) | |
tree | 28fa09d8cdf4942f2425c695803203f4e2081e44 /application/dialogs/NewInstanceDialog.cpp | |
parent | 4169f53b19372ccb978f6384b8f89e2819e1f00f (diff) | |
download | MultiMC-12f2716f31e09d18d47ffdbb6c06dfb71c6ec8fb.tar MultiMC-12f2716f31e09d18d47ffdbb6c06dfb71c6ec8fb.tar.gz MultiMC-12f2716f31e09d18d47ffdbb6c06dfb71c6ec8fb.tar.lz MultiMC-12f2716f31e09d18d47ffdbb6c06dfb71c6ec8fb.tar.xz MultiMC-12f2716f31e09d18d47ffdbb6c06dfb71c6ec8fb.zip |
GH-2355 Do not allow instances to be created with whitespace prefix or suffix
Diffstat (limited to 'application/dialogs/NewInstanceDialog.cpp')
-rw-r--r-- | application/dialogs/NewInstanceDialog.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/application/dialogs/NewInstanceDialog.cpp b/application/dialogs/NewInstanceDialog.cpp index f1247a50..c68d6537 100644 --- a/application/dialogs/NewInstanceDialog.cpp +++ b/application/dialogs/NewInstanceDialog.cpp @@ -165,15 +165,15 @@ void NewInstanceDialog::updateDialogState() QString NewInstanceDialog::instName() const { - auto result = ui->instNameTextBox->text(); + auto result = ui->instNameTextBox->text().trimmed(); if(result.size()) { - return result.trimmed(); + return result; } - result = ui->instNameTextBox->placeholderText(); + result = ui->instNameTextBox->placeholderText().trimmed(); if(result.size()) { - return result.trimmed(); + return result; } return QString(); } |