add check qgis version:
so it works both 1.8 and master version