qgis/Quantum-GIS — comment on commit 3c1eb0aca9b3b333a459574312e7b0651b115511
File: python/plugins/GdalTools/tools/doBuildVRT.py line 116
By brushtyler:

BTW if selected layers changes on the legend the set of selected layers is not refreshed.
This sometimes could be a problem (e.g. layer referenced in python but deleted in QGis), so would preferable to override the `def onLayersChanged(self):` method (defined in BasePluginWidget within the widgetPluginBase module) which was created just for this purpose.