QGIS 2 adaptation