Ticket #2228: apply_all_fix.patch

File apply_all_fix.patch, 1.9 KB (added by surye, 11 years ago)
  • deluge/ui/gtkui/addtorrentdialog.py

    From 74c45cc684df0d7aa90c46f4224c965d292d485d Mon Sep 17 00:00:00 2001
    From: Vincent Castellano <surye@datamachine.net>
    Date: Mon, 3 Dec 2012 23:06:25 -0800
    Subject: [PATCH 1/2] Do not copy file renames when using the Apply To All
     feature in the Add Torrent dialog box.
    
    ---
     deluge/ui/gtkui/addtorrentdialog.py |    5 ++++-
     1 file changed, 4 insertions(+), 1 deletion(-)
    
    diff --git a/deluge/ui/gtkui/addtorrentdialog.py b/deluge/ui/gtkui/addtorrentdialog.py
    index 84ea16e..7f772f2 100644
    a b def _on_button_apply_clicked(self, widget): 
    826826        self.save_torrent_options(row) 
    827827 
    828828        # The options we want all the torrents to have 
    829         options = self.options[model.get_value(row, 0)] 
     829        options = self.options[model.get_value(row, 0)].copy() 
     830         
     831        # Don't copy file renames 
     832        del options["mapped_files"] 
    830833 
    831834        # Set all the torrent options 
    832835        row = model.get_iter_first() 
  • deluge/ui/gtkui/addtorrentdialog.py

    -- 
    1.7.9.5
    
    
    From 98e8c92c1d393c7525e46db5c547d7a40c80f7b9 Mon Sep 17 00:00:00 2001
    From: Vincent Castellano <surye@datamachine.net>
    Date: Mon, 3 Dec 2012 23:22:12 -0800
    Subject: [PATCH 2/2] Update dict to avoid wiping out existing mapped files.
    
    ---
     deluge/ui/gtkui/addtorrentdialog.py |    2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/deluge/ui/gtkui/addtorrentdialog.py b/deluge/ui/gtkui/addtorrentdialog.py
    index 7f772f2..990e4f5 100644
    a b def _on_button_apply_clicked(self, widget): 
    835835        row = model.get_iter_first() 
    836836        while row != None: 
    837837            torrent_id = model.get_value(row, 0) 
    838             self.options[torrent_id] = options 
     838            self.options[torrent_id].update(options) 
    839839            row = model.iter_next(row) 
    840840 
    841841    def _on_button_revert_clicked(self, widget):