Esempio n. 1
0
 def refresh_status(self):
     sizesum = 0
     rowcount = self.model.rowCount()
     for row in range(rowcount):
         index = self.model.index(row, 0)
         item = self.model.itemFromIndex(index)
         comic = item.data().toPyObject()
         filename, basename, fileext, filedir, fullpath, filetype, filesize, filemtime, fileuri = comic
         sizesum += filesize
     self.comicStatus.setText("comics: %d\t|\tsize: %s" % (
         rowcount, utils.filesizeformat(sizesum)))
Esempio n. 2
0
 def refresh_treeview(self):
     self.model.clear()
     args = glob.glob(str(self.select_lineEdit.text()))
     self.comics = utils.get_comics(args, self.opts, self.opts['size'])
     for comic in self.comics:
         filename, basename, fileext, filedir, fullpath, filetype, filesize, filemtime, fileuri = comic
         row = [filename, filetype, utils.filesizeformat(filesize)]
         items = []
         sitems = [QStandardItem(item) for item in row]
         for item in sitems:
             item.setData(comic)
             item.setFlags(item.flags() & ~Qt.ItemIsEditable)
             items.append(item)
         self.model.appendRow(items)
     self.set_columns()
     self.refresh_status()