mirror of
https://github.com/wassname/sloth.git
synced 2026-08-01 12:51:00 +08:00
Log time needed to create AnnotationModel
This commit is contained in:
@@ -6,6 +6,9 @@ from PyQt4.QtCore import QModelIndex, QAbstractItemModel, QVariant, Qt, pyqtSign
|
||||
import os.path
|
||||
import copy
|
||||
from collections import MutableMapping
|
||||
import time
|
||||
import logging
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
ItemRole, TypeRole, DataRole, ImageRole = [Qt.UserRole + i + 1 for i in range(4)]
|
||||
|
||||
@@ -385,10 +388,13 @@ class AnnotationModel(QAbstractItemModel):
|
||||
|
||||
def __init__(self, annotations, parent=None):
|
||||
QAbstractItemModel.__init__(self, parent)
|
||||
start = time.time()
|
||||
self._annotations = annotations
|
||||
self._dirty = False
|
||||
self._root = RootModelItem(self)
|
||||
self._root.appendFileItems(annotations)
|
||||
diff = time.time() - start
|
||||
LOG.info("Created AnnotationModel in %.2fs" % (diff, ))
|
||||
|
||||
# QAbstractItemModel overloads
|
||||
def columnCount(self, index=QModelIndex()):
|
||||
|
||||
Reference in New Issue
Block a user