Rename ListModel.update() to updateItem()

This commit is contained in:
miruka 2019-05-14 19:06:59 -04:00
parent 2a687f8eee
commit 45c928ea17
2 changed files with 8 additions and 6 deletions

View File

@ -238,7 +238,7 @@ class ListModel(QAbstractListModel):
@pyqtSlot(int, "QVariantMap", "QStringList", result=int) @pyqtSlot(int, "QVariantMap", "QStringList", result=int)
@pyqtSlot(str, "QVariantMap", result=int) @pyqtSlot(str, "QVariantMap", result=int)
@pyqtSlot(str, "QVariantMap", "QStringList", result=int) @pyqtSlot(str, "QVariantMap", "QStringList", result=int)
def update(self, def updateItem(self,
index: Index, index: Index,
value: NewItem, value: NewItem,
ignore_roles: Sequence[str] = ()) -> int: ignore_roles: Sequence[str] = ()) -> int:
@ -283,7 +283,9 @@ class ListModel(QAbstractListModel):
new_index_if_update: Optional[int] = None, new_index_if_update: Optional[int] = None,
ignore_roles: Sequence[str] = ()) -> None: ignore_roles: Sequence[str] = ()) -> None:
try: try:
index = self.update(where_main_key_is, update_with, ignore_roles) index = self.updateItem(
where_main_key_is, update_with, ignore_roles
)
except (IndexError, ValueError): except (IndexError, ValueError):
self.insert(new_index_if_insert or len(self), update_with) self.insert(new_index_if_insert or len(self), update_with)
else: else:

View File

@ -336,7 +336,7 @@ class SignalManager(QObject):
break break
if update_at is not None: if update_at is not None:
model.update(update_at, new_event) model.updateItem(update_at, new_event)
self._events_in_transfer -= 1 self._events_in_transfer -= 1
return new_event return new_event