commit 4ed8caaf1c9998800f94e3f111cd73b355c2315a
Author: Juergen Spitzmueller <[email protected]>
Date:   Sat May 9 15:30:10 2015 +0200

    Split different indices in the outliner
    
    Fixes: #7012.

diff --git a/src/frontends/qt4/qt_helpers.cpp b/src/frontends/qt4/qt_helpers.cpp
index bf869a3..eb495f5 100644
--- a/src/frontends/qt4/qt_helpers.cpp
+++ b/src/frontends/qt4/qt_helpers.cpp
@@ -21,6 +21,7 @@
 
 #include "BufferParams.h"
 #include "FloatList.h"
+#include "IndicesList.h"
 #include "Language.h"
 #include "Length.h"
 #include "TextClass.h"
@@ -618,6 +619,15 @@ QString guiName(string const & type, BufferParams const & 
bp)
                return qt_("Branches");
        if (type == "change")
                return qt_("Changes");
+       if (prefixIs(type, "index:")) {
+               string const itype = split(type, ':');
+               IndicesList const & indiceslist = bp.indiceslist();
+               Index const * index = 
indiceslist.findShortcut(from_utf8(itype));
+               docstring indextype = _("unknown type!");
+               if (index)
+                       indextype = index->index();
+               return toqstr(bformat(_("Index Entries (%1$s)"), indextype));
+       }
 
        FloatList const & floats = bp.documentClass().floats();
        if (floats.typeExist(type))
diff --git a/src/insets/InsetIndex.cpp b/src/insets/InsetIndex.cpp
index a2539b0..9c722f9 100644
--- a/src/insets/InsetIndex.cpp
+++ b/src/insets/InsetIndex.cpp
@@ -353,8 +353,11 @@ void InsetIndex::addToToc(DocIterator const & cpit, bool 
output_active) const
        DocIterator pit = cpit;
        pit.push_back(CursorSlice(const_cast<InsetIndex &>(*this)));
        docstring str;
+       string type = "index";
+       if (buffer().masterBuffer()->params().use_indices)
+               type += ":" + to_utf8(params_.index);
        text().forOutliner(str, 0);
-       buffer().tocBackend().toc("index").push_back(TocItem(pit, 0, str, 
output_active));
+       buffer().tocBackend().toc(type).push_back(TocItem(pit, 0, str, 
output_active));
        // Proceed with the rest of the inset.
        InsetCollapsable::addToToc(cpit, output_active);
 }

Reply via email to