Merge lp:~osomon/unity-2d/escapeAmpersandsPartII into lp:unity-2d/3.0

Proposed by Olivier Tilloy
Status: Merged
Approved by: Ugo Riboni
Approved revision: 440
Merged at revision: 441
Proposed branch: lp:~osomon/unity-2d/escapeAmpersandsPartII
Merge into: lp:unity-2d/3.0
Diff against target: 15 lines (+4/-1)
1 file modified
launcher/UnityApplications/placeentry.cpp (+4/-1)
To merge this branch: bzr merge lp:~osomon/unity-2d/escapeAmpersandsPartII
Reviewer Review Type Date Requested Status
Ugo Riboni (community) Approve
Review via email: mp+52989@code.launchpad.net

Commit message

[launcher] Escape ampersands in place entry section names so that they are not considered as keyboard accelerators.

To post a comment you must log in.
Revision history for this message
Ugo Riboni (uriboni) wrote :

Works and code is ok. Good fix

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'launcher/UnityApplications/placeentry.cpp'
2--- launcher/UnityApplications/placeentry.cpp 2011-03-10 11:01:04 +0000
3+++ launcher/UnityApplications/placeentry.cpp 2011-03-11 10:10:31 +0000
4@@ -797,7 +797,10 @@
5
6 for (int i = 0; i < m_sections->rowCount(); ++i) {
7 QAction* section = new QAction(m_menu);
8- section->setText(m_sections->data(m_sections->index(i)).toString());
9+ QString sectionName = m_sections->data(m_sections->index(i)).toString();
10+ /* Escape ampersands so that they are not considered as keyboard accelerators. */
11+ sectionName.replace("&", "&&");
12+ section->setText(sectionName);
13 section->setProperty(SECTION_PROPERTY, QVariant(i));
14 m_menu->addAction(section);
15 QObject::connect(section, SIGNAL(triggered()), this, SLOT(onSectionTriggered()));

Subscribers

People subscribed via source and target branches