Rename postpone option in lazy

This commit is contained in:
Blottiere Paul 2018-02-05 10:25:44 +00:00
parent fea66f9913
commit c2a2f33288
5 changed files with 17 additions and 17 deletions

View File

@ -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.

View File

@ -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;

View File

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

View File

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

View File

@ -76,7 +76,7 @@ QgsVirtualLayerProvider::QgsVirtualLayerProvider( QString const &uri )
{
mDefinition = QgsVirtualLayerDefinition::fromUrl( url );
if ( !mDefinition.postpone() )
if ( !mDefinition.isLazy() )
{
reloadData();
}