Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #5215 from m-kuhn/metaCode
Doxymentation and de-noising
  • Loading branch information
m-kuhn committed Sep 18, 2017
2 parents 15bc5ed + d8de869 commit b9a7000
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 21 deletions.
7 changes: 4 additions & 3 deletions python/core/qgsvectorlayer.sip
Expand Up @@ -349,19 +349,20 @@ class QgsVectorLayer : QgsMapLayer, QgsExpressionContextGenerator, QgsFeatureSin

QString storageType() const;
%Docstring
Returns the permanent storage type for this layer as a friendly name.
Returns the permanent storage type for this layer as a friendly name.
This is obtained from the data provider and does not follow any standard.
:rtype: str
%End

QString capabilitiesString() const;
%Docstring
Capabilities for this layer in a friendly format.
Capabilities for this layer, comma separated and translated.
:rtype: str
%End

QString dataComment() const;
%Docstring
Returns a comment for the data in the layer
Returns a description for this layer as defined in the data provider.
:rtype: str
%End

Expand Down
15 changes: 0 additions & 15 deletions src/core/qgsvectordataprovider.cpp
Expand Up @@ -209,92 +209,77 @@ QString QgsVectorDataProvider::capabilitiesString() const
if ( abilities & QgsVectorDataProvider::AddFeatures )
{
abilitiesList += tr( "Add Features" );
QgsDebugMsg( "Capability: Add Features" );
}

if ( abilities & QgsVectorDataProvider::DeleteFeatures )
{
abilitiesList += tr( "Delete Features" );
QgsDebugMsg( "Capability: Delete Features" );
}

if ( abilities & QgsVectorDataProvider::ChangeAttributeValues )
{
abilitiesList += tr( "Change Attribute Values" );
QgsDebugMsg( "Capability: Change Attribute Values" );
}

if ( abilities & QgsVectorDataProvider::AddAttributes )
{
abilitiesList += tr( "Add Attributes" );
QgsDebugMsg( "Capability: Add Attributes" );
}

if ( abilities & QgsVectorDataProvider::DeleteAttributes )
{
abilitiesList += tr( "Delete Attributes" );
QgsDebugMsg( "Capability: Delete Attributes" );
}

if ( abilities & QgsVectorDataProvider::RenameAttributes )
{
abilitiesList += tr( "Rename Attributes" );
QgsDebugMsg( "Capability: Rename Attributes" );
}

if ( abilities & QgsVectorDataProvider::CreateSpatialIndex )
{
// TODO: Tighten up this test. See QgsOgrProvider for details.
abilitiesList += tr( "Create Spatial Index" );
QgsDebugMsg( "Capability: Create Spatial Index" );
}

if ( abilities & QgsVectorDataProvider::CreateAttributeIndex )
{
abilitiesList += tr( "Create Attribute Indexes" );
QgsDebugMsg( "Capability: Create Attribute Index" );
}

if ( abilities & QgsVectorDataProvider::SelectAtId )
{
abilitiesList += tr( "Fast Access to Features at ID" );
QgsDebugMsg( "Capability: Select at ID" );
}

if ( abilities & QgsVectorDataProvider::ChangeGeometries )
{
abilitiesList += tr( "Change Geometries" );
QgsDebugMsg( "Capability: Change Geometries" );
}

if ( abilities & QgsVectorDataProvider::SimplifyGeometries )
{
abilitiesList += tr( "Presimplify Geometries" );
QgsDebugMsg( "Capability: Simplify Geometries before fetching the feature" );
}

if ( abilities & QgsVectorDataProvider::SimplifyGeometriesWithTopologicalValidation )
{
abilitiesList += tr( "Presimplify Geometries with Validity Check" );
QgsDebugMsg( "Capability: Simplify Geometries before fetch the feature ensuring that the result is a valid geometry" );
}

if ( abilities & QgsVectorDataProvider::ChangeFeatures )
{
abilitiesList += tr( "Simultaneous Geometry and Attribute Updates" );
QgsDebugMsg( "Capability: change both feature attributes and geometry at once" );
}

if ( abilities & QgsVectorDataProvider::TransactionSupport )
{
abilitiesList += tr( "Transactions" );
QgsDebugMsg( "Capability: transactions" );
}

if ( abilities & QgsVectorDataProvider::CircularGeometries )
{
abilitiesList += tr( "Curved Geometries" );
QgsDebugMsg( "Supports circular geometry types (circularstring, compoundcurve, curvepolygon)" );
}

return abilitiesList.join( QStringLiteral( ", " ) );
Expand Down
13 changes: 10 additions & 3 deletions src/core/qgsvectorlayer.h
Expand Up @@ -413,13 +413,20 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
*/
virtual QgsVectorLayer *clone() const override SIP_FACTORY;

//! Returns the permanent storage type for this layer as a friendly name.
/**
* Returns the permanent storage type for this layer as a friendly name.
* This is obtained from the data provider and does not follow any standard.
*/
QString storageType() const;

//! Capabilities for this layer in a friendly format.
/**
* Capabilities for this layer, comma separated and translated.
*/
QString capabilitiesString() const;

//! Returns a comment for the data in the layer
/**
* Returns a description for this layer as defined in the data provider.
*/
QString dataComment() const;

/**
Expand Down

0 comments on commit b9a7000

Please sign in to comment.