chiark / gitweb /
doxygen: don't show dirs with / at the end in search.
authorVladimír Vondruš <mosra@centrum.cz>
Sat, 3 Feb 2018 09:48:49 +0000 (10:48 +0100)
committerVladimír Vondruš <mosra@centrum.cz>
Sat, 3 Feb 2018 10:00:05 +0000 (11:00 +0100)
Not needed since we have the type labels now.

doxygen/dox2html5.py
doxygen/test/test_search.py

index 5e3ef581300c12aac63e97ef7ecec7c70c8825bb..d86ae66f1bb9dc9dbaa44efe6569405c6ff61d42 100755 (executable)
@@ -1547,8 +1547,6 @@ def _build_search_data(state: State, prefix, id: str, trie: Trie, map: ResultMap
 
     # Add current item name to prefix list
     prefixed_name = prefix + [compound.leaf_name]
-    prefixed_result_name = prefix + [compound.leaf_name]
-    suffix_length = 0
 
     if compound.kind == 'namespace':
         kind = ResultFlag.NAMESPACE
@@ -1578,14 +1576,9 @@ def _build_search_data(state: State, prefix, id: str, trie: Trie, map: ResultMap
         result_joiner = ' » '
     else: assert False # pragma: no cover
 
-    # Show dirs with / at the end
-    if compound.kind == 'dir':
-        prefixed_result_name += ['']
-        suffix_length = 1
-
     # If just a leaf name, add it once
     if not joiner:
-        result_name = result_joiner.join(prefixed_result_name)
+        result_name = result_joiner.join(prefixed_name)
 
         # TODO: escape elsewhere so i don't have to unescape here
         index = map.add(html.unescape(result_name), compound.url, flags=kind)
@@ -1594,7 +1587,7 @@ def _build_search_data(state: State, prefix, id: str, trie: Trie, map: ResultMap
     # Otherwise add it multiple times with all possible prefixes
     else:
         # TODO: escape elsewhere so i don't have to unescape here
-        index = map.add(html.unescape(result_joiner.join(prefixed_result_name)), compound.url, suffix_length=suffix_length, flags=kind)
+        index = map.add(html.unescape(result_joiner.join(prefixed_name)), compound.url, flags=kind)
         for i in range(len(prefixed_name)):
             lookahead_barriers = []
             name = ''
index ad83dde395baba812e880c79b7dd64355308db90..2441ab23aa0fa6b84df394819b2991fc1a94af3c 100755 (executable)
@@ -407,7 +407,7 @@ macro [17]
 4: Namespace::Union [type=UNION] -> unionNamespace_1_1Union.html
 5: A page [type=PAGE] -> page.html
 6: A page » Subpage [type=PAGE] -> subpage.html
-7: Dir/ [suffix_length=1, type=DIR] -> dir_da5033def2d0db76e9883b31b76b3d0c.html
+7: Dir [type=DIR] -> dir_da5033def2d0db76e9883b31b76b3d0c.html
 8: Dir/File.h [type=FILE] -> File_8h.html
 9: Namespace::Class::foo() [type=FUNC] -> classNamespace_1_1Class.html#aaeba4096356215868370d6ea476bf5d9
 10: Namespace::Class::foo() const [suffix_length=6, type=FUNC] -> classNamespace_1_1Class.html#ac03c5b93907dda16763eabd26b25500a