diff options
author | Eike Ziller <eike.ziller@qt.io> | 2019-08-12 17:04:12 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2019-08-12 17:04:12 +0200 |
commit | 21c2bf7e72b6c48ac2ce013001f5bbdc118b1375 (patch) | |
tree | 01c9a4ffb658c2cf3fac721508ddc809cfb8aae6 /src/plugins/help | |
parent | a90b1c26b1d9f7b76dad51e5ec5f2c15f8816ad6 (diff) | |
parent | 821f799ff3d017e9cdc8bfe3c96fed1982de8753 (diff) |
Merge remote-tracking branch 'origin/4.10'
Conflicts:
src/plugins/python/CMakeLists.txt
Change-Id: I18808710dd99b97d4e1e7c3d223b7f814083de31
Diffstat (limited to 'src/plugins/help')
-rw-r--r-- | src/plugins/help/openpagesmodel.cpp | 3 | ||||
-rw-r--r-- | src/plugins/help/openpageswidget.cpp | 8 |
2 files changed, 5 insertions, 6 deletions
diff --git a/src/plugins/help/openpagesmodel.cpp b/src/plugins/help/openpagesmodel.cpp index d00600737e..3587acfc09 100644 --- a/src/plugins/help/openpagesmodel.cpp +++ b/src/plugins/help/openpagesmodel.cpp @@ -56,8 +56,7 @@ QVariant OpenPagesModel::data(const QModelIndex &index, int role) const case Qt::ToolTipRole: return m_pages.at(index.row())->source().toString(); case Qt::DisplayRole: { - QString title = m_pages.at(index.row())->title(); - title.replace('&', "&&"); + const QString title = m_pages.at(index.row())->title(); return title.isEmpty() ? tr("(Untitled)") : title; } default: diff --git a/src/plugins/help/openpageswidget.cpp b/src/plugins/help/openpageswidget.cpp index a6d98bbb70..55b55353f2 100644 --- a/src/plugins/help/openpageswidget.cpp +++ b/src/plugins/help/openpageswidget.cpp @@ -29,6 +29,7 @@ #include "openpagesmodel.h" #include <coreplugin/coreconstants.h> +#include <utils/stringutils.h> #include <QAbstractItemModel> #include <QApplication> @@ -86,10 +87,9 @@ void OpenPagesWidget::contextMenuRequested(QPoint pos) if (index.column() == 1) index = index.sibling(index.row(), 0); QMenu contextMenu; - QAction *closeEditor = contextMenu.addAction(tr("Close %1").arg(index.data() - .toString())); - QAction *closeOtherEditors = contextMenu.addAction(tr("Close All Except %1") - .arg(index.data().toString())); + const QString displayString = Utils::quoteAmpersands(index.data().toString()); + QAction *closeEditor = contextMenu.addAction(tr("Close %1").arg(displayString)); + QAction *closeOtherEditors = contextMenu.addAction(tr("Close All Except %1").arg(displayString)); if (model()->rowCount() == 1) { closeEditor->setEnabled(false); |