From 39baf5e10c0f26771a1737c9cd77528a5034f561 Mon Sep 17 00:00:00 2001 From: san Date: Thu, 4 Aug 2011 06:35:21 +0000 Subject: [PATCH] Bug fix: For menus priority take into account permanently visible actions. Now menus with such action have permanent priority also. --- src/Qtx/QtxMenu.cxx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Qtx/QtxMenu.cxx b/src/Qtx/QtxMenu.cxx index a5adf5a22..d8804ee43 100644 --- a/src/Qtx/QtxMenu.cxx +++ b/src/Qtx/QtxMenu.cxx @@ -961,11 +961,16 @@ int QtxMenu::actionPriority( QAction* a ) if ( _actionPriority.contains( a ) ) p = _actionPriority[a]; - if ( p >= 0 && a->menu() ) + if ( a->menu() ) { QList lst = a->menu()->actions(); - for ( QList::iterator it = lst.begin(); it != lst.end(); ++it ) - p = qMax( p, _actionPriority.contains( *it ) ? _actionPriority[*it] : 0 ); + for ( QList::iterator it = lst.begin(); it != lst.end() && p >= 0; ++it ) { + int ap = _actionPriority.contains( *it ) ? _actionPriority[*it] : 0; + if ( ap < 0 ) + p = ap; + else + p = qMax( p, ap ); + } } return p; } -- 2.39.2