aboutsummaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
authorKarol Kosek <krkk@krkk.ct8.pl>2021-01-04 18:18:07 +0100
committerFelix Queißner <felix@ib-queissner.de>2021-01-05 09:30:52 +0100
commit552327296c64003d4f5b5fedcb123e2ceea7aee5 (patch)
tree27773cc5a3e530684c0564f5e20563a4234571c6 /src/mainwindow.cpp
parent5c8f96e7509651b1c06d3eb961aa0500ee0b0a98 (diff)
downloadkristall-552327296c64003d4f5b5fedcb123e2ceea7aee5.tar.gz
MainWindow: escape tab title
Prevents a tab from creating an Alt+Char shortcut if there was an preceding ampersand character in the title.
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index f21047f..f46ed75 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -269,7 +269,9 @@ void MainWindow::on_tab_titleChanged(const QString &title)
if(tab != nullptr) {
int index = this->ui->browser_tabs->indexOf(tab);
assert(index >= 0);
- this->ui->browser_tabs->setTabText(index, title);
+
+ QString escapedTitle = title;
+ this->ui->browser_tabs->setTabText(index, escapedTitle.replace("&", "&&"));
if (tab == this->curTab())
{