Skip to content
Permalink
Browse files

get list of elements

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5049 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
rblazek
rblazek committed Mar 17, 2006
1 parent 352741e commit 84a0d64374f9dcc44140d49d0462973eddb732a8
Showing with 36 additions and 0 deletions.
  1. +31 −0 src/providers/grass/qgsgrass.cpp
  2. +5 −0 src/providers/grass/qgsgrass.h
@@ -610,3 +610,34 @@ QStringList QgsGrass::rasters ( QString mapsetPath )
}
return list;
}

QStringList QgsGrass::elements ( QString gisbase, QString locationName,
QString mapsetName, QString element)
{
if ( gisbase.isEmpty() || locationName.isEmpty() || mapsetName.isEmpty() )
return QStringList();

return QgsGrass::elements ( gisbase + "/" + locationName + "/" + mapsetName,
element );
}

QStringList QgsGrass::elements ( QString mapsetPath, QString element )
{
#ifdef QGISDEBUG
std::cerr << "QgsGrass::elements mapsetPath = "
<< mapsetPath.ascii() << std::endl;
#endif

QStringList list;

if ( mapsetPath.isEmpty() ) return list;

QDir d = QDir( mapsetPath + "/" + element );
d.setFilter(QDir::Files);

for ( int i = 0; i < d.count(); i++ )
{
list.append(d[i]);
}
return list;
}
@@ -105,6 +105,11 @@ class QgsGrass {
QString mapsetName);
static QStringList rasters(QString mapsetPath);

//! List of elements
static QStringList elements(QString gisbase, QString locationName,
QString mapsetName, QString element);
static QStringList elements(QString mapsetPath, QString element);


static void init (void);

0 comments on commit 84a0d64

Please sign in to comment.
You can’t perform that action at this time.