QGis 2.4 compatible.

Deprecated functions are deleted