Merge pull request #909 from wallgrenen/remove-unused-variables

remove unused variables and commented-out code
This commit is contained in:
Damien Elmes 2021-01-09 08:56:25 +10:00 committed by GitHub
commit 02209c5c16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 1 additions and 11 deletions

View File

@ -131,7 +131,6 @@ class DataModel(QAbstractTableModel):
if role == Qt.FontRole:
if self.activeCols[index.column()] not in ("question", "answer", "noteFld"):
return
row = index.row()
c = self.getCard(index)
t = c.template()
if not t.get("bfont"):
@ -293,7 +292,6 @@ class DataModel(QAbstractTableModel):
return "%Y-%m-%d"
def columnData(self, index):
row = index.row()
col = index.column()
type = self.columnType(col)
c = self.getCard(index)
@ -388,7 +386,6 @@ class DataModel(QAbstractTableModel):
if type != "noteFld":
return False
row = index.row()
c = self.getCard(index)
nt = c.note().model()
return nt["flds"][self.col.models.sortIdx(nt)]["rtl"]
@ -2061,7 +2058,7 @@ where id in %s"""
self.model.beginReset()
self.mw.checkpoint(tr(TR.BROWSING_TAG_DUPLICATES))
nids = set()
for s, nidlist in res:
for _, nidlist in res:
nids.update(nidlist)
self.col.tags.bulkAdd(list(nids), tr(TR.BROWSING_DUPLICATE))
self.mw.progress.finish()

View File

@ -270,7 +270,6 @@ class AnkiQt(QMainWindow):
# called on .clear()
return
name = self.pm.profiles()[n]
f = self.profileForm
self.pm.load(name)
def openProfile(self):

View File

@ -71,7 +71,6 @@ class TagLimit(QDialog):
def accept(self):
self.hide()
n = 0
# gather yes/no tags
yes = []
no = []

View File

@ -201,16 +201,11 @@ class ButtonedDialog(QMessageBox):
self.help = help
self.setIcon(QMessageBox.Warning)
self.setText(text)
# v = QVBoxLayout()
# v.addWidget(QLabel(text))
# box = QDialogButtonBox()
# v.addWidget(box)
for b in buttons:
self._buttons.append(self.addButton(b, QMessageBox.AcceptRole))
if help:
self.addButton(tr(TR.ACTIONS_HELP), QMessageBox.HelpRole)
buttons.append(tr(TR.ACTIONS_HELP))
# self.setLayout(v)
def run(self):
self.exec_()