Skip to content

Commit

Permalink
Rename postpone option in lazy
Browse files Browse the repository at this point in the history
  • Loading branch information
pblottiere committed Mar 2, 2018
1 parent fea66f9 commit c2a2f33
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
10 changes: 5 additions & 5 deletions python/core/qgsvirtuallayerdefinition.sip.in
Expand Up @@ -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.

Expand Down
8 changes: 4 additions & 4 deletions src/core/qgsvirtuallayerdefinition.cpp
Expand Up @@ -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 );
Expand Down Expand Up @@ -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;
Expand Down
12 changes: 6 additions & 6 deletions src/core/qgsvirtuallayerdefinition.h
Expand Up @@ -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; }
Expand Down Expand Up @@ -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;
};
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsvirtuallayertask.cpp
Expand Up @@ -22,7 +22,7 @@ QgsVirtualLayerTask::QgsVirtualLayerTask( const QgsVirtualLayerDefinition &defin
: QgsTask()
, mDefinition( definition )
{
mDefinition.setPostpone( true );
mDefinition.setLazy( true );
mLayer = qgis::make_unique<QgsVectorLayer>( mDefinition.toString(), "layer", "virtual" );
}

Expand Down
2 changes: 1 addition & 1 deletion src/providers/virtual/qgsvirtuallayerprovider.cpp
Expand Up @@ -76,7 +76,7 @@ QgsVirtualLayerProvider::QgsVirtualLayerProvider( QString const &uri )
{
mDefinition = QgsVirtualLayerDefinition::fromUrl( url );

if ( !mDefinition.postpone() )
if ( !mDefinition.isLazy() )
{
reloadData();
}
Expand Down

0 comments on commit c2a2f33

Please sign in to comment.