-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
We don't need to copy (clone) it all the time. For instance, whenever ChangeData command isn't executed, it's probably not a place for a whole copy. Example from SubtitleTabs.py:
def _updateFile(self, filePath):
items = self.__fileList.findItems(filePath, Qt.MatchExactly)
if len(items) > 0:
data = self._subtitleData.data(filePath)
for item in items:
item.setText(1, data.inputEncoding)
item.setText(2, data.outputEncoding)
item.setText(3, data.outputFormat.NAME)
item.setText(4, str(data.fps))
videoIcon = QIcon(":/img/film.png") if data.videoPath is not None else QIcon()
item.setIcon(4, videoIcon)
We don't even use subtitles here. Instead, we could introduce e.g. non-copying accessors in DataModel for encodings, fps and things like that.
OR EVEN BETTER: make subtitles copy-on-write (copy-on-edit, frankly).
Reactions are currently unavailable