diff options
| author | Mai <mai.iam2048@gmail.com> | 2024-01-21 10:22:46 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-21 10:22:46 -0500 |
| commit | d64705d691ca5360c7f377b6a64751fc418e1724 (patch) | |
| tree | e98c705d5634d56bae3824ece456413b697a2f1b /Source/Core | |
| parent | 29f6baac8fd6b07dc502e6fdb3e7512c6c749fb1 (diff) | |
| parent | 6276232574c2ef281c953e2f5499da9e1c53ca60 (diff) | |
Merge pull request #12512 from JosJuice/assembler-dirty-flag
DolphinQt: Rework dirty flag handling in AssemblerWidget::TabTextForEditor
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/DolphinQt/Debugger/AssemblerWidget.cpp | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/Source/Core/DolphinQt/Debugger/AssemblerWidget.cpp b/Source/Core/DolphinQt/Debugger/AssemblerWidget.cpp index a8d2dc96f3..f8cb60deb6 100644 --- a/Source/Core/DolphinQt/Debugger/AssemblerWidget.cpp +++ b/Source/Core/DolphinQt/Debugger/AssemblerWidget.cpp @@ -698,21 +698,23 @@ void AssemblerWidget::OnTabChange(int index) QString AssemblerWidget::TabTextForEditor(AsmEditor* editor, bool with_dirty) { ASSERT(editor != nullptr); - QString dirtyFlag = QStringLiteral(); - if (editor->IsDirty() && with_dirty) - { - dirtyFlag = QStringLiteral(" *"); - } - if (editor->Path().isEmpty()) + QString result; + if (!editor->Path().isEmpty()) + result = editor->EditorTitle(); + else if (editor->EditorNum() == 0) + result = tr("New File"); + else + result = tr("New File (%1)").arg(editor->EditorNum() + 1); + + if (with_dirty && editor->IsDirty()) { - if (editor->EditorNum() == 0) - { - return tr("New File%1").arg(dirtyFlag); - } - return tr("New File (%1)%2").arg(editor->EditorNum() + 1).arg(dirtyFlag); + // i18n: This asterisk is added to the title of an editor to indicate that it has unsaved + // changes + result = tr("%1 *").arg(result); } - return tr("%1%2").arg(editor->EditorTitle()).arg(dirtyFlag); + + return result; } AsmEditor* AssemblerWidget::GetEditor(int idx) |
