diff options
| author | Mai M <mathew1800@gmail.com> | 2021-08-13 13:21:07 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-08-13 13:21:07 -0400 |
| commit | e2ccad7f9510a7db3408b2dbaaa4873ad7aef57e (patch) | |
| tree | cc4112acf5531cff34fb8708a1822367420a0dae /Source/Core/DolphinQt/Config/CheatCodeEditor.cpp | |
| parent | c43f451da8bb02ff31741a1359079047e8fb90cf (diff) | |
| parent | 7eabd9e8308b54be04044759ddc7612d23c61884 (diff) | |
Merge pull request #10017 from JosJuice/qt-gecko-notes-lf
DolphinQt: Don't add trailing newline to Gecko notes
Diffstat (limited to 'Source/Core/DolphinQt/Config/CheatCodeEditor.cpp')
| -rw-r--r-- | Source/Core/DolphinQt/Config/CheatCodeEditor.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/Source/Core/DolphinQt/Config/CheatCodeEditor.cpp b/Source/Core/DolphinQt/Config/CheatCodeEditor.cpp index 37bf50df95..de47f227c1 100644 --- a/Source/Core/DolphinQt/Config/CheatCodeEditor.cpp +++ b/Source/Core/DolphinQt/Config/CheatCodeEditor.cpp @@ -11,6 +11,8 @@ #include <QStringList> #include <QTextEdit> +#include "Common/StringUtil.h" + #include "Core/ARDecrypt.h" #include "Core/ActionReplay.h" #include "Core/GeckoCodeConfig.h" @@ -277,22 +279,16 @@ bool CheatCodeEditor::AcceptGecko() if (entries.empty()) { - ModalMessageBox::critical(this, tr("Error"), - tr("The resulting decrypted AR code doesn't contain any lines.")); + ModalMessageBox::critical(this, tr("Error"), tr("This Gecko code doesn't contain any lines.")); return false; } m_gecko_code->name = m_name_edit->text().toStdString(); m_gecko_code->creator = m_creator_edit->text().toStdString(); m_gecko_code->codes = std::move(entries); + m_gecko_code->notes = SplitString(m_notes_edit->toPlainText().toStdString(), '\n'); m_gecko_code->user_defined = true; - std::vector<std::string> note_lines; - for (const QString& line : m_notes_edit->toPlainText().split(QLatin1Char{'\n'})) - note_lines.push_back(line.toStdString()); - - m_gecko_code->notes = std::move(note_lines); - return true; } |
