mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Get rid of intermediate_nodes as it seems to not be the right approach
Finding the right approach will require some careful thought/discussion
This commit is contained in:
parent
e4f934b8b9
commit
e9a1bc0e55
@ -404,7 +404,6 @@ class TagsModel(QAbstractItemModel): # {{{
|
|||||||
sort_by = config['sort_tags_by']
|
sort_by = config['sort_tags_by']
|
||||||
|
|
||||||
eval_formatter = EvalFormatter()
|
eval_formatter = EvalFormatter()
|
||||||
intermediate_nodes = {}
|
|
||||||
|
|
||||||
if data is None:
|
if data is None:
|
||||||
print ('_create_node_tree: no data!')
|
print ('_create_node_tree: no data!')
|
||||||
@ -584,23 +583,19 @@ class TagsModel(QAbstractItemModel): # {{{
|
|||||||
else:
|
else:
|
||||||
if i < len(components)-1:
|
if i < len(components)-1:
|
||||||
original_name = '.'.join(components[:i+1])
|
original_name = '.'.join(components[:i+1])
|
||||||
t = intermediate_nodes.get((original_name, tag.category), None)
|
t = copy.copy(tag)
|
||||||
if t is None:
|
t.original_name = original_name
|
||||||
t = copy.copy(tag)
|
t.count = 0
|
||||||
t.original_name = original_name
|
if key != 'search':
|
||||||
t.count = 0
|
# This 'manufactured' intermediate node can
|
||||||
if key != 'search':
|
# be searched, but cannot be edited.
|
||||||
# This 'manufactured' intermediate node can
|
t.is_editable = False
|
||||||
# be searched, but cannot be edited.
|
else:
|
||||||
t.is_editable = False
|
t.is_searchable = t.is_editable = False
|
||||||
else:
|
|
||||||
t.is_searchable = t.is_editable = False
|
|
||||||
intermediate_nodes[(original_name, tag.category)] = t
|
|
||||||
else:
|
else:
|
||||||
t = tag
|
t = tag
|
||||||
if not in_uc:
|
if not in_uc:
|
||||||
t.original_name = t.name
|
t.original_name = t.name
|
||||||
intermediate_nodes[(t.original_name, tag.category)] = t
|
|
||||||
t.is_hierarchical = \
|
t.is_hierarchical = \
|
||||||
'5state' if t.category != 'search' else '3state'
|
'5state' if t.category != 'search' else '3state'
|
||||||
t.name = comp
|
t.name = comp
|
||||||
|
Loading…
x
Reference in New Issue
Block a user