]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/TocModel.cpp
Make a string translatable
[lyx.git] / src / frontends / qt4 / TocModel.cpp
index e40d99c9cb80d3a91b60106ee7197b295004dce9..0733c1f6416b82548568c549d2ea189ce0682a54 100644 (file)
@@ -351,20 +351,19 @@ void TocModels::reset(BufferView const * bv)
        names_->blockSignals(true);
        names_->beginResetModel();
        names_->insertColumns(0, 1);
-       TocList const & tocs = bv->buffer().masterBuffer()->tocBackend().tocs();
-       TocList::const_iterator it = tocs.begin();
-       TocList::const_iterator toc_end = tocs.end();
-       for (; it != toc_end; ++it) {
-               QString const type = toqstr(it->first);
+       // In the outliner, add Tocs from the master document
+       TocBackend const & backend = bv->buffer().masterBuffer()->tocBackend();
+       for (pair<string, shared_ptr<Toc>> const & toc : backend.tocs()) {
+               QString const type = toqstr(toc.first);
 
                // First, fill in the toc models.
                iterator mod_it = models_.find(type);
                if (mod_it == models_.end())
                        mod_it = models_.insert(type, new TocModel(this));
-               mod_it.value()->reset(it->second);
+               mod_it.value()->reset(toc.second);
 
                // Fill in the names_ model.
-               QString const gui_name = guiName(it->first, bv->buffer().params());
+               QString const gui_name = toqstr(backend.outlinerName(toc.first));
                int const current_row = names_->rowCount();
                names_->insertRows(current_row, 1);
                QModelIndex const index = names_->index(current_row, 0);