avoid costly updating

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20637 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Edwin Leuven 2007-10-01 13:17:56 +00:00
parent c56fa287b6
commit cdff3df5d1

View File

@ -207,11 +207,19 @@ void IconPalette::hideEvent(QHideEvent * event )
void IconPalette::updateParent()
{
bool enable = false;
// FIXME: so this is commented out for speed considerations
// true fix is to repair the updating mechanism of the toolbar
#if 0
for (int i = 0; i < actions_.size(); ++i)
if (actions_.at(i)->isEnabled()) {
enable = true;
break;
}
#else
// we check only the first action to enable/disable the menu
if (actions_.size() > 0)
enable = actions_.at(0)->isEnabled();
#endif
parentWidget()->setEnabled(enable);
}
@ -256,11 +264,19 @@ void ButtonMenu::add(QAction * action)
void ButtonMenu::updateParent()
{
bool enable = false;
// FIXME: so this is commented out for speed considerations
// true fix is to repair the updating mechanism of the toolbar
#if 0
for (int i = 0; i < actions_.size(); ++i)
if (actions_.at(i)->isEnabled()) {
enable = true;
break;
}
#else
// we check only the first action to enable/disable the menu
if (actions_.size() > 0)
enable = actions_.at(0)->isEnabled();
#endif
parentWidget()->setEnabled(enable);
}