mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix stupidities:
1) I left a bunch of unused declarations in tag_view.py 2) I needlessly made a copy of user_categories in DB2
This commit is contained in:
parent
f3b72988b3
commit
3bdf4e61f3
@ -200,13 +200,6 @@ class TagTreeItem(object): # {{{
|
|||||||
|
|
||||||
class TagsModel(QAbstractItemModel): # {{{
|
class TagsModel(QAbstractItemModel): # {{{
|
||||||
|
|
||||||
categories_orig = [_('Authors'), _('Series'), _('Formats'), _('Publishers'),
|
|
||||||
_('Ratings'), _('News'), _('Tags')]
|
|
||||||
row_map_orig = ['authors', 'series', 'formats', 'publishers', 'ratings',
|
|
||||||
'news', 'tags']
|
|
||||||
search_keys=['search', _('Searches')]
|
|
||||||
|
|
||||||
|
|
||||||
def __init__(self, db, parent=None):
|
def __init__(self, db, parent=None):
|
||||||
QAbstractItemModel.__init__(self, parent)
|
QAbstractItemModel.__init__(self, parent)
|
||||||
|
|
||||||
@ -257,12 +250,6 @@ class TagsModel(QAbstractItemModel): # {{{
|
|||||||
|
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def get_search_nodes(self, icon):
|
|
||||||
l = []
|
|
||||||
for i in saved_searches.names():
|
|
||||||
l.append(Tag(i, tooltip=saved_searches.lookup(i), icon=icon))
|
|
||||||
return l
|
|
||||||
|
|
||||||
def refresh(self):
|
def refresh(self):
|
||||||
data = self.get_node_tree(config['sort_by_popularity']) # get category data
|
data = self.get_node_tree(config['sort_by_popularity']) # get category data
|
||||||
for i, r in enumerate(self.row_map):
|
for i, r in enumerate(self.row_map):
|
||||||
|
@ -743,7 +743,7 @@ class LibraryDatabase2(LibraryDatabase, SchemaUpgrade, CustomColumns):
|
|||||||
categories['formats'].sort(cmp=lambda x,y:cmp(x.name, y.name))
|
categories['formats'].sort(cmp=lambda x,y:cmp(x.name, y.name))
|
||||||
|
|
||||||
#### Now do the user-defined categories. ####
|
#### Now do the user-defined categories. ####
|
||||||
user_categories = dict.copy(prefs['user_categories'])
|
user_categories = prefs['user_categories']
|
||||||
|
|
||||||
# remove all user categories from tag_browser_categories. They can
|
# remove all user categories from tag_browser_categories. They can
|
||||||
# easily come and go. We will add all the existing ones in below.
|
# easily come and go. We will add all the existing ones in below.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user