@@ -490,58 +490,6 @@ QDateTime QgsRasterLayer::lastModified( QString const & name )
490
490
491
491
t = fi.lastModified ();
492
492
493
- // Check also color table for GRASS
494
- if ( name.contains ( " cellhd" ) > 0 )
495
- { // most probably GRASS
496
- QString dir = fi.path ();
497
- QString map = fi.fileName ();
498
- fi.setFile ( dir + " /../colr/" + map );
499
-
500
- if ( fi.exists () )
501
- {
502
- if ( fi.lastModified () > t ) t = fi.lastModified ();
503
- }
504
- }
505
-
506
- // Check GRASS group members (bands)
507
- if ( name.contains ( " group" ) > 0 )
508
- { // probably GRASS group
509
- fi.setFile ( name + " /REF" );
510
-
511
- if ( fi.exists () )
512
- { // most probably GRASS group
513
- QFile f ( name + " /REF" );
514
- if ( f.open ( QIODevice::ReadOnly ) )
515
- {
516
- QString dir = fi.path () + " /../../../" ;
517
-
518
- char buf[101 ];
519
- while ( f.readLine ( buf, 100 ) != -1 )
520
- {
521
- QString ln = QString ( buf );
522
- QStringList sl = ln.trimmed ().split ( ' ' , QString::SkipEmptyParts );
523
- QString map = sl.first ();
524
- sl.pop_front ();
525
- QString mapset = sl.first ();
526
-
527
- // header
528
- fi.setFile ( dir + mapset + " /cellhd/" + map );
529
- if ( fi.exists () )
530
- {
531
- if ( fi.lastModified () > t ) t = fi.lastModified ();
532
- }
533
-
534
- // color
535
- fi.setFile ( dir + mapset + " /colr/" + map );
536
- if ( fi.exists () )
537
- {
538
- if ( fi.lastModified () > t ) t = fi.lastModified ();
539
- }
540
- }
541
- }
542
- }
543
- }
544
-
545
493
QgsDebugMsg ( " last modified = " + t.toString () );
546
494
547
495
return t;
@@ -1170,6 +1118,9 @@ QgsRasterLayer::RasterPyramidList QgsRasterLayer::buildPyramidList()
1170
1118
int myWidth = mWidth ;
1171
1119
int myHeight = mHeight ;
1172
1120
int myDivisor = 2 ;
1121
+
1122
+ if ( mDataProvider ) return mPyramidList ;
1123
+
1173
1124
GDALRasterBandH myGDALBand = GDALGetRasterBand ( mGdalDataset , 1 ); // just use the first band
1174
1125
1175
1126
mPyramidList .clear ();
@@ -1928,6 +1879,12 @@ bool QgsRasterLayer::identify( const QgsPoint& thePoint, QMap<QString, QString>&
1928
1879
1929
1880
QgsDebugMsg ( thePoint.toString () );
1930
1881
1882
+ if ( !mProviderKey .isEmpty () )
1883
+ {
1884
+ QgsDebugMsg ( " identify provider : " + mProviderKey ) ;
1885
+ return ( mDataProvider ->identify ( thePoint, theResults ) );
1886
+ }
1887
+
1931
1888
if ( !mLayerExtent .contains ( thePoint ) )
1932
1889
{
1933
1890
// Outside the raster
@@ -3270,8 +3227,15 @@ void QgsRasterLayer::setDataProvider( QString const & provider,
3270
3227
mDrawingStyle = MultiBandColor; // sensible default
3271
3228
3272
3229
// Setup source CRS
3273
- *mCRS = QgsCoordinateReferenceSystem ();
3274
- mCRS ->createFromOgcWmsCrs ( crs );
3230
+ if ( mProviderKey == " wms" )
3231
+ {
3232
+ *mCRS = QgsCoordinateReferenceSystem ();
3233
+ mCRS ->createFromOgcWmsCrs ( crs );
3234
+ }
3235
+ else
3236
+ {
3237
+ *mCRS = QgsCoordinateReferenceSystem ( mDataProvider ->crs () );
3238
+ }
3275
3239
}
3276
3240
}
3277
3241
else
@@ -5453,9 +5417,11 @@ bool QgsRasterLayer::update()
5453
5417
5454
5418
if ( mLastModified < QgsRasterLayer::lastModified ( source () ) )
5455
5419
{
5456
- QgsDebugMsg ( " Outdated -> reload" );
5457
- closeDataset ();
5458
- return readFile ( source () );
5420
+ if ( !usesProvider () ) {
5421
+ QgsDebugMsg ( " Outdated -> reload" );
5422
+ closeDataset ();
5423
+ return readFile ( source () );
5424
+ }
5459
5425
}
5460
5426
return true ;
5461
5427
}
0 commit comments