Skip to content

Commit e174577

Browse files
committed
[gdal] Implement the data provider reloadData() function (fixes #20536)
1 parent 2e613b4 commit e174577

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/providers/gdal/qgsgdalprovider.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,15 @@ void QgsGdalProvider::closeDataset()
526526
closeCachedGdalHandlesFor( this );
527527
}
528528

529+
void QgsGdalProvider::reloadData()
530+
{
531+
QMutexLocker locker( mpMutex );
532+
closeDataset();
533+
534+
mHasInit = false;
535+
( void )initIfNeeded();
536+
}
537+
529538
QString QgsGdalProvider::htmlMetadata()
530539
{
531540
QMutexLocker locker( mpMutex );

src/providers/gdal/qgsgdalprovider.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ class QgsGdalProvider : public QgsRasterDataProvider, QgsGdalProviderBase
171171
bool setNoDataValue( int bandNo, double noDataValue ) override;
172172
bool remove() override;
173173

174+
void reloadData() override;
175+
174176
QString validateCreationOptions( const QStringList &createOptions, const QString &format ) override;
175177
QString validatePyramidsConfigOptions( QgsRaster::RasterPyramidsFormat pyramidsFormat,
176178
const QStringList &configOptions, const QString &fileFormat ) override;

0 commit comments

Comments
 (0)