Version: 1.6 (using KDE 3.5.1, Gentoo) Compiler: gcc version 3.3.6 (Gentoo Hardened 3.3.6, ssp-3.3.6-1.0, pie-8.7.8) OS: Linux (i686) release 2.6.14-gentoo-r2 Steps to reproduce: 1. Create a new Konsole window 2. Change the name of the tab to "a&b" (Ctrl-Alt-S) 3. Create a new tab (Ctrl-Alt-N) Expected behaviour: - name of the first tab remains the same Actual behaviour: - name changes to "ab" where the "b" is underlined
This is on KDE 3.5.1. Konsole reports its version is 1.6.
Created attachment 14643 [details] Screenshot This screenshot shows the results of the listed steps, with the problem.
Yea, I'm not sure why this is... the KTabWidget has setNoAccel on it so the & should be ignored. You'll notice that you can switch to that tab using Alt+b.
SVN commit 537524 by hindenburg: Fix issue when there are ampersands in tab title. BUG: 121782 M +9 -3 konsole.cpp --- branches/KDE/3.5/kdebase/konsole/konsole/konsole.cpp #537523:537524 @@ -1364,6 +1364,7 @@ else title = sessions.at(i)->Title(); + title=title.replace('&',"&&"); switch(mode) { case ShowIconAndText: tabwidget->changeTab(page, icon, title); @@ -2198,7 +2199,7 @@ ra->setIcon(icon); if (m_tabViewMode == ShowIconOnly) tabwidget->changeTab( se->widget(), QString::null ); else if (b_matchTabWinTitle) - tabwidget->changeTab( se->widget(), se->fullTitle() ); + tabwidget->changeTab( se->widget(), se->fullTitle().replace('&',"&&")); } void Konsole::initSessionFont(QFont font) { @@ -3127,7 +3128,9 @@ tabwidget->blockSignals(true); tabwidget->removePage(se->widget()); tabwidget->blockSignals(false); - createSessionTab(se->widget(), iconSetForSession(se), se->Title(), position-1); + QString title = se->Title(); + createSessionTab(se->widget(), iconSetForSession(se), + title.replace('&', "&&"), position-1); tabwidget->showPage(se->widget()); tabwidget->setTabColor(se->widget(),oldcolor); @@ -3158,7 +3161,9 @@ tabwidget->blockSignals(true); tabwidget->removePage(se->widget()); tabwidget->blockSignals(false); - createSessionTab(se->widget(), iconSetForSession(se), se->Title(), position+1); + QString title = se->Title(); + createSessionTab(se->widget(), iconSetForSession(se), + title.replace('&', "&&"), position+1); tabwidget->showPage(se->widget()); tabwidget->setTabColor(se->widget(),oldcolor); @@ -3671,6 +3676,7 @@ konsole->attachSession(_se); konsole->activateSession(_se); konsole->changeTabTextColor( _se, se_tabtextcolor.rgb() );//restore prev color + konsole->slotTabSetViewOptions(m_tabViewMode); if (_se==se) { if (se == se_previous)
SVN commit 537528 by hindenburg: Fix issue when there are ampersands in tab title. CCBUG: 121782 M +9 -3 konsole.cpp --- trunk/KDE/kdebase/apps/konsole/konsole/konsole.cpp #537527:537528 @@ -1376,6 +1376,7 @@ else title = sessions.at(i)->Title(); + title=title.replace('&',"&&"); switch(mode) { case ShowIconAndText: tabwidget->setTabIcon( i, icon ); @@ -2148,7 +2149,7 @@ if (m_tabViewMode == ShowIconOnly) tabwidget->setTabText( se_index, QString() ); else if (b_matchTabWinTitle) - tabwidget->setTabText( se_index, se->fullTitle() ); + tabwidget->setTabText( se_index, se->fullTitle().replace('&', "&&") ); } void Konsole::initSessionFont(QFont font) { @@ -3092,7 +3093,9 @@ tabwidget->blockSignals(true); tabwidget->removePage(se->widget()); tabwidget->blockSignals(false); - createSessionTab(se->widget(), iconSetForSession(se), se->Title(), position-1); + QString title = se->Title(); + createSessionTab(se->widget(), iconSetForSession(se), + title.replace('&', "&&"), position-1); tabwidget->showPage(se->widget()); tabwidget->setTabTextColor(tabwidget->indexOf(se->widget()),oldcolor); @@ -3123,7 +3126,9 @@ tabwidget->blockSignals(true); tabwidget->removePage(se->widget()); tabwidget->blockSignals(false); - createSessionTab(se->widget(), iconSetForSession(se), se->Title(), position+1); + QString title = se->Title(); + createSessionTab(se->widget(), iconSetForSession(se), + title.replace('&', "&&"), position+1); tabwidget->showPage(se->widget()); tabwidget->setTabTextColor(tabwidget->indexOf(se->widget()),oldcolor); @@ -3639,6 +3644,7 @@ konsole->attachSession(_se); konsole->activateSession(_se); konsole->changeTabTextColor( _se, se_tabtextcolor.rgb() );//restore prev color + konsole->slotTabSetViewOptions(m_tabViewMode); if (_se==se) { if (se == se_previous)