mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #1623 (Filter stats update)
This commit is contained in:
parent
a83de9ce2d
commit
a0e9483e92
@ -340,6 +340,8 @@ class Main(MainWindow, Ui_MainWindow):
|
||||
self.connect(self.search, SIGNAL('search(PyQt_PyObject, PyQt_PyObject)'),
|
||||
self.tags_view.model().reinit)
|
||||
self.connect(self.library_view.model(), SIGNAL('count_changed(int)'), self.location_view.count_changed)
|
||||
self.connect(self.library_view.model(), SIGNAL('count_changed(int)'),
|
||||
self.tags_view.recount)
|
||||
self.library_view.model().count_changed()
|
||||
########################### Cover Flow ################################
|
||||
self.cover_flow = None
|
||||
@ -1129,6 +1131,7 @@ class Main(MainWindow, Ui_MainWindow):
|
||||
os.remove(f.name)
|
||||
except:
|
||||
pass
|
||||
self.tags_view.recount()
|
||||
if self.current_view() is self.library_view:
|
||||
current = self.library_view.currentIndex()
|
||||
self.library_view.model().current_changed(current, QModelIndex())
|
||||
|
@ -7,7 +7,7 @@ __docformat__ = 'restructuredtext en'
|
||||
Browsing book collection by tags.
|
||||
'''
|
||||
from PyQt4.Qt import QAbstractItemModel, Qt, QVariant, QTreeView, QModelIndex, \
|
||||
QFont, SIGNAL, QSize, QColor, QIcon
|
||||
QFont, SIGNAL, QSize, QColor, QIcon, QPoint
|
||||
from calibre.gui2 import config
|
||||
NONE = QVariant()
|
||||
|
||||
@ -37,6 +37,14 @@ class TagsView(QTreeView):
|
||||
self.emit(SIGNAL('tags_marked(PyQt_PyObject, PyQt_PyObject)'),
|
||||
self._model.tokens(), self.match_all.isChecked())
|
||||
|
||||
def recount(self, *args):
|
||||
ci = self.currentIndex()
|
||||
if not ci.isValid():
|
||||
ci = self.indexAt(QPoint(10, 10))
|
||||
self.model().refresh()
|
||||
if ci.isValid():
|
||||
self.scrollTo(ci, QTreeView.PositionAtTop)
|
||||
|
||||
class TagsModel(QAbstractItemModel):
|
||||
|
||||
categories = [_('Authors'), _('Series'), _('Formats'), _('Publishers'), _('News'), _('Tags')]
|
||||
|
Loading…
x
Reference in New Issue
Block a user