qgis/Quantum-GIS — pull request #528 by matthias-kuhn (2013-04-14 16:16:21+00:00)
Title: Add QgsVectorLayer::updateFields() signal, so adding of joined fields is communicated

Currently there is no way of executing code, once fields are joined or removed. This makes it impossible for the attributetable to update accordingly and can lead to a crash in the worst case.

Unfortunately this method does not contain detailed information as in the attributeAdded / attributeDeleted signals. I would even prefer to send a simple attributeAdded and attributeDeleted signal for joined fields as well, as in most cases they are treated equal from other points in the code.

As far as I can see, if fields are joined and new attributes get added, the joined field indexes are shifted, so in this case a fieldIndexChanged signal should probably be emitted.

So therefore, this patch does only offer a quickfix which will enable dev's to react properly to changes, but will lead in most cases to a brute-force reload of attached data (as in vector layer cache -> clear() )

Martin: Any thoughts? Should this be merged like that?