Append "-viewmode" to the view mode actions added to the action collection in

order to avoid overwritting an existing action with the same name, e.g. konsolepart.

BUG: 266517
FIXED-IN: 4.8.0
REVIEW: 103590
(cherry picked from commit c0341d4479)
This commit is contained in:
Dawit Alemayehu 2011-12-30 17:49:16 -05:00
parent a381834cae
commit f86eb0531a

View file

@ -4886,7 +4886,10 @@ void KonqMainWindow::updateViewModeActions()
// Create a KToggleAction for this view mode, and plug it into the menu
KToggleAction* action = new KToggleAction(KIcon(service->icon()), serviceText, this);
actionCollection()->addAction(desktopEntryName, action);
// NOTE: "-viewmode" is appended to desktopEntryName to avoid overwritting existing
// action, e.g. konsolepart added through ToggleViewGUIClient in the ctor will be
// overwritten by the view mode konsolepart action added here. #266517.
actionCollection()->addAction(desktopEntryName + QLatin1String("-viewmode"), action);
action->setObjectName(desktopEntryName);
action->setActionGroup(m_viewModesGroup);
m_viewModeMenu->menu()->addAction(action);