Skip to content
Permalink
Browse files

Avoid some mixing enum types warnings

  • Loading branch information
nyalldawson committed Feb 18, 2015
1 parent 7c4de56 commit d4f509f7a2e4d6bf325ecff06ae890d9ccafcb61
@@ -67,7 +67,7 @@ bool QgsImageWarper::openSrcDSAndGetWarpOpt( const QString &input, const Resampl
}
psWarpOptions->pfnProgress = GDALTermProgress;
psWarpOptions->pfnTransformer = pfnTransform;
psWarpOptions->eResampleAlg = GDALResampleAlg( resampling );
psWarpOptions->eResampleAlg = toGDALResampleAlg( resampling );

return true;
}
@@ -360,3 +360,25 @@ int CPL_STDCALL QgsImageWarper::updateWarpProgress( double dfComplete, const cha
mWarpCanceled = false;
return true;
}

GDALResampleAlg QgsImageWarper::toGDALResampleAlg( const QgsImageWarper::ResamplingMethod method ) const
{
switch ( method )
{
case NearestNeighbour:
return GRA_NearestNeighbour;
case Bilinear:
return GRA_Bilinear;
case Cubic:
return GRA_Cubic;
case CubicSpline:
return GRA_CubicSpline;
case Lanczos:
return GRA_Lanczos;
default:
return GRA_NearestNeighbour;
};

//avoid warning
return GRA_NearestNeighbour;
}
@@ -95,6 +95,8 @@ class QgsImageWarper
static int CPL_STDCALL updateWarpProgress( double dfComplete, const char *pszMessage, void *pProgressArg );

static bool mWarpCanceled;

GDALResampleAlg toGDALResampleAlg( const ResamplingMethod method ) const;
};


@@ -315,7 +315,7 @@ QString QgsBench::serialize( QMap<QString, QVariant> theMap, int level )
QMap<QString, QVariant>::const_iterator i = theMap.constBegin();
while ( i != theMap.constEnd() )
{
switch ( i.value().type() )
switch ( (QMetaType::Type)i.value().type() )
{
case QMetaType::Int:
list.append( space2 + "\"" + i.key() + "\": " + QString( "%1" ).arg( i.value().toInt() ) );

0 comments on commit d4f509f

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