]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiToc.cpp
Some improvements to the graphics dialog
[lyx.git] / src / frontends / qt4 / GuiToc.cpp
index f603c567166a2ef4e5ed6ebebaf83ff2c3563fc9..e124a468b428c48cf161d2341fa84c5633d973f2 100644 (file)
@@ -33,24 +33,18 @@ namespace lyx {
 namespace frontend {
 
 GuiToc::GuiToc(GuiView & parent, Qt::DockWidgetArea area, Qt::WindowFlags flags)
-       : DockView(parent, "toc", qt_("Outline"), area, flags), is_closing_(false)
+       : DockView(parent, "toc", qt_("Outline"), area, flags),
+         widget_(new TocWidget(parent, this)),
+         is_closing_(false)
 {
-       widget_ = new TocWidget(parent, this);
        setWidget(widget_);
        setFocusProxy(widget_);
 }
 
 
-GuiToc::~GuiToc()
-{
-       delete widget_;
-}
-
-
 void GuiToc::updateView()
 {
        widget_->updateView();
-       return;
 }
 
 
@@ -66,9 +60,11 @@ void GuiToc::dispatchParams()
 }
 
 
-void GuiToc::enableView(bool /*enable*/)
+void GuiToc::enableView(bool enable)
 {
-       widget_->updateViewForce();
+       if (!enable)
+               // In the opposite case, updateView() will be called anyway.
+               widget_->updateViewNow();
 }