Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
minor change to avoid showing non-file-based layers
git-svn-id: http://sextante.googlecode.com/svn/trunk/soft/bindings/qgis-plugin@51 881b9c09-3ef8-f3c2-ec3d-21d735c97f4d
  • Loading branch information
volayaf committed Mar 21, 2012
1 parent 3e95fb5 commit a7b72be
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/sextante/core/QGisLayers.py
Expand Up @@ -4,6 +4,7 @@
from PyQt4 import QtCore, QtGui
from os import path
from sextante.core.SextanteConfig import SextanteConfig
import os.path

class QGisLayers:

Expand All @@ -17,7 +18,8 @@ def getRasterLayers():

for layer in layers:
if layer.type() == layer.RasterLayer:
raster.append(layer)
if os.path.exists(layer.source()):
raster.append(layer)
return raster

@staticmethod
Expand All @@ -27,7 +29,8 @@ def getVectorLayers(shapetype=-1):
for layer in layers:
if layer.type() == layer.VectorLayer:
if shapetype == QGisLayers.ALL_TYPES or layer.geometryType() == shapetype:
vector.append(layer)
if os.path.exists(layer.source()):
vector.append(layer)
return vector

@staticmethod
Expand Down

0 comments on commit a7b72be

Please sign in to comment.