Skip to content
Permalink
Browse files

indentation update

  • Loading branch information
jef-n committed Mar 27, 2013
1 parent 3bc9484 commit 1b54e1ff87970f1722598e226f561d348cc076c5
@@ -58,9 +58,9 @@ class QgsAttributeTableDock : public QDockWidget
};

QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *theLayer, QWidget *parent, Qt::WindowFlags flags )
: QDialog( parent, flags ),
mDock( 0 ),
mLayer( theLayer )
: QDialog( parent, flags )
, mDock( 0 )
, mLayer( theLayer )
{
setupUi( this );

@@ -167,7 +167,7 @@ QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *theLayer, QWid
mMainViewButtonGroup->setId( mAttributeViewButton, QgsDualView::AttributeEditor );

// Load default attribute table filter
QgsAttributeTableFilterModel::FilterMode defaultFilterMode = (QgsAttributeTableFilterModel::FilterMode) settings.value( "/qgis/attributeTableBehaviour", QgsAttributeTableFilterModel::ShowAll ).toInt();
QgsAttributeTableFilterModel::FilterMode defaultFilterMode = ( QgsAttributeTableFilterModel::FilterMode ) settings.value( "/qgis/attributeTableBehaviour", QgsAttributeTableFilterModel::ShowAll ).toInt();

switch ( defaultFilterMode )
{
@@ -215,7 +215,7 @@ void QgsAttributeTableDialog::closeEvent( QCloseEvent* event )

void QgsAttributeTableDialog::columnBoxInit()
{
foreach( QAction* a, mFilterColumnsMenu->actions() )
foreach ( QAction* a, mFilterColumnsMenu->actions() )
{
mFilterColumnsMenu->removeAction( a );
mFilterActionMapper->removeMappings( a );
@@ -231,7 +231,7 @@ void QgsAttributeTableDialog::columnBoxInit()

QList<QgsField> fields = mLayer->pendingFields().toList();

foreach( const QgsField field, fields )
foreach ( const QgsField field, fields )
{
if ( mLayer->editType( mLayer->fieldNameIndex( field.name() ) ) != QgsVectorLayer::Hidden )
{
@@ -18,9 +18,9 @@
#include "qgsvectordataprovider.h"

QgsCachedFeatureIterator::QgsCachedFeatureIterator( QgsVectorLayerCache *vlCache, QgsFeatureRequest featureRequest, QgsFeatureIds featureIds )
: QgsAbstractFeatureIterator( featureRequest ),
mFeatureIds( featureIds ),
mVectorLayerCache( vlCache )
: QgsAbstractFeatureIterator( featureRequest )
, mFeatureIds( featureIds )
, mVectorLayerCache( vlCache )
{
mFeatureIdIterator = featureIds.begin();
}
@@ -53,8 +53,8 @@ bool QgsCachedFeatureIterator::close()
}

QgsCachedFeatureWriterIterator::QgsCachedFeatureWriterIterator( QgsVectorLayerCache *vlCache, QgsFeatureRequest featureRequest )
: QgsAbstractFeatureIterator( featureRequest ),
mVectorLayerCache( vlCache )
: QgsAbstractFeatureIterator( featureRequest )
, mVectorLayerCache( vlCache )
{
mFeatIt = vlCache->layer()->dataProvider()->getFeatures( featureRequest );
}
@@ -15,9 +15,9 @@

#include "qgscacheindexfeatureid.h"

QgsCacheIndexFeatureId::QgsCacheIndexFeatureId( QgsCachedVectorLayer* cachedVectorLayer ) :
QgsAbstractCacheIndex(),
C( cachedVectorLayer )
QgsCacheIndexFeatureId::QgsCacheIndexFeatureId( QgsCachedVectorLayer* cachedVectorLayer )
: QgsAbstractCacheIndex()
, C( cachedVectorLayer )
{

}
@@ -24,9 +24,9 @@ class QgsCacheIndexFeatureId : public QgsAbstractCacheIndex
{
public:
QgsCacheIndexFeatureId( QgsCachedVectorLayer* cachedVectorLayer );

signals:

public slots:

private:
@@ -2,8 +2,8 @@

#include "qgsvectorlayereditbuffer.h"

QgsGeometryCache::QgsGeometryCache(QgsVectorLayer* layer)
: L(layer)
QgsGeometryCache::QgsGeometryCache( QgsVectorLayer* layer )
: L( layer )
{
}

@@ -13,7 +13,7 @@ QgsGeometryCache::~QgsGeometryCache()
deleteCachedGeometries();
}

bool QgsGeometryCache::geometry(QgsFeatureId fid, QgsGeometry& geometry)
bool QgsGeometryCache::geometry( QgsFeatureId fid, QgsGeometry& geometry )
{
// no need to check changed geometries because all changed geometries are also cached

@@ -7,39 +7,39 @@

class QgsGeometryCache
{
public:
QgsGeometryCache(QgsVectorLayer* layer);
~QgsGeometryCache();
public:
QgsGeometryCache( QgsVectorLayer* layer );
~QgsGeometryCache();

inline QgsGeometryMap& cachedGeometries() { return mCachedGeometries; }
inline QgsGeometryMap& cachedGeometries() { return mCachedGeometries; }

//! fetch geometry from cache, return true if successful
bool geometry(QgsFeatureId fid, QgsGeometry& geometry);
//! fetch geometry from cache, return true if successful
bool geometry( QgsFeatureId fid, QgsGeometry& geometry );

//! store a geometry in the cache
void cacheGeometry( QgsFeatureId fid, const QgsGeometry& geom );
//! store a geometry in the cache
void cacheGeometry( QgsFeatureId fid, const QgsGeometry& geom );

//! get rid of the cached geometry
void removeGeometry( QgsFeatureId fid ) { mCachedGeometries.remove(fid); }
//! get rid of the cached geometry
void removeGeometry( QgsFeatureId fid ) { mCachedGeometries.remove( fid ); }


/** Deletes the geometries in mCachedGeometries */
void deleteCachedGeometries();
/** Deletes the geometries in mCachedGeometries */
void deleteCachedGeometries();

void setCachedGeometriesRect( const QgsRectangle& extent ) { mCachedGeometriesRect = extent; }
const QgsRectangle& cachedGeometriesRect() { return mCachedGeometriesRect; }
void setCachedGeometriesRect( const QgsRectangle& extent ) { mCachedGeometriesRect = extent; }
const QgsRectangle& cachedGeometriesRect() { return mCachedGeometriesRect; }

protected:
protected:

inline QgsVectorLayerEditBuffer* editBuffer() { return L->editBuffer(); }
inline QgsVectorLayerEditBuffer* editBuffer() { return L->editBuffer(); }

QgsVectorLayer* L;
QgsVectorLayer* L;

/** cache of the committed geometries retrieved *for the current display* */
QgsGeometryMap mCachedGeometries;
/** cache of the committed geometries retrieved *for the current display* */
QgsGeometryMap mCachedGeometries;

/** extent for which there are cached geometries */
QgsRectangle mCachedGeometriesRect;
/** extent for which there are cached geometries */
QgsRectangle mCachedGeometriesRect;

};

@@ -2986,7 +2986,7 @@ bool QgsVectorLayer::deleteAttributes( QList<int> attrs )

qSort( attrs.begin(), attrs.end(), qGreater<int>() );

foreach( int attr, attrs )
foreach ( int attr, attrs )
{
if ( deleteAttribute( attr ) )
{
@@ -3107,8 +3107,8 @@ bool QgsVectorLayer::rollBack( bool deleteBuffer )

if ( deleteBuffer )
{
delete mEditBuffer;
mEditBuffer = 0;
delete mEditBuffer;
mEditBuffer = 0;
undoStack()->clear();
}
emit editingStopped();
@@ -4160,7 +4160,7 @@ QString QgsVectorLayer::metadata()
{
myMetadata += "<tr><td>";
myMetadata += tr( "Primary key attributes: " );
foreach( int idx, pkAttrList )
foreach ( int idx, pkAttrList )
{
myMetadata += pendingFields()[ idx ].name() + " ";
}
@@ -19,9 +19,9 @@
#include "qgscacheindex.h"
#include "qgscachedfeatureiterator.h"

QgsVectorLayerCache::QgsVectorLayerCache( QgsVectorLayer* layer, int cacheSize, QObject* parent ) :
QObject( parent ),
mLayer( layer )
QgsVectorLayerCache::QgsVectorLayerCache( QgsVectorLayer* layer, int cacheSize, QObject* parent )
: QObject( parent )
, mLayer( layer )
{
mCache.setMaxCost( cacheSize );

@@ -132,10 +132,10 @@ bool QgsVectorLayerCache::featureAtId( QgsFeatureId featureId, QgsFeature& featu
featureFound = true;
}
else if ( mLayer->getFeatures( QgsFeatureRequest()
.setFilterFid( featureId )
.setSubsetOfAttributes( mCachedAttributes )
.setFilterFid( featureId )
.setSubsetOfAttributes( mCachedAttributes )
.setFlags( !mCacheGeometry ? QgsFeatureRequest::NoGeometry : QgsFeatureRequest::Flags( 0 ) ) )
.nextFeature( feature ) )
.nextFeature( feature ) )
{
cacheFeature( feature );
featureFound = true;
@@ -159,7 +159,7 @@ void QgsVectorLayerCache::requestCompleted( QgsFeatureRequest featureRequest, Qg
// If a request is too large for the cache don't notify to prevent from indexing incomplete requests
if ( fids.count() < mCache.size() )
{
foreach( QgsAbstractCacheIndex* idx, mCacheIndices )
foreach ( QgsAbstractCacheIndex* idx, mCacheIndices )
{
idx->requestCompleted( featureRequest, fids );
}
@@ -168,7 +168,7 @@ void QgsVectorLayerCache::requestCompleted( QgsFeatureRequest featureRequest, Qg

void QgsVectorLayerCache::featureRemoved( QgsFeatureId fid )
{
foreach( QgsAbstractCacheIndex* idx, mCacheIndices )
foreach ( QgsAbstractCacheIndex* idx, mCacheIndices )
{
idx->flushFeature( fid );
}
@@ -236,7 +236,7 @@ QgsFeatureIterator QgsVectorLayerCache::getFeatures( const QgsFeatureRequest &fe
if ( checkInformationCovered( featureRequest ) )
{
// Check if an index is able to deliver the requested features
foreach( QgsAbstractCacheIndex *idx, mCacheIndices )
foreach ( QgsAbstractCacheIndex *idx, mCacheIndices )
{
QgsFeatureIds featureIds;

@@ -54,8 +54,8 @@ class CORE_EXPORT QgsVectorLayerCache : public QObject
* @param feat The feature to cache. A copy will be made.
* @param vlCache The cache to inform when the feature has been removed from the cache.
*/
QgsCachedFeature( const QgsFeature& feat, QgsVectorLayerCache* vlCache ) :
mCache( vlCache )
QgsCachedFeature( const QgsFeature& feat, QgsVectorLayerCache* vlCache )
: mCache( vlCache )
{
mFeature = new QgsFeature( feat );
}
@@ -41,7 +41,7 @@ class QgsAttributeTableDelegate : public QItemDelegate
* @param parent parent object
*/
QgsAttributeTableDelegate( QObject* parent = NULL ) :
QItemDelegate( parent ) {};
QItemDelegate( parent ) {};
/** Used to create an editor for when the user tries to
* change the contents of a cell */
QWidget * createEditor(
@@ -27,11 +27,11 @@
// Filter Model //
//////////////////

QgsAttributeTableFilterModel::QgsAttributeTableFilterModel( QgsMapCanvas* canvas, QgsAttributeTableModel* sourceModel, QObject* parent ) :
QSortFilterProxyModel( parent ),
mCanvas( canvas ),
mFilterMode( ShowAll ),
mSelectedOnTop( false )
QgsAttributeTableFilterModel::QgsAttributeTableFilterModel( QgsMapCanvas* canvas, QgsAttributeTableModel* sourceModel, QObject* parent )
: QSortFilterProxyModel( parent )
, mCanvas( canvas )
, mFilterMode( ShowAll )
, mSelectedOnTop( false )
{
mMasterSelection = new QItemSelectionModel( this, this );
setSourceModel( sourceModel );
@@ -122,7 +122,7 @@ void QgsAttributeTableFilterModel::selectionChanged()

QItemSelection selection;

foreach( QgsFeatureId fid, layer()->selectedFeaturesIds() )
foreach ( QgsFeatureId fid, layer()->selectedFeaturesIds() )
{
selection.append( QItemSelectionRange( mTableModel->idToIndex( fid ) ) );
}
@@ -151,28 +151,28 @@ void QgsAttributeTableFilterModel::masterSelectionChanged( const QItemSelection
QgsFeatureIds selectedFeatureIds;
QgsFeatureIds deselectedFeatureIds;

foreach( QItemSelectionRange selectedRange, selected )
foreach ( QItemSelectionRange selectedRange, selected )
{
foreach( QModelIndex selectedModelIdx, selectedRange.indexes() )
foreach ( QModelIndex selectedModelIdx, selectedRange.indexes() )
{
selectedFeatureIds << masterModel()->rowToId( selectedModelIdx.row() );
}
}

foreach( QItemSelectionRange deselectedRange, deselected )
foreach ( QItemSelectionRange deselectedRange, deselected )
{
foreach( QModelIndex deselectedModelIdx, deselectedRange.indexes() )
foreach ( QModelIndex deselectedModelIdx, deselectedRange.indexes() )
{
deselectedFeatureIds << masterModel()->rowToId( deselectedModelIdx.row() );
}
}

// Change selection without emitting a signal
foreach( QgsFeatureId seletedFid, selectedFeatureIds )
foreach ( QgsFeatureId seletedFid, selectedFeatureIds )
{
layer()->select( seletedFid, false );
}
foreach( QgsFeatureId deselectedFid, deselectedFeatureIds )
foreach ( QgsFeatureId deselectedFid, deselectedFeatureIds )
{
layer()->deselect( deselectedFid, false );
}
@@ -31,7 +31,7 @@
#include <limits>

QgsAttributeTableModel::QgsAttributeTableModel( QgsVectorLayerCache *layerCache, QObject *parent )
: QAbstractTableModel( parent ),
: QAbstractTableModel( parent ),
mLayerCache( layerCache )
{
QgsDebugMsg( "entered." );
@@ -52,7 +52,7 @@ QgsAttributeTableModel::~QgsAttributeTableModel()
const QgsFields& fields = layer()->pendingFields();
for ( int idx = 0; idx < fields.count(); ++idx )
{
if ( layer()->editType( idx ) != QgsVectorLayer::ValueRelation )
if ( layer()->editType( idx ) != QgsVectorLayer::ValueRelation )
continue;

delete mValueMaps.take( idx );

0 comments on commit 1b54e1f

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