Skip to content
Permalink
Browse files

[GRASS] fixed stds input

  • Loading branch information
blazek committed Feb 11, 2016
1 parent dfdb420 commit c8161aac88df75f9e9510cbd3fad050d29984b42
@@ -394,7 +394,7 @@ bool QgsGrassModuleInputProxy::filterAcceptsRow( int sourceRow, const QModelInde
}
}

return mType == itemType;
return mType == itemType || ( mType == QgsGrassObject::Stds && ( itemType == QgsGrassObject::Strds || itemType == QgsGrassObject::Stvds || itemType == QgsGrassObject::Str3ds ) );
}

bool QgsGrassModuleInputProxy::lessThan( const QModelIndex & left, const QModelIndex & right ) const
@@ -942,6 +942,10 @@ QgsGrassModuleInput::QgsGrassModuleInput( QgsGrassModule *module,
{
mType = QgsGrassObject::Str3ds;
}
else if ( element == "stds" )
{
mType = QgsGrassObject::Stds;
}
else
{
mErrors << tr( "GRASS element %1 not supported" ).arg( element );
@@ -202,7 +202,8 @@ QgsGrassModuleStandardOptions::QgsGrassModuleStandardOptions(
QString age = promptElem.attribute( "age" );
//QgsDebugMsg("element = " + element + " age = " + age);
if ( age == "old" && ( element == "vector" || element == "cell" ||
element == "strds" || element == "stvds" || element == "str3ds" ) )
element == "strds" || element == "stvds" ||
element == "str3ds" || element == "stds" ) )
{
QgsGrassModuleInput *mi = new QgsGrassModuleInput(
mModule, this, key, confDomElement, descDocElem, gnode, mDirect, this );
@@ -195,6 +195,8 @@ QString QgsGrassObject::elementShort( Type type )
return "stvds";
else if ( type == Str3ds )
return "str3ds";
else if ( type == Stds )
return "stds";
else
return "";
}
@@ -1540,7 +1542,8 @@ QStringList QgsGrass::grassObjects( const QgsGrassObject& mapsetObject, QgsGrass
QgsDebugMsg( "mapset is not readable" );
return QStringList();
}
else if ( type == QgsGrassObject::Strds || type == QgsGrassObject::Stvds || type == QgsGrassObject::Str3ds )
else if ( type == QgsGrassObject::Strds || type == QgsGrassObject::Stvds
|| type == QgsGrassObject::Str3ds || type == QgsGrassObject::Stds )
{
#if GRASS_VERSION_MAJOR >= 7
QString cmd = gisbase() + "/scripts/t.list";
@@ -1556,7 +1559,14 @@ QStringList QgsGrass::grassObjects( const QgsGrassObject& mapsetObject, QgsGrass
}
else
{
arguments << "type=" + QgsGrassObject::elementShort( type );
if ( type == QgsGrassObject::Stds )
{
arguments << "type=strds,stvds,str3ds";
}
else
{
arguments << "type=" + QgsGrassObject::elementShort( type );
}

int timeout = -1; // What timeout to use? It can take long time on network or database
try
@@ -82,7 +82,7 @@ class GRASS_LIB_EXPORT QgsGrassObject
public:
//! Element type
enum Type { None, Location, Mapset, Raster, Group, Vector, Region,
Strds, Stvds, Str3ds
Strds, Stvds, Str3ds, Stds
};

QgsGrassObject() : mType( None ) {}

0 comments on commit c8161aa

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