Skip to content

Commit

Permalink
indentation update
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Mar 27, 2013
1 parent 3bc9484 commit 1b54e1f
Show file tree
Hide file tree
Showing 23 changed files with 138 additions and 134 deletions.
12 changes: 6 additions & 6 deletions src/app/qgsattributetabledialog.cpp
Expand Up @@ -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 );

Expand Down Expand Up @@ -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 )
{
Expand Down Expand Up @@ -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 );
Expand All @@ -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 )
{
Expand Down
10 changes: 5 additions & 5 deletions src/core/qgscachedfeatureiterator.cpp
Expand Up @@ -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();
}
Expand Down Expand Up @@ -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 );
}
Expand Down
6 changes: 3 additions & 3 deletions src/core/qgscacheindexfeatureid.cpp
Expand Up @@ -15,9 +15,9 @@

#include "qgscacheindexfeatureid.h"

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

}
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgscacheindexfeatureid.h
Expand Up @@ -24,9 +24,9 @@ class QgsCacheIndexFeatureId : public QgsAbstractCacheIndex
{
public:
QgsCacheIndexFeatureId( QgsCachedVectorLayer* cachedVectorLayer );

signals:

public slots:

private:
Expand Down
6 changes: 3 additions & 3 deletions src/core/qgsgeometrycache.cpp
Expand Up @@ -2,8 +2,8 @@

#include "qgsvectorlayereditbuffer.h"

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

Expand All @@ -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

Expand Down
42 changes: 21 additions & 21 deletions src/core/qgsgeometrycache.h
Expand Up @@ -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;

};

Expand Down
8 changes: 4 additions & 4 deletions src/core/qgsvectorlayer.cpp
Expand Up @@ -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 ) )
{
Expand Down Expand Up @@ -3107,8 +3107,8 @@ bool QgsVectorLayer::rollBack( bool deleteBuffer )

if ( deleteBuffer )
{
delete mEditBuffer;
mEditBuffer = 0;
delete mEditBuffer;
mEditBuffer = 0;
undoStack()->clear();
}
emit editingStopped();
Expand Down Expand Up @@ -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() + " ";
}
Expand Down
18 changes: 9 additions & 9 deletions src/core/qgsvectorlayercache.cpp
Expand Up @@ -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 );

Expand Down Expand Up @@ -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;
Expand All @@ -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 );
}
Expand All @@ -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 );
}
Expand Down Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsvectorlayercache.h
Expand Up @@ -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 );
}
Expand Down
2 changes: 1 addition & 1 deletion src/gui/attributetable/qgsattributetabledelegate.h
Expand Up @@ -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(
Expand Down
24 changes: 12 additions & 12 deletions src/gui/attributetable/qgsattributetablefiltermodel.cpp
Expand Up @@ -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 );
Expand Down Expand Up @@ -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 ) ) );
}
Expand Down Expand Up @@ -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 );
}
Expand Down
4 changes: 2 additions & 2 deletions src/gui/attributetable/qgsattributetablemodel.cpp
Expand Up @@ -31,7 +31,7 @@
#include <limits>

QgsAttributeTableModel::QgsAttributeTableModel( QgsVectorLayerCache *layerCache, QObject *parent )
: QAbstractTableModel( parent ),
: QAbstractTableModel( parent ),
mLayerCache( layerCache )
{
QgsDebugMsg( "entered." );
Expand All @@ -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 );
Expand Down

0 comments on commit 1b54e1f

Please sign in to comment.