4d1ad336 fixed #9754 but caused perf issues by cancelling the gains of having a
timer (introduced after #7138). This introduces in GuiToc::enableView() a
lightweight check of whether the widget should be updated. The logic is inspired
from GuiViewSource::enableView().
}
-void GuiToc::enableView(bool /*enable*/)
+void GuiToc::enableView(bool enable)
{
- widget_->updateViewForce();
+ widget_->checkModelChanged();
+ if (!enable)
+ // In the opposite case, updateView() will be called anyway.
+ widget_->updateViewForce();
}
}
+void TocWidget::checkModelChanged()
+{
+ if (!gui_view_.documentBufferView() ||
+ gui_view_.tocModels().model(current_type_) != tocTV->model())
+ updateViewForce();
+}
+
+
void TocWidget::filterContents()
{
if (!tocTV->model())
///
bool getStatus(Cursor & cur, FuncRequest const & fr, FuncStatus & status)
const;
+ // update the view when the model has changed
+ void checkModelChanged();
public Q_SLOTS:
/// Schedule new update of the display unless already scheduled.