Summary: | '&' not shown in "copy to"/"move to" menus | ||
---|---|---|---|
Product: | [Applications] dolphin | Reporter: | Luca Zorzi <luca> |
Component: | general | Assignee: | Peter Penz <peter.penz19> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | faure, frank78ac |
Priority: | NOR | ||
Version: | 16.12.2 | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Luca Zorzi
2009-03-08 20:08:13 UTC
Thanks for the bug report! The problem is very similar to the tab title bug (bug 181765): a '&' in the title of a sub menu is misinterpreted as an indicator that the following letter should be a keyboard shortcut. An approach which is similar to the fix for the other bug fixes it for me, see below. I'll CC David because he wrote the code for the "Copy To"/"Move To" menus. Index: konq/konq_copytomenu.cpp =================================================================== --- konq/konq_copytomenu.cpp (revision 936942) +++ konq/konq_copytomenu.cpp (working copy) @@ -204,7 +204,15 @@ void KonqCopyToDirectoryMenu::slotAboutT subPath.append('/'); subPath += subDir; KonqCopyToDirectoryMenu* subMenu = new KonqCopyToDirectoryMenu(this, m_mainMenu, subPath); - subMenu->setTitle(subDir); + if (subDir.indexOf('&') == -1) + subMenu->setTitle(subDir); + else { + // Make sure that a '&' inside the directory name is displayed correctly + // and not misinterpreted as a keyboard shortcut + QString menuTitle = subDir; + menuTitle.replace('&', "&&"); + subMenu->setTitle(menuTitle); + } const QString iconName = dirMime->iconName(KUrl(subPath)); subMenu->setIcon(KIcon(iconName)); if (QFileInfo(subPath).isSymLink()) { // I hope this isn't too slow... I think this could be written in one line with subMenu->setTitle(menuTitle.replace('&',"&&")); No need for if+indexOf (which ends up making the code search for '&' twice). SVN commit 937892 by freininghaus: Display folder names containing '&' correctly in the "Copy To"/"Move To" menus. BUG: 186580 M +4 -1 konq_copytomenu.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=937892 SVN commit 937903 by freininghaus: Display folder names containing '&' correctly in the "Copy To"/"Move To" menus. This fix will be in KDE 4.2.2. CCBUG: 186580 M +4 -1 konq_copytomenu.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=937903 |