Update pluginmenu.cpp
note this change omits adding menu for plugins w/o commands
This commit is contained in:
parent
06f34d4fc5
commit
50a4ff6f3e
|
|
@ -42,9 +42,8 @@ void PlugInMenu_Add( QMenu* plugin_menu, IPlugIn* pPlugIn ){
|
|||
MenuStack menuStack;
|
||||
|
||||
std::size_t nCount = pPlugIn->getCommandCount();
|
||||
{
|
||||
globalErrorStream() << pPlugIn->getMenuName() << " count: " << nCount << "\n";
|
||||
if (nCount > 1) {
|
||||
|
||||
if ( nCount > 1 ) { // create submenu
|
||||
menu = plugin_menu->addMenu( pPlugIn->getMenuName() );
|
||||
|
||||
menu->setTearOffEnabled( g_Layout_enableDetachableMenus.m_value );
|
||||
|
|
@ -89,15 +88,14 @@ void PlugInMenu_Add( QMenu* plugin_menu, IPlugIn* pPlugIn ){
|
|||
if ( !menuStack.empty() ) {
|
||||
globalErrorStream() << pPlugIn->getMenuName() << " mismatched > <. " << menuStack.size() << " submenu(s) not closed.\n";
|
||||
}
|
||||
} else if (nCount == 1) {
|
||||
}
|
||||
else if ( nCount == 1 ) { // add only command directly
|
||||
menuText = pPlugIn->getCommandTitle( --nCount );
|
||||
|
||||
if ( menuText != 0 && strlen( menuText ) > 0 ) {
|
||||
create_menu_item_with_mnemonic( plugin_menu, menuText, pPlugIn->getGlobalCommand( nCount ) );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
QMenu* g_plugins_menu = 0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user