Skip to content

Commit

Permalink
[gdal] Implement the data provider reloadData() function (fixes #20536)
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Apr 10, 2019
1 parent 0c03900 commit fdb82fc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/providers/gdal/qgsgdalprovider.cpp
Expand Up @@ -526,6 +526,15 @@ void QgsGdalProvider::closeDataset()
closeCachedGdalHandlesFor( this );
}

void QgsGdalProvider::reloadData()
{
QMutexLocker locker( mpMutex );
closeDataset();

mHasInit = false;
( void )initIfNeeded();
}

QString QgsGdalProvider::htmlMetadata()
{
QMutexLocker locker( mpMutex );
Expand Down
2 changes: 2 additions & 0 deletions src/providers/gdal/qgsgdalprovider.h
Expand Up @@ -171,6 +171,8 @@ class QgsGdalProvider : public QgsRasterDataProvider, QgsGdalProviderBase
bool setNoDataValue( int bandNo, double noDataValue ) override;
bool remove() override;

void reloadData() override;

QString validateCreationOptions( const QStringList &createOptions, const QString &format ) override;
QString validatePyramidsConfigOptions( QgsRaster::RasterPyramidsFormat pyramidsFormat,
const QStringList &configOptions, const QString &fileFormat ) override;
Expand Down

0 comments on commit fdb82fc

Please sign in to comment.