diff --git a/python/core/qgsvirtuallayerdefinition.sip.in b/python/core/qgsvirtuallayerdefinition.sip.in index d38c42e8125..376845e90d5 100644 --- a/python/core/qgsvirtuallayerdefinition.sip.in +++ b/python/core/qgsvirtuallayerdefinition.sip.in @@ -150,19 +150,19 @@ Get the name of the field with unique identifiers Set the name of the field with unique identifiers %End - void setPostpone( bool postpone ); + void setLazy( bool lazy ); %Docstring -Sets the postpone mode. If ``postpone`` is true, then the loading is +Sets the lazy mode. If ``lazy`` is true, then the loading is delayed until an explicit reloading of the layer. -:param postpone: True to delay the loading, false otherwise +:param lazy: True to delay the loading, false otherwise .. versionadded:: 3.2 %End - bool postpone() const; + bool isLazy() const; %Docstring -Returns the postpone mode. +Returns the lazy mode. :return: True if the loading is delayed, false otherwise. diff --git a/src/core/qgsvirtuallayerdefinition.cpp b/src/core/qgsvirtuallayerdefinition.cpp index 05929797cfc..1ba6b0c3991 100644 --- a/src/core/qgsvirtuallayerdefinition.cpp +++ b/src/core/qgsvirtuallayerdefinition.cpp @@ -157,9 +157,9 @@ QgsVirtualLayerDefinition QgsVirtualLayerDefinition::fromUrl( const QUrl &url ) } } } - else if ( key == QLatin1String( "postpone" ) ) + else if ( key == QLatin1String( "lazy" ) ) { - def.setPostpone( true ); + def.setLazy( true ); } } def.setFields( fields ); @@ -213,9 +213,9 @@ QUrl QgsVirtualLayerDefinition::toUrl() const url.addQueryItem( QStringLiteral( "field" ), f.name() + ":text" ); } - if ( postpone() ) + if ( isLazy() ) { - url.addQueryItem( QStringLiteral( "postpone" ), QLatin1String( "" ) ); + url.addQueryItem( QStringLiteral( "lazy" ), QLatin1String( "" ) ); } return url; diff --git a/src/core/qgsvirtuallayerdefinition.h b/src/core/qgsvirtuallayerdefinition.h index fb8e2cdcf17..a942d7b9f0e 100644 --- a/src/core/qgsvirtuallayerdefinition.h +++ b/src/core/qgsvirtuallayerdefinition.h @@ -132,19 +132,19 @@ class CORE_EXPORT QgsVirtualLayerDefinition void setUid( const QString &uid ) { mUid = uid; } /** - * Sets the postpone mode. If \a postpone is true, then the loading is + * Sets the lazy mode. If \a lazy is true, then the loading is * delayed until an explicit reloading of the layer. - * \param postpone True to delay the loading, false otherwise + * \param lazy True to delay the loading, false otherwise * \since QGIS 3.2 */ - void setPostpone( bool postpone ) { mPostpone = postpone; } + void setLazy( bool lazy ) { mLazy = lazy; } /** - * Returns the postpone mode. + * Returns the lazy mode. * \returns True if the loading is delayed, false otherwise. * \since QGIS 3.2 */ - bool postpone() const { return mPostpone; } + bool isLazy() const { return mLazy; } //! Get the name of the geometry field. Empty if no geometry field QString geometryField() const { return mGeometryField; } @@ -189,7 +189,7 @@ class CORE_EXPORT QgsVirtualLayerDefinition QString mGeometryField; QString mFilePath; QgsFields mFields; - bool mPostpone = false; + bool mLazy = false; QgsWkbTypes::Type mGeometryWkbType = QgsWkbTypes::Unknown; long mGeometrySrid = 0; }; diff --git a/src/core/qgsvirtuallayertask.cpp b/src/core/qgsvirtuallayertask.cpp index 159ea528738..6f9a212153b 100644 --- a/src/core/qgsvirtuallayertask.cpp +++ b/src/core/qgsvirtuallayertask.cpp @@ -22,7 +22,7 @@ QgsVirtualLayerTask::QgsVirtualLayerTask( const QgsVirtualLayerDefinition &defin : QgsTask() , mDefinition( definition ) { - mDefinition.setPostpone( true ); + mDefinition.setLazy( true ); mLayer = qgis::make_unique( mDefinition.toString(), "layer", "virtual" ); } diff --git a/src/providers/virtual/qgsvirtuallayerprovider.cpp b/src/providers/virtual/qgsvirtuallayerprovider.cpp index c4ac72e853b..b71cbd327a7 100644 --- a/src/providers/virtual/qgsvirtuallayerprovider.cpp +++ b/src/providers/virtual/qgsvirtuallayerprovider.cpp @@ -76,7 +76,7 @@ QgsVirtualLayerProvider::QgsVirtualLayerProvider( QString const &uri ) { mDefinition = QgsVirtualLayerDefinition::fromUrl( url ); - if ( !mDefinition.postpone() ) + if ( !mDefinition.isLazy() ) { reloadData(); }