Treferwynd / transmission-remote-gtk

Automatically exported from code.google.com/p/transmission-remote-gtk
GNU General Public License v2.0
0 stars 0 forks source link

Only do reverse-DNS lookup when necessary #120

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The problem with model-view-controller apps is the general requirement that the 
model be fully populated even when parts of the model are unneeded for the 
current view.  Case in point: trg should not be doing expensive reverse-lookups 
in trg_peers_model_update() when the 'Host' column is not enabled.  Same 
probably goes for 'Country' lookup, though this is much less expensive.

In trg, it's not clear to me how to make a model object aware that the view 
does not need specific fields.  If trg is to maintain clean separation, I 
suppose this means implementing a model method that set/get whether certain 
model info should be populated and calling from the view object?

Original issue reported on code.google.com by reardo...@gmail.com on 20 Sep 2011 at 7:59

GoogleCodeExporter commented 9 years ago

Original comment by a...@eth0.org.uk on 20 Sep 2011 at 8:20

GoogleCodeExporter commented 9 years ago
Ok, r242 was a hilariously fast update.  

Sort of dangerous to start mixing model&view contexts, but no easy way around 
it either.  

You probably need to force trg_peers_model_update() on enable/disable column, 
otherwise the user needs to navigate away from the torrent and then back to the 
torrent for the info to repopulate the model.

Original comment by reardo...@gmail.com on 20 Sep 2011 at 8:30