From 81b15a5877c318c0d1b4624c003b0c57e63eda48 Mon Sep 17 00:00:00 2001 From: Mizaki Date: Tue, 27 Jun 2023 00:21:28 +0100 Subject: [PATCH] Fixes sorting by year and issue count. Removed superfluous if for publisher. Fixes #475 --- comictaggerlib/seriesselectionwindow.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/comictaggerlib/seriesselectionwindow.py b/comictaggerlib/seriesselectionwindow.py index 938975b..edfd4ad 100644 --- a/comictaggerlib/seriesselectionwindow.py +++ b/comictaggerlib/seriesselectionwindow.py @@ -465,24 +465,24 @@ class SeriesSelectionWindow(QtWidgets.QDialog): self.twList.setItem(row, 0, item) item_text = str(record.start_year) - item = QtWidgets.QTableWidgetItem(item_text) + item = QtWidgets.QTableWidgetItem(record.start_year) item.setData(QtCore.Qt.ItemDataRole.ToolTipRole, item_text) + item.setData(QtCore.Qt.ItemDataRole.DisplayRole, record.start_year) item.setFlags(QtCore.Qt.ItemFlag.ItemIsSelectable | QtCore.Qt.ItemFlag.ItemIsEnabled) self.twList.setItem(row, 1, item) item_text = str(record.count_of_issues) - item = QtWidgets.QTableWidgetItem(item_text) + item = QtWidgets.QTableWidgetItem(record.count_of_issues) item.setData(QtCore.Qt.ItemDataRole.ToolTipRole, item_text) item.setData(QtCore.Qt.ItemDataRole.DisplayRole, record.count_of_issues) item.setFlags(QtCore.Qt.ItemFlag.ItemIsSelectable | QtCore.Qt.ItemFlag.ItemIsEnabled) self.twList.setItem(row, 2, item) - if record.publisher is not None: - item_text = record.publisher - item.setData(QtCore.Qt.ItemDataRole.ToolTipRole, item_text) - item = QtWidgets.QTableWidgetItem(item_text) - item.setFlags(QtCore.Qt.ItemFlag.ItemIsSelectable | QtCore.Qt.ItemFlag.ItemIsEnabled) - self.twList.setItem(row, 3, item) + item_text = record.publisher + item.setData(QtCore.Qt.ItemDataRole.ToolTipRole, item_text) + item = QtWidgets.QTableWidgetItem(item_text) + item.setFlags(QtCore.Qt.ItemFlag.ItemIsSelectable | QtCore.Qt.ItemFlag.ItemIsEnabled) + self.twList.setItem(row, 3, item) row += 1