Bug 94002

Summary: & in directory-name is displayed as shortcut in RMB-menu > Copy to...
Product: [Applications] konqueror Reporter: S. Burmeister <sven.burmeister>
Component: kuickAssignee: Will Stephenson <wstephenson>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:

Description S. Burmeister 2004-11-26 22:04:18 UTC
Version:            (using KDE KDE 3.3.1)
Installed from:    SuSE RPMs
OS:                Linux

Create a directory with a & in it, e.g. "R&B - Soul". Click on some file in konqueror and use the Copy To... to see the created directory in the list. Notice that it display "RB - Soul" with the B underlined and marked as shortcut.
Comment 1 Pascal Létourneau 2004-11-27 20:08:38 UTC
CVS commit by pletourn: 

Escape '&'
BUG: 94002


  M +2 -1      kdirmenu.cpp   1.21.2.2
  M +2 -1      kmetamenu.cpp   1.24.2.1


--- kdeaddons/konq-plugins/kuick/kdirmenu.cpp  #1.21.2.1:1.21.2.2
@@ -59,5 +59,6 @@ KDirMenu::~KDirMenu( ) {
 void KDirMenu::insert( KDirMenu *submenu, const QString &_path ) {
     static const QIconSet folder = SmallIconSet("folder");
-    insertItem ( folder , _path,  submenu  );
+    QString escapedPath = _path;
+    insertItem( folder, escapedPath.replace( "&", "&&" ), submenu );
     children.append( submenu );
     connect(submenu, SIGNAL(fileChosen(const QString &)),

--- kdeaddons/konq-plugins/kuick/kmetamenu.cpp  #1.24:1.24.2.1
@@ -118,5 +118,6 @@ KMetaMenu::KMetaMenu( QWidget *parent, c
              continue;
          }
-         KAction *action = new KAction(*it, 0, this, SLOT(slotFastPath() ), this );
+         QString escapedDir = *it;
+         KAction *action = new KAction(escapedDir.replace("&", "&&"), 0, this, SLOT(slotFastPath()), this);
          action->plug(this );
          actions.append( action );