commit 6a662cbb2717f8c11e4b5e77e7d6a6320a0fce85
Author: Guillaume Munch <g...@lyx.org>
Date:   Mon May 30 22:11:00 2016 +0100

    TocModel: clean-up

diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp
index 6bfcdcb..c1c74d5 100644
--- a/src/frontends/qt4/GuiView.cpp
+++ b/src/frontends/qt4/GuiView.cpp
@@ -1664,6 +1664,8 @@ void GuiView::updateTocItem(string const & type, 
DocIterator const & dit)
 
 void GuiView::structureChanged()
 {
+       // FIXME: This is slightly expensive, though less than the tocBackend 
update
+       // (#9880). This also resets the view in the Toc Widget (#6675).
        d.toc_models_.reset(documentBufferView());
        // Navigator needs more than a simple update in this case. It needs to 
be
        // rebuilt.
diff --git a/src/frontends/qt4/TocModel.cpp b/src/frontends/qt4/TocModel.cpp
index 7654983..9fb9481 100644
--- a/src/frontends/qt4/TocModel.cpp
+++ b/src/frontends/qt4/TocModel.cpp
@@ -38,6 +38,8 @@ namespace frontend {
 
 /// A QStandardItemModel that gives access to the reset methods.
 /// This is needed in order to fix http://www.lyx.org/trac/ticket/3740
+// FIXME: Better appropriately subclass QStandardItemModel and implement
+// the toc-specific reset methods there.
 class TocTypeModel : public QStandardItemModel
 {
 public:
@@ -47,27 +49,18 @@ public:
        ///
        void reset()
        {
-#if (QT_VERSION < 0x050000)
-               QStandardItemModel::reset();
-#else
+               QStandardItemModel::beginResetModel();
                QStandardItemModel::endResetModel();
-#endif
        }
        ///
        void beginResetModel()
-       { 
-       #if QT_VERSION >= 0x040600
-               QStandardItemModel::beginResetModel(); 
-       #endif
+       {
+               QStandardItemModel::beginResetModel();
        }
        ///
        void endResetModel()
-       { 
-       #if QT_VERSION >= 0x040600
-               QStandardItemModel::endResetModel(); 
-       #else
-               QStandardItemModel::reset();
-       #endif
+       {
+               QStandardItemModel::endResetModel();
        }
 };
 
diff --git a/src/frontends/qt4/TocModel.h b/src/frontends/qt4/TocModel.h
index c959aba..f0f9efa 100644
--- a/src/frontends/qt4/TocModel.h
+++ b/src/frontends/qt4/TocModel.h
@@ -136,10 +136,6 @@ public:
        TocItem const currentItem(QString const & type,
                QModelIndex const & index) const;
 
-Q_SIGNALS:
-       /// Signal that the internal toc_models_ has been reset.
-       void modelReset();
-
 private:
        typedef QHash<QString, TocModel *>::const_iterator const_iterator;
        typedef QHash<QString, TocModel *>::iterator iterator;

Reply via email to