Ticket #2000: filelist_update_error.patch

File filelist_update_error.patch, 1.1 KB (added by wasp, 13 years ago)
  • deluge/ui/gtkui/files_tab.py

    diff --git a/deluge/ui/gtkui/files_tab.py b/deluge/ui/gtkui/files_tab.py
    index 468ab98..f50c628 100644
    a b def update(self):  
    334334            log.debug("Getting file list from core..")
    335335            status_keys += ["files"]
    336336
    337         component.get("SessionProxy").get_torrent_status(self.torrent_id, status_keys).addCallback(self._on_get_torrent_status)
     337        component.get("SessionProxy").get_torrent_status(self.torrent_id,
     338                status_keys).addCallback(self._on_get_torrent_status, self.torrent_id)
    338339
    339340    def clear(self):
    340341        self.treestore.clear()
    def get_completed_bytes(row):  
    464465
    465466        get_completed_bytes(self.treestore.iter_children(root))
    466467
    467     def _on_get_torrent_status(self, status):
     468    def _on_get_torrent_status(self, status, torrent_id):
     469        # avoid out-of-date (we already moved to another torrent) response
     470        if torrent_id != self.torrent_id:
     471            return
     472       
    468473        # Store this torrent's compact setting
    469474        if "compact" in status:
    470475            self.__compact = status["compact"]