Skip to content

Commit

Permalink
fix windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Apr 17, 2013
1 parent 4c05932 commit 1570240
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 12 deletions.
12 changes: 10 additions & 2 deletions src/core/raster/qgsrasterdataprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,13 +341,21 @@ QString QgsRasterDataProvider::lastErrorFormat()
return "text/plain";
}

typedef QList<QPair<QString, QString> > pyramidResamplingMethods_t();
typedef QList<QPair<QString, QString> > *pyramidResamplingMethods_t();
QList<QPair<QString, QString> > QgsRasterDataProvider::pyramidResamplingMethods( QString providerKey )
{
pyramidResamplingMethods_t *pPyramidResamplingMethods = ( pyramidResamplingMethods_t * ) cast_to_fptr( QgsProviderRegistry::instance()->function( providerKey, "pyramidResamplingMethods" ) );
if ( pPyramidResamplingMethods )
{
return pPyramidResamplingMethods();
QList<QPair<QString, QString> > *methods = pPyramidResamplingMethods();
if ( !methods )
{
QgsDebugMsg( "provider pyramidResamplingMethods returned no methods" );
}
else
{
return *methods;
}
}
else
{
Expand Down
23 changes: 13 additions & 10 deletions src/providers/gdal/qgsgdalprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2753,16 +2753,19 @@ QString QgsGdalProvider::validatePyramidsCreationOptions( RasterPyramidsFormat p
// by running one of the other resampling strategies below.
// see ticket #284

QGISEXTERN QList<QPair<QString, QString> > pyramidResamplingMethods()
QGISEXTERN QList<QPair<QString, QString> > *pyramidResamplingMethods()
{
QList<QPair<QString, QString> > methods;
methods.append( QPair<QString, QString>( "NEAREST", QObject::tr( "Nearest Neighbour" ) ) );
methods.append( QPair<QString, QString>( "AVERAGE", QObject::tr( "Average" ) ) );
methods.append( QPair<QString, QString>( "GAUSS", QObject::tr( "Gauss" ) ) );
methods.append( QPair<QString, QString>( "CUBIC", QObject::tr( "Cubic" ) ) );
methods.append( QPair<QString, QString>( "MODE", QObject::tr( "Mode" ) ) );
methods.append( QPair<QString, QString>( "NONE", QObject::tr( "None" ) ) );
static QList<QPair<QString, QString> > methods;

return methods;
}
if ( methods.isEmpty() )
{
methods.append( QPair<QString, QString>( "NEAREST", QObject::tr( "Nearest Neighbour" ) ) );
methods.append( QPair<QString, QString>( "AVERAGE", QObject::tr( "Average" ) ) );
methods.append( QPair<QString, QString>( "GAUSS", QObject::tr( "Gauss" ) ) );
methods.append( QPair<QString, QString>( "CUBIC", QObject::tr( "Cubic" ) ) );
methods.append( QPair<QString, QString>( "MODE", QObject::tr( "Mode" ) ) );
methods.append( QPair<QString, QString>( "NONE", QObject::tr( "None" ) ) );
}

return &methods;
}

0 comments on commit 1570240

Please sign in to comment.