Skip to content

Commit 097536c

Browse files
committed
fix buildSupportedRasterFileFilter for sip api v2
1 parent ae3abcc commit 097536c

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

python/core/raster/qgsrasterlayer.sip

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ class QgsRasterLayer : QgsMapLayer
9494
// Static methods:
9595
//
9696
static void buildSupportedRasterFileFilter( QString & fileFilters );
97+
static QString buildSupportedRasterFileFilter2(); /* for sip api v2 */
9798

9899
/** This helper checks to see whether the file name appears to be a valid
99100
* raster file name. If the file name looks like it could be valid,

python/plugins/GdalTools/tools/GdalTools_utils.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,8 +429,7 @@ def setFilter(self, typeName, aFilter):
429429
@classmethod
430430
def allRastersFilter(self):
431431
if self.rastersFilter == '':
432-
# TODO fix this, does not work
433-
QgsRasterLayer.buildSupportedRasterFileFilter(self.rastersFilter)
432+
self.rastersFilter = QgsRasterLayer.buildSupportedRasterFileFilter2()
434433

435434
# workaround for QGis < 1.5 (see #2376)
436435
# removed as this is a core plugin QGis >= 1.9

src/core/raster/qgsrasterlayer.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,13 +176,20 @@ void QgsRasterLayer::buildSupportedRasterFileFilter( QString & theFileFiltersStr
176176
buildsupportedrasterfilefilter_t *pBuild = ( buildsupportedrasterfilefilter_t * ) cast_to_fptr( QgsProviderRegistry::instance()->function( "gdal", "buildSupportedRasterFileFilter" ) );
177177
if ( ! pBuild )
178178
{
179-
QgsDebugMsg( "Could get buildSupportedRasterFileFilter in gdal provider library" );
179+
QgsDebugMsg( "Could not get buildSupportedRasterFileFilter in gdal provider library" );
180180
return;
181181
}
182182

183183
pBuild( theFileFiltersString );
184184
}
185185

186+
QString QgsRasterLayer::buildSupportedRasterFileFilter2( )
187+
{
188+
QString theFileFiltersString;
189+
buildSupportedRasterFileFilter( theFileFiltersString );
190+
return theFileFiltersString;
191+
}
192+
186193
/**
187194
* This helper checks to see whether the file name appears to be a valid raster file name
188195
*/

src/core/raster/qgsrasterlayer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
245245
};
246246

247247
static void buildSupportedRasterFileFilter( QString & fileFilters );
248+
static QString buildSupportedRasterFileFilter2(); /* for sip api v2 */
248249

249250
/** This helper checks to see whether the file name appears to be a valid
250251
* raster file name. If the file name looks like it could be valid,

0 commit comments

Comments
 (0)