From 552327296c64003d4f5b5fedcb123e2ceea7aee5 Mon Sep 17 00:00:00 2001 From: Karol Kosek Date: Mon, 4 Jan 2021 18:18:07 +0100 Subject: MainWindow: escape tab title Prevents a tab from creating an Alt+Char shortcut if there was an preceding ampersand character in the title. --- src/mainwindow.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') 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()) { -- cgit v1.2.3