Skip to content
Permalink
Browse files

Grass plugin/provider fixes for Coverity

  • Loading branch information
nyalldawson committed Feb 16, 2015
1 parent d3c8837 commit 07ea41f9b90b04cc04b28d99e5c333b32eb3c700
@@ -343,9 +343,6 @@ class QgsGrassModuleStandardOptions: QWidget, public QgsGrassModuleOptions
//! List of all flags. Necessary for scripts.
QStringList mFlagNames;

//! Use of region defined in qgm
bool mUsesRegion;

// ! Advanced options switch button
QPushButton mAdvancedPushButton;

@@ -78,6 +78,9 @@ static QString GRASS_DESCRIPTION = "Grass provider"; // XXX verify this

QgsGrassProvider::QgsGrassProvider( QString uri )
: QgsVectorDataProvider( uri )
, mLayerField( -1 )
, mLayerType( POINT )
, mGrassType( 0 )
, mQgisType( QGis::WKBUnknown )
, mLayerId( -1 )
, mMap()
@@ -119,7 +122,6 @@ QgsGrassProvider::QgsGrassProvider( QString uri )
/* Parse Layer, supported layers <field>_point, <field>_line, <field>_area
* Layer is opened even if it is empty (has no features)
*/
mLayerField = -1;
if ( mLayer.compare( "boundary" ) == 0 ) // currently not used
{
mLayerType = BOUNDARY;
@@ -142,10 +142,11 @@ QgsGrassRasterProvider::QgsGrassRasterProvider( QString const & uri )
// We have to decide some reasonable block size, not to big to occupate too much
// memory, not too small to result in too many calls to readBlock -> qgis.d.rast
// for statistics
if ( mCols > 0 )
int typeSize = dataTypeSize( dataType( 1 ) );
if ( mCols > 0 && typeSize > 0 )
{
const int cache_size = 10000000; // ~ 10 MB
mYBlockSize = cache_size / ( dataTypeSize( dataType( 1 ) ) ) / mCols;
mYBlockSize = cache_size / typeSize / mCols;
if ( mYBlockSize > mRows )
{
mYBlockSize = mRows;

0 comments on commit 07ea41f

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