fix buildSupportedRasterFileFilter for sip api v2

This commit is contained in:
Etienne Tourigny 2013-06-04 13:34:56 -03:00
parent ae3abccfe3
commit 097536c30c
4 changed files with 11 additions and 3 deletions

View File

@ -94,6 +94,7 @@ class QgsRasterLayer : QgsMapLayer
// Static methods:
//
static void buildSupportedRasterFileFilter( QString & fileFilters );
static QString buildSupportedRasterFileFilter2(); /* for sip api v2 */
/** This helper checks to see whether the file name appears to be a valid
* raster file name. If the file name looks like it could be valid,

View File

@ -429,8 +429,7 @@ class FileFilter:
@classmethod
def allRastersFilter(self):
if self.rastersFilter == '':
# TODO fix this, does not work
QgsRasterLayer.buildSupportedRasterFileFilter(self.rastersFilter)
self.rastersFilter = QgsRasterLayer.buildSupportedRasterFileFilter2()
# workaround for QGis < 1.5 (see #2376)
# removed as this is a core plugin QGis >= 1.9

View File

@ -176,13 +176,20 @@ void QgsRasterLayer::buildSupportedRasterFileFilter( QString & theFileFiltersStr
buildsupportedrasterfilefilter_t *pBuild = ( buildsupportedrasterfilefilter_t * ) cast_to_fptr( QgsProviderRegistry::instance()->function( "gdal", "buildSupportedRasterFileFilter" ) );
if ( ! pBuild )
{
QgsDebugMsg( "Could get buildSupportedRasterFileFilter in gdal provider library" );
QgsDebugMsg( "Could not get buildSupportedRasterFileFilter in gdal provider library" );
return;
}
pBuild( theFileFiltersString );
}
QString QgsRasterLayer::buildSupportedRasterFileFilter2( )
{
QString theFileFiltersString;
buildSupportedRasterFileFilter( theFileFiltersString );
return theFileFiltersString;
}
/**
* This helper checks to see whether the file name appears to be a valid raster file name
*/

View File

@ -245,6 +245,7 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
};
static void buildSupportedRasterFileFilter( QString & fileFilters );
static QString buildSupportedRasterFileFilter2(); /* for sip api v2 */
/** This helper checks to see whether the file name appears to be a valid
* raster file name. If the file name looks like it could be valid,