Skip to content
Permalink
Browse files
fix warnings, add copyright headers, cosmetics
  • Loading branch information
jef-n committed Jan 28, 2013
1 parent 74ace4a commit 4cbec1811cedb187458af696b0e7896463f6fcc1
Showing with 1,067 additions and 571 deletions.
  1. +14 −0 python/core/qgsdataprovider.sip
  2. +2 −1 python/core/qgsfeature.sip
  3. +3 −3 python/core/qgsfeaturerequest.sip
  4. +33 −26 python/core/qgsvectordataprovider.sip
  5. +124 −26 python/core/qgsvectorlayer.sip
  6. +75 −70 python/core/qgsvectorlayereditbuffer.sip
  7. +2 −0 python/core/qgsvectorlayerimport.sip
  8. +0 −21 python/core/raster/qgsrasterlayer.sip
  9. +10 −8 src/app/qgsmaptoolpinlabels.cpp
  10. +1 −1 src/core/composer/qgscomposerlegend.cpp
  11. +2 −1 src/core/composer/qgscomposition.h
  12. +14 −0 src/core/qgsfeatureiterator.cpp
  13. +14 −0 src/core/qgsfeatureiterator.h
  14. +14 −0 src/core/qgsfeaturerequest.cpp
  15. +14 −0 src/core/qgsfeaturerequest.h
  16. +6 −4 src/core/qgsvectordataprovider.h
  17. +2 −2 src/core/qgsvectorlayer.cpp
  18. +3 −4 src/core/qgsvectorlayer.h
  19. +17 −3 src/core/qgsvectorlayercache.cpp
  20. +35 −21 src/core/qgsvectorlayercache.h
  21. +32 −18 src/core/qgsvectorlayereditbuffer.cpp
  22. +125 −113 src/core/qgsvectorlayereditbuffer.h
  23. +21 −7 src/core/qgsvectorlayereditutils.cpp
  24. +103 −89 src/core/qgsvectorlayereditutils.h
  25. +21 −7 src/core/qgsvectorlayerfeatureiterator.cpp
  26. +77 −63 src/core/qgsvectorlayerfeatureiterator.h
  27. +0 −2 src/core/qgswfsdata.h
  28. +0 −32 src/core/raster/qgsrasterlayer.h
  29. +1 −1 src/plugins/grass/qgsgrasstoolsbase.ui
  30. +25 −11 src/providers/delimitedtext/qgsdelimitedtextfeatureiterator.cpp
  31. +15 −1 src/providers/delimitedtext/qgsdelimitedtextfeatureiterator.h
  32. +28 −14 src/providers/gpx/qgsgpxfeatureiterator.cpp
  33. +20 −6 src/providers/gpx/qgsgpxfeatureiterator.h
  34. +14 −0 src/providers/grass/qgsgrassfeatureiterator.cpp
  35. +14 −0 src/providers/grass/qgsgrassfeatureiterator.h
  36. +14 −0 src/providers/memory/qgsmemoryfeatureiterator.cpp
  37. +14 −0 src/providers/memory/qgsmemoryfeatureiterator.h
  38. +14 −0 src/providers/ogr/qgsogrfeatureiterator.cpp
  39. +14 −0 src/providers/ogr/qgsogrfeatureiterator.h
  40. +22 −8 src/providers/osm/osmfeatureiterator.cpp
  41. +14 −0 src/providers/osm/osmfeatureiterator.h
  42. +22 −8 src/providers/postgres/qgspostgresfeatureiterator.cpp
  43. +14 −0 src/providers/postgres/qgspostgresfeatureiterator.h
  44. +14 −0 src/providers/spatialite/qgsspatialitefeatureiterator.cpp
  45. +14 −0 src/providers/spatialite/qgsspatialitefeatureiterator.h
  46. +16 −0 src/providers/wfs/qgswfsfeatureiterator.cpp
  47. +14 −0 src/providers/wfs/qgswfsfeatureiterator.h
@@ -208,4 +208,18 @@ class QgsDataProvider : QObject
*/
void fullExtentCalculated();

/**
* This is emitted whenever an asynchronous operation has finished
* and the data should be redrawn
* @note added in 1.5
*/
void dataChanged();

/**
* This is emitted whenever data or metadata (e.g. color table, extent) has changed
* @param changed binary combination of changes
* @note added in 1.7
*/
void dataChanged( int changed );

};
@@ -1,4 +1,5 @@

typedef qint64 QgsFeatureId;

// key = field index, value = field value
typedef QMap<int, QVariant> QgsAttributeMap;
@@ -189,6 +190,6 @@ class QgsFeature
*/
int fieldNameIndex( const QString& fieldName ) const;


}; // class QgsFeature

typedef QSet<QgsFeatureId> QgsFeatureIds;
@@ -16,9 +16,9 @@ class QgsFeatureRequest

enum FilterType
{
FilterNone, //!< No filter is applied
FilterRect, //!< Filter using a rectangle
FilterFid //!< Filter using feature ID
FilterNone, //!< No filter is applied
FilterRect, //!< Filter using a rectangle
FilterFid //!< Filter using feature ID
};

//! construct a default request: for all features get attributes and geometries
@@ -7,28 +7,28 @@ class QgsVectorDataProvider : QgsDataProvider

public:

// If you add to this, please also add to capabilitiesString()
/**
* enumeration with capabilities that providers might implement
*/
enum Capability
{
NoCapabilities = 0,
AddFeatures = 1,
DeleteFeatures = 2,
ChangeAttributeValues = 4,
AddAttributes = 8,
DeleteAttributes = 16,
SaveAsShapefile = 32,
CreateSpatialIndex = 64,
SelectAtId = 128,
ChangeGeometries = 256,
SelectGeometryAtId = 512,
RandomSelectGeometryAtId = 1024,
SequentialSelectGeometryAtId = 2048,
CreateAttributeIndex = 4096,
SetEncoding = 8192,
};
// If you add to this, please also add to capabilitiesString()
/**
* enumeration with capabilities that providers might implement
*/
enum Capability
{
NoCapabilities = 0,
AddFeatures = 1,
DeleteFeatures = 2,
ChangeAttributeValues = 4,
AddAttributes = 8,
DeleteAttributes = 16,
SaveAsShapefile = 32,
CreateSpatialIndex = 64,
SelectAtId = 128,
ChangeGeometries = 256,
SelectGeometryAtId = 512,
RandomSelectGeometryAtId = 1024,
SequentialSelectGeometryAtId = 2048,
CreateAttributeIndex = 4096,
SetEncoding = 8192,
};

/** bitmask of all provider's editing capabilities */
static const int EditingCapabilities;
@@ -120,7 +120,7 @@ class QgsVectorDataProvider : QgsDataProvider
* Adds a list of features
* @return true in case of success and false in case of failure
*/
virtual bool addFeatures( QList<QgsFeature> & flist /In,Out/ );
virtual bool addFeatures( QList<QgsFeature> &flist /In,Out/ );

/**
* Deletes one or more features
@@ -158,9 +158,10 @@ class QgsVectorDataProvider : QgsDataProvider

/**
* Changes geometries of existing features
* @param geometry_map A std::map containing the feature IDs to change the geometries of.
* the second map parameter being the new geometries themselves
* @return true in case of success and false in case of failure
* @param geometry_map A QgsGeometryMap whose index contains the feature IDs
* that will have their geometries changed.
* The second map parameter being the new geometries themselves
* @return True in case of success and false in case of failure
*/
virtual bool changeGeometryValues( QMap<qint64, QgsGeometry> & geometry_map );

@@ -208,6 +209,12 @@ class QgsVectorDataProvider : QgsDataProvider
*/
QList<int> attributeIndexes();

/**
* Return list of indexes of fields that make up the primary key
* @note added in 2.0
*/
virtual QList<int> pkAttributeIndexes();

/**
* Set whether provider should also return features that don't have
* associated geometry. false by default
@@ -1,9 +1,63 @@

typedef QList<int> QgsAttributeList;
typedef QSet<qint64> QgsFeatureIds;
typedef QSet<int> QgsAttributeIds;
typedef qint64 QgsFeatureId;

/** @note Added in 1.9 */
class QgsAttributeEditorElement : QObject
{
%TypeHeaderCode
#include "qgsvectorlayer.h"
%End

public:

enum AttributeEditorType
{
AeTypeContainer,
AeTypeField,
AeTypeInvalid
};

QgsAttributeEditorElement( AttributeEditorType type, QString name, QObject *parent = NULL );

virtual ~QgsAttributeEditorElement();

QString name() const;
AttributeEditorType type() const;

virtual QDomElement toDomElement( QDomDocument& doc ) const = 0;
};

/** @note Added in 1.9 */
class QgsAttributeEditorContainer : QgsAttributeEditorElement
{
%TypeHeaderCode
#include "qgsvectorlayer.h"
%End

public:
QgsAttributeEditorContainer( QString name, QObject *parent );
~QgsAttributeEditorContainer();

virtual QDomElement toDomElement( QDomDocument& doc ) const;
virtual void addChildElement( QgsAttributeEditorElement *widget );
QList<QgsAttributeEditorElement*> children() const;
};

/** @note Added in 1.9 */
class QgsAttributeEditorField : QgsAttributeEditorElement
{
%TypeHeaderCode
#include "qgsvectorlayer.h"
%End

public:
QgsAttributeEditorField( QString name , int idx, QObject *parent );
~QgsAttributeEditorField();

virtual QDomElement toDomElement( QDomDocument& doc ) const;
int idx() const;
};

/** @note added in 1.7 */
struct QgsVectorJoinInfo
@@ -52,6 +106,13 @@ class QgsVectorLayer : QgsMapLayer
}
%End

enum EditorLayout
{
GeneratedLayout,
TabLayout,
UiFileLayout,
};

enum EditType
{
LineEdit,
@@ -73,13 +134,6 @@ class QgsVectorLayer : QgsMapLayer
UuidGenerator, /* uuid generator - readonly and automatically intialized @added in 1.9 */
};

enum EditorLayout
{
GeneratedLayout,
TabLayout,
UiFileLayout,
};

struct RangeData
{
RangeData();
@@ -108,6 +162,23 @@ class QgsVectorLayer : QgsMapLayer
bool mAllowMulti; /* allow selection of multiple keys @added in 1.9 */
};

struct GroupData
{
GroupData();
GroupData( QString name , QList<QString> fields );
QString mName;
QList<QString> mFields;
};

struct TabData
{
TabData();
TabData( QString name , QList<QString> fields , QList<QgsVectorLayer::GroupData> groups );
QString mName;
QList<QString> mFields;
QList<QgsVectorLayer::GroupData> mGroups;
};

/** Constructor */
QgsVectorLayer( QString path = QString::null, QString baseName = QString::null,
QString providerLib = QString::null, bool loadDefaultStyleFlag = true );
@@ -250,6 +321,12 @@ class QgsVectorLayer : QgsMapLayer
*/
virtual bool writeXml( QDomNode & layer_node, QDomDocument & doc );

/** convert a saved attribute editor element into a AttributeEditor structure as it's used internally.
* @param elem the DOM element
* @param parent the QObject which will own this object
*/
QgsAttributeEditorElement* attributeEditorElementFromDomElement( QDomElement &elem, QObject* parent );

/** Read the symbology for the current layer from the Dom node supplied.
* @param node node that will contain the symbology definition for this layer.
* @param errorMessage reference to string that will be updated with any error messages
@@ -277,6 +354,21 @@ class QgsVectorLayer : QgsMapLayer
*/
virtual long featureCount() const;

/**
* Number of features rendered with specified symbol. Features must be first
* calculated by countSymbolFeatures()
* @param symbol the symbol
* @return number of features rendered by symbol or -1 if failed or counts are not available
*/
long featureCount( QgsSymbolV2* symbol );

/**
* Count features for symbols. Feature counts may be get by featureCount( QgsSymbolV2*).
* @param showProgress show progress dialog
* @return true if calculated, false if failed or was canceled by user
*/
bool countSymbolFeatures( bool showProgress = true );

/**
* Set the string (typically sql) used to define a subset of the layer
* @param subset The subset string. This may be the where clause of a sql statement
@@ -362,7 +454,8 @@ class QgsVectorLayer : QgsMapLayer
2 ring not closed,
3 ring not valid,
4 ring crosses existing rings,
5 no feature found where ring can be inserted*/
5 no feature found where ring can be inserted
6 layer not editable */
int addRing( const QList<QgsPoint>& ring );

/**Adds a new part polygon to a multipart feature
@@ -373,7 +466,8 @@ class QgsVectorLayer : QgsMapLayer
3 if new polygon ring not disjoint with existing rings,
4 if no feature was selected,
5 if several features are selected,
6 if selected geometry not found*/
6 if selected geometry not found
7 layer not editable */
int addPart( const QList<QgsPoint>& ring );

/**Translates feature by dx, dy
@@ -481,6 +575,11 @@ class QgsVectorLayer : QgsMapLayer
/** returns list of attributes */
QList<int> pendingAllAttributesList();

/** returns list of attribute making up the primary key
* @note added in 2.0
*/
QList<int> pendingPkAttributesList();

/** returns feature count after commit */
int pendingFeatureCount();

@@ -509,6 +608,16 @@ class QgsVectorLayer : QgsMapLayer
@note added in version 1.2*/
void addAttributeAlias( int attIndex, QString aliasString );

/**Adds a tab (for the attribute editor form) holding groups and fields
@note added in version 1.9*/
void addAttributeEditorWidget( QgsAttributeEditorElement* data );
/**Returns a list of tabs holding groups and fields
@note added in version 1.9*/
QList< QgsAttributeEditorElement* > &attributeEditorElements();
/**Clears all the tabs for the attribute editor form
@note added in version 1.9*/
void clearAttributeEditorWidgets();

/**Returns the alias of an attribute name or an empty string if there is no alias
@note added in version 1.2*/
QString attributeAlias( int attributeIndex ) const;
@@ -561,11 +670,11 @@ class QgsVectorLayer : QgsMapLayer
/**set edit type*/
void setEditType( int idx, EditType edit );

/**get editor layout**/
/** get the active layout for the attribute editor for this layer (added in 1.9) */
EditorLayout editorLayout();

/**set editor layout*/
void setEditorLayout( EditorLayout layout );
/** set the active layout for the attribute editor for this layer (added in 1.9) */
void setEditorLayout( EditorLayout editorLayout );

/** set string representing 'true' for a checkbox (added in 1.4) */
void setCheckedState( int idx, QString checked, QString notChecked );
@@ -625,7 +734,6 @@ class QgsVectorLayer : QgsMapLayer
*/
QgsVectorOverlay* findOverlayByType( const QString& typeName );


//! Buffer with uncommitted editing operations. Only valid after editing has been turned on.
QgsVectorLayerEditBuffer* editBuffer();

@@ -641,16 +749,6 @@ class QgsVectorLayer : QgsMapLayer
/** Destroy active command and reverts all changes in it */
void destroyEditCommand();

/** Execute undo operation. To be called only from QgsVectorLayerUndoCommand.
* @note not available in python bindings
*/
// void undoEditCommand( QgsUndoCommand* cmd );

/** Execute redo operation. To be called only from QgsVectorLayerUndoCommand.
* @note not available in python bindings
*/
// void redoEditCommand( QgsUndoCommand* cmd );

/** Returns the index of a field name or -1 if the field does not exist
@note this method was added in version 1.4
*/
@@ -732,7 +830,7 @@ class QgsVectorLayer : QgsMapLayer

/** Signals emitted after committing changes
\note added in v1.6 */
void committedAttributesDeleted( const QString& layerId, const QgsAttributeList& deletedAttributeIds );
void committedAttributesDeleted( const QString& layerId, const QgsAttributeList& deletedAttributes );
void committedAttributesAdded( const QString& layerId, const QList<QgsField>& addedAttributes );
void committedFeaturesAdded( const QString& layerId, const QgsFeatureList& addedFeatures );
void committedFeaturesRemoved( const QString& layerId, const QgsFeatureIds& deletedFeatureIds );
Loading

0 comments on commit 4cbec18

Please sign in to comment.