Skip to content
Permalink
Browse files

Rename postpone option in lazy

  • Loading branch information
pblottiere committed Mar 2, 2018
1 parent fea66f9 commit c2a2f3328831611fba3f422cbf168d33a86c721e
@@ -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.

@@ -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;
@@ -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;
};
@@ -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" );
}

@@ -76,7 +76,7 @@ QgsVirtualLayerProvider::QgsVirtualLayerProvider( QString const &uri )
{
mDefinition = QgsVirtualLayerDefinition::fromUrl( url );

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

0 comments on commit c2a2f33

Please sign in to comment.
You can’t perform that action at this time.