Skip to content

Commit 500116b

Browse files
committed
vector layer: calculate extents lazily (fixes #9510)
1 parent 00f6236 commit 500116b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/core/qgsvectorlayer.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1685,10 +1685,10 @@ bool QgsVectorLayer::setDataProvider( QString const & provider )
16851685
mValid = mDataProvider->isValid();
16861686
if ( mValid )
16871687
{
1688-
16891688
// TODO: Check if the provider has the capability to send fullExtentCalculated
16901689
connect( mDataProvider, SIGNAL( fullExtentCalculated() ), this, SLOT( updateExtents() ) );
16911690

1691+
#if 0 // allow lazy calculation of extents and give the creator of the vector layer a chance to 'manually' setExtent
16921692
// get the extent
16931693
QgsRectangle mbr = mDataProvider->extent();
16941694

@@ -1697,6 +1697,7 @@ bool QgsVectorLayer::setDataProvider( QString const & provider )
16971697
QgsDebugMsg( "Extent of layer: " + s );
16981698
// store the extent
16991699
setExtent( mbr );
1700+
#endif
17001701

17011702
// get and store the feature type
17021703
mWkbType = mDataProvider->geometryType();
@@ -3693,7 +3694,7 @@ void QgsVectorLayer::readSldLabeling( const QDomNode& node )
36933694
QDomElement userStyleElem = element.firstChildElement( "UserStyle" );
36943695
if ( userStyleElem.isNull() )
36953696
{
3696-
QgsDebugMsg( "Info: UserStyle element not found.");
3697+
QgsDebugMsg( "Info: UserStyle element not found." );
36973698
return;
36983699
}
36993700

0 commit comments

Comments
 (0)