Skip to content

Commit

Permalink
indentation update, Q_FOREACH support in astyle, doxygen fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Sep 1, 2014
1 parent 252dc37 commit 869c906
Show file tree
Hide file tree
Showing 31 changed files with 85 additions and 84 deletions.
6 changes: 3 additions & 3 deletions src/app/composer/qgscomposerlegendwidget.cpp
Expand Up @@ -74,7 +74,7 @@ class QgsComposerLegendMenuProvider : public QObject, public QgsLayerTreeViewMen
QAction* action = menu->addAction( QgsComposerLegendStyle::styleLabel( style ), mWidget, SLOT( setCurrentNodeStyleFromAction() ) );
action->setCheckable( true );
action->setChecked( currentStyle == style );
action->setData( ( int ) style );
action->setData(( int ) style );
}

return menu;
Expand Down Expand Up @@ -570,7 +570,7 @@ void QgsComposerLegendWidget::on_mCheckBoxAutoUpdate_stateChanged( int state )
// do not allow editing of model if auto update is on - we would modify project's layer tree
QList<QWidget*> widgets;
widgets << mMoveDownToolButton << mMoveUpToolButton << mRemoveToolButton << mAddToolButton
<< mEditPushButton << mCountToolButton << mUpdateAllPushButton << mAddGroupToolButton;
<< mEditPushButton << mCountToolButton << mUpdateAllPushButton << mAddGroupToolButton;
foreach ( QWidget* w, widgets )
w->setEnabled( state != Qt::Checked );
}
Expand Down Expand Up @@ -732,7 +732,7 @@ void QgsComposerLegendWidget::on_mEditPushButton_clicked()

bool ok;
QString newText = QInputDialog::getText( this, tr( "Legend item properties" ), tr( "Item text" ),
QLineEdit::Normal, currentText, &ok );
QLineEdit::Normal, currentText, &ok );
if ( !ok || newText == currentText )
return;

Expand Down
6 changes: 3 additions & 3 deletions src/app/ogr/qgsvectorlayersaveasdialog.cpp
Expand Up @@ -128,7 +128,7 @@ QList<QPair<QLabel*, QWidget*> > QgsVectorLayerSaveAsDialog::createControls( con
QgsVectorFileWriter::SetOption* opt = dynamic_cast<QgsVectorFileWriter::SetOption*>( option );
QComboBox* cb = new QComboBox();
cb->setObjectName( it.key() );
Q_FOREACH( const QString& val, opt->values )
Q_FOREACH ( const QString& val, opt->values )
{
cb->addItem( val, val );
}
Expand Down Expand Up @@ -256,7 +256,7 @@ void QgsVectorLayerSaveAsDialog::on_mFormatComboBox_currentIndexChanged( int idx

QFormLayout* datasourceLayout = dynamic_cast<QFormLayout*>( mDatasourceOptionsGroupBox->layout() );

Q_FOREACH( const LabelControlPair& control, controls )
Q_FOREACH ( const LabelControlPair& control, controls )
{
datasourceLayout->addRow( control.first, control.second );
}
Expand All @@ -273,7 +273,7 @@ void QgsVectorLayerSaveAsDialog::on_mFormatComboBox_currentIndexChanged( int idx

QFormLayout* layerOptionsLayout = dynamic_cast<QFormLayout*>( mLayerOptionsGroupBox->layout() );

Q_FOREACH( const LabelControlPair& control, controls )
Q_FOREACH ( const LabelControlPair& control, controls )
{
layerOptionsLayout->addRow( control.first, control.second );
}
Expand Down
14 changes: 7 additions & 7 deletions src/app/qgsfieldsproperties.cpp
Expand Up @@ -161,7 +161,7 @@ QTreeWidgetItem *QgsFieldsProperties::loadAttributeEditorTreeItem( QgsAttributeE

const QgsAttributeEditorContainer* container = dynamic_cast<const QgsAttributeEditorContainer*>( widgetDef );

Q_FOREACH( QgsAttributeEditorElement* wdg, container->children() )
Q_FOREACH ( QgsAttributeEditorElement* wdg, container->children() )
{
loadAttributeEditorTreeItem( wdg, newWidget );
}
Expand All @@ -185,7 +185,7 @@ void QgsFieldsProperties::loadAttributeEditorTree()
mDesignerTree->setAcceptDrops( true );
mDesignerTree->setDragDropMode( QAbstractItemView::DragDrop );

Q_FOREACH( QgsAttributeEditorElement* wdg, mLayer->attributeEditorElements() )
Q_FOREACH ( QgsAttributeEditorElement* wdg, mLayer->attributeEditorElements() )
{
loadAttributeEditorTreeItem( wdg, mDesignerTree->invisibleRootItem() );
}
Expand Down Expand Up @@ -270,7 +270,7 @@ void QgsFieldsProperties::loadRelations()

int idx = 0;

Q_FOREACH( const QgsRelation& relation, relations )
Q_FOREACH ( const QgsRelation& relation, relations )
{
mRelationsList->insertRow( idx );

Expand Down Expand Up @@ -308,7 +308,7 @@ void QgsFieldsProperties::on_mAddItemButton_clicked()
if ( parent->data( 0, DesignerTreeRole ).value<DesignerTreeItemData>().type() != DesignerTreeItemData::Container )
return;

Q_FOREACH( QTableWidgetItem* item, listItems )
Q_FOREACH ( QTableWidgetItem* item, listItems )
{
if ( item->column() == 0 ) // Information is in the first column
mDesignerTree->addItem( parent , item->data( DesignerTreeRole ).value<DesignerTreeItemData>() );
Expand Down Expand Up @@ -407,7 +407,7 @@ void QgsFieldsProperties::attributeTypeDialog()
int index = -1;
int row = -1;

Q_FOREACH( QTableWidgetItem* wdg, mIndexedWidgets )
Q_FOREACH ( QTableWidgetItem* wdg, mIndexedWidgets )
{
cfg = wdg->data( FieldConfigRole ).value<FieldConfig>();
if ( cfg.mButton == pb )
Expand Down Expand Up @@ -826,7 +826,7 @@ QMimeData* QgsFieldsProperties::DragList::mimeData( const QList<QTableWidgetItem
QByteArray encoded;
QDataStream stream( &encoded, QIODevice::WriteOnly );

Q_FOREACH( const QTableWidgetItem* item, items )
Q_FOREACH ( const QTableWidgetItem* item, items )
{
// Relevant information is always in the UserRole of the first column
if ( item && item->column() == 0 )
Expand Down Expand Up @@ -996,7 +996,7 @@ QMimeData* QgsFieldsProperties::DesignerTree::mimeData( const QList<QTreeWidgetI
QByteArray encoded;
QDataStream stream( &encoded, QIODevice::WriteOnly );

Q_FOREACH( const QTreeWidgetItem* item, items )
Q_FOREACH ( const QTreeWidgetItem* item, items )
{
if ( item )
{
Expand Down
4 changes: 3 additions & 1 deletion src/astyle/ASResource.cpp
Expand Up @@ -125,6 +125,7 @@ const string ASResource::AS_COMMA = string(",");
const string ASResource::AS_SEMICOLON = string(";");

const string ASResource::AS_FOREACH = string("foreach");
const string ASResource::AS_Q_FOREACH = string("Q_FOREACH");
const string ASResource::AS_LOCK = string("lock");
const string ASResource::AS_UNSAFE = string("unsafe");
const string ASResource::AS_FIXED = string("fixed");
Expand Down Expand Up @@ -233,7 +234,8 @@ void ASResource::buildHeaders(vector<const string*> &headers, int fileType, bool

if ( fileType == C_TYPE )
{
headers.push_back(&AS_FOREACH); // Qt macro
headers.push_back(&AS_FOREACH); // Qt macro
headers.push_back(&AS_Q_FOREACH); // Qt macro
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/astyle/astyle.h
Expand Up @@ -135,7 +135,7 @@ class ASResource
static const string AS_NOT, AS_BIT_XOR, AS_BIT_OR, AS_BIT_AND, AS_BIT_NOT;
static const string AS_QUESTION, AS_COLON, AS_SEMICOLON, AS_COMMA;
static const string AS_ASM;
static const string AS_FOREACH, AS_LOCK, AS_UNSAFE, AS_FIXED;
static const string AS_FOREACH, AS_LOCK, AS_UNSAFE, AS_FIXED, AS_Q_FOREACH;
static const string AS_GET, AS_SET, AS_ADD, AS_REMOVE;
static const string AS_CONST_CAST, AS_DYNAMIC_CAST, AS_REINTERPRET_CAST, AS_STATIC_CAST;
};
Expand Down
12 changes: 6 additions & 6 deletions src/core/composer/qgscomposerlegend.cpp
Expand Up @@ -44,10 +44,10 @@ QgsComposerLegend::QgsComposerLegend( QgsComposition* composition )
}

QgsComposerLegend::QgsComposerLegend()
: QgsComposerItem( 0 )
, mLegendModel2( 0 )
, mCustomLayerTree( 0 )
, mComposerMap( 0 )
: QgsComposerItem( 0 )
, mLegendModel2( 0 )
, mCustomLayerTree( 0 )
, mComposerMap( 0 )
{

}
Expand Down Expand Up @@ -142,7 +142,7 @@ void QgsComposerLegend::setAutoUpdateModel( bool autoUpdate )
if ( autoUpdate == autoUpdateModel() )
return;

setCustomLayerTree( autoUpdate ? 0 : QgsLayerTree::toGroup( QgsProject::instance()->layerTreeRoot()->clone() ) );
setCustomLayerTree( autoUpdate ? 0 : QgsLayerTree::toGroup( QgsProject::instance()->layerTreeRoot()->clone() ) );
}

bool QgsComposerLegend::autoUpdateModel() const
Expand Down Expand Up @@ -437,7 +437,7 @@ void QgsComposerLegend::invalidateCurrentMap()
#include "qgsvectorlayer.h"

QgsLegendModelV2::QgsLegendModelV2( QgsLayerTreeGroup* rootNode, QObject* parent )
: QgsLayerTreeModel( rootNode, parent )
: QgsLayerTreeModel( rootNode, parent )
{
setFlag( QgsLayerTreeModel::AllowSymbologyChangeState, false );
setFlag( QgsLayerTreeModel::AllowNodeReorder, true );
Expand Down
14 changes: 7 additions & 7 deletions src/core/layertree/qgslayertreemodellegendnode.cpp
Expand Up @@ -301,13 +301,13 @@ void QgsSymbolV2LegendNode::updateLabel()
{
mLabel = mUserLabel.isEmpty() ? mLayerNode->layerName() : mUserLabel;
if ( showFeatureCount && vl && vl->pendingFeatureCount() >= 0 )
mLabel += QString( " [%1]" ).arg( vl->pendingFeatureCount() );
mLabel += QString( " [%1]" ).arg( vl->pendingFeatureCount() );
}
else
{
mLabel = mUserLabel.isEmpty() ? mItem.label() : mUserLabel;
if ( showFeatureCount && vl && mItem.legacyRuleKey() )
mLabel += QString( " [%1]" ).arg( vl->featureCount( mItem.legacyRuleKey() ) );
mLabel += QString( " [%1]" ).arg( vl->featureCount( mItem.legacyRuleKey() ) );
}
}

Expand Down Expand Up @@ -337,8 +337,8 @@ QVariant QgsSimpleLegendNode::data( int role ) const
// -------------------------------------------------------------------------

QgsImageLegendNode::QgsImageLegendNode( QgsLayerTreeLayer* nodeLayer, const QImage& img, QObject* parent )
: QgsLayerTreeModelLegendNode( nodeLayer, parent )
, mImage( img )
: QgsLayerTreeModelLegendNode( nodeLayer, parent )
, mImage( img )
{
}

Expand Down Expand Up @@ -370,9 +370,9 @@ QSizeF QgsImageLegendNode::drawSymbol( const QgsLegendSettings& settings, ItemCo
// -------------------------------------------------------------------------

QgsRasterSymbolLegendNode::QgsRasterSymbolLegendNode( QgsLayerTreeLayer* nodeLayer, const QColor& color, const QString& label, QObject* parent )
: QgsLayerTreeModelLegendNode( nodeLayer, parent )
, mColor( color )
, mLabel( label )
: QgsLayerTreeModelLegendNode( nodeLayer, parent )
, mColor( color )
, mLabel( label )
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/core/layertree/qgslayertreeutils.cpp
Expand Up @@ -332,7 +332,7 @@ void QgsLayerTreeUtils::updateEmbeddedGroupsProjectPath( QgsLayerTreeGroup* grou

if ( QgsLayerTree::isGroup( node ) )
{
updateEmbeddedGroupsProjectPath( QgsLayerTree::toGroup( node ) );
updateEmbeddedGroupsProjectPath( QgsLayerTree::toGroup( node ) );
}
}
}
4 changes: 2 additions & 2 deletions src/core/qgsexpressionfieldbuffer.cpp
Expand Up @@ -38,7 +38,7 @@ void QgsExpressionFieldBuffer::writeXml( QDomNode& layerNode, QDomDocument& docu
QDomElement expressionFieldsElem = document.createElement( "expressionfields" );
layerNode.appendChild( expressionFieldsElem );

Q_FOREACH( const ExpressionField& fld, mExpressions )
Q_FOREACH ( const ExpressionField& fld, mExpressions )
{
QDomElement fldElem = document.createElement( "field" );

Expand Down Expand Up @@ -83,7 +83,7 @@ void QgsExpressionFieldBuffer::readXml( const QDomNode& layerNode )
void QgsExpressionFieldBuffer::updateFields( QgsFields& flds )
{
int index = 0;
Q_FOREACH( const ExpressionField& fld, mExpressions )
Q_FOREACH ( const ExpressionField& fld, mExpressions )
{
flds.appendExpressionField( fld.field, index );
++index;
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsrelation.cpp
Expand Up @@ -241,7 +241,7 @@ void QgsRelation::updateRelationStatus()
mValid = false;
}

Q_FOREACH( const FieldPair& fieldPair, mFieldPairs )
Q_FOREACH ( const FieldPair& fieldPair, mFieldPairs )
{
if ( -1 == mReferencingLayer->fieldNameIndex( fieldPair.first )
|| -1 == mReferencedLayer->fieldNameIndex( fieldPair.second ) )
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsrelationmanager.cpp
Expand Up @@ -175,7 +175,7 @@ void QgsRelationManager::writeProject( QDomDocument & doc )

void QgsRelationManager::layersRemoved( const QStringList& layers )
{
Q_FOREACH( const QString& layer, layers )
Q_FOREACH ( const QString& layer, layers )
{
QMapIterator<QString, QgsRelation> it( mRelations );

Expand Down
12 changes: 6 additions & 6 deletions src/core/qgsvectorlayer.cpp
Expand Up @@ -2824,10 +2824,10 @@ void QgsVectorLayer::uniqueValues( int index, QList<QVariant> &uniqueValues, int
if ( mEditBuffer )
{
QSet<QString> vals;
Q_FOREACH( const QVariant& v, uniqueValues )
Q_FOREACH ( const QVariant& v, uniqueValues )
vals << v.toString();

QMapIterator< QgsFeatureId, QgsAttributeMap > it ( mEditBuffer->changedAttributeValues() );
QMapIterator< QgsFeatureId, QgsAttributeMap > it( mEditBuffer->changedAttributeValues() );
while ( it.hasNext() && ( limit < 0 || uniqueValues.count() < limit ) )
{
it.next();
Expand Down Expand Up @@ -3548,13 +3548,13 @@ void QgsVectorLayer::invalidateSymbolCountedFlag()

void QgsVectorLayer::onRelationsLoaded()
{
Q_FOREACH( QgsAttributeEditorElement* elem, mAttributeEditorElements )
Q_FOREACH ( QgsAttributeEditorElement* elem, mAttributeEditorElements )
{
if ( elem->type() == QgsAttributeEditorElement::AeTypeContainer )
{
QgsAttributeEditorContainer* cont = dynamic_cast< QgsAttributeEditorContainer* >( elem );
QList<QgsAttributeEditorElement*> relations = cont->findElements( QgsAttributeEditorElement::AeTypeRelation );
Q_FOREACH( QgsAttributeEditorElement* relElem, relations )
Q_FOREACH ( QgsAttributeEditorElement* relElem, relations )
{
QgsAttributeEditorRelation* rel = dynamic_cast< QgsAttributeEditorRelation* >( relElem );
rel->init( QgsProject::instance()->relationManager() );
Expand Down Expand Up @@ -3604,7 +3604,7 @@ QDomElement QgsAttributeEditorContainer::toDomElement( QDomDocument& doc ) const
QDomElement elem = doc.createElement( "attributeEditorContainer" );
elem.setAttribute( "name", mName );

Q_FOREACH( QgsAttributeEditorElement* child, mChildren )
Q_FOREACH ( QgsAttributeEditorElement* child, mChildren )
{
elem.appendChild( child->toDomElement( doc ) );
}
Expand All @@ -3620,7 +3620,7 @@ QList<QgsAttributeEditorElement*> QgsAttributeEditorContainer::findElements( Qgs
{
QList<QgsAttributeEditorElement*> results;

Q_FOREACH( QgsAttributeEditorElement* elem, mChildren )
Q_FOREACH ( QgsAttributeEditorElement* elem, mChildren )
{
if ( elem->type() == type )
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsvectorlayercache.cpp
Expand Up @@ -184,7 +184,7 @@ void QgsVectorLayerCache::requestCompleted( QgsFeatureRequest featureRequest, Qg

void QgsVectorLayerCache::featureRemoved( QgsFeatureId fid )
{
Q_FOREACH( QgsAbstractCacheIndex* idx, mCacheIndices )
Q_FOREACH ( QgsAbstractCacheIndex* idx, mCacheIndices )
{
idx->flushFeature( fid );
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsvectorlayerfeatureiterator.cpp
Expand Up @@ -502,7 +502,7 @@ void QgsVectorLayerFeatureIterator::prepareExpressions()
if ( mRequest.flags() & QgsFeatureRequest::SubsetOfAttributes )
{
QgsAttributeList attrs;
Q_FOREACH( const QString& col, exp->referencedColumns() )
Q_FOREACH ( const QString& col, exp->referencedColumns() )
{
attrs.append( mSource->mFields.fieldNameIndex( col ) );
}
Expand Down
2 changes: 1 addition & 1 deletion src/gui/attributetable/qgsdualview.cpp
Expand Up @@ -114,7 +114,7 @@ void QgsDualView::columnBoxInit()
// ... If there are primary key(s) defined
QStringList pkFields;

Q_FOREACH( int attr, pkAttrs )
Q_FOREACH ( int attr, pkAttrs )
{
pkFields.append( "COALESCE(\"" + fields[attr].name() + "\", '<NULL>')" );
}
Expand Down
2 changes: 1 addition & 1 deletion src/gui/attributetable/qgsdualview.h
Expand Up @@ -42,7 +42,7 @@ class QgsMapLayerAction;
class GUI_EXPORT QgsDualView : public QStackedWidget, private Ui::QgsDualViewBase
{
Q_OBJECT
Q_ENUMS(ViewMode)
Q_ENUMS( ViewMode )

public:

Expand Down
2 changes: 1 addition & 1 deletion src/gui/attributetable/qgsfeaturelistview.cpp
Expand Up @@ -100,7 +100,7 @@ QString QgsFeatureListView::parserErrorString()
QgsFeatureIds QgsFeatureListView::currentEditSelection()
{
QgsFeatureIds selection;
Q_FOREACH( QModelIndex idx, mCurrentEditSelectionModel->selectedIndexes() )
Q_FOREACH ( QModelIndex idx, mCurrentEditSelectionModel->selectedIndexes() )
{
selection << idx.data( QgsAttributeTableModel::FeatureIdRole ).value<QgsFeatureId>();
}
Expand Down
2 changes: 1 addition & 1 deletion src/gui/editorwidgets/qgsenumerationwidgetwrapper.cpp
Expand Up @@ -48,7 +48,7 @@ void QgsEnumerationWidgetWrapper::initWidget( QWidget* editor )
QStringList enumValues;
layer()->dataProvider()->enumValues( fieldIdx(), enumValues );

Q_FOREACH( const QString& s, enumValues )
Q_FOREACH ( const QString& s, enumValues )
{
mComboBox->addItem( s, s );
}
Expand Down
2 changes: 1 addition & 1 deletion src/gui/editorwidgets/qgsrangewidgetwrapper.h
Expand Up @@ -28,7 +28,7 @@ class GUI_EXPORT QgsRangeWidgetWrapper : public QgsEditorWidgetWrapper
{
Q_OBJECT
public:
explicit QgsRangeWidgetWrapper ( QgsVectorLayer* vl, int fieldIdx, QWidget* editor, QWidget* parent = 0 );
explicit QgsRangeWidgetWrapper( QgsVectorLayer* vl, int fieldIdx, QWidget* editor, QWidget* parent = 0 );

// QgsEditorWidgetWrapper interface
public:
Expand Down
2 changes: 1 addition & 1 deletion src/gui/editorwidgets/qgsrelationwidgetwrapper.cpp
Expand Up @@ -24,7 +24,7 @@ QgsRelationWidgetWrapper::QgsRelationWidgetWrapper( QgsVectorLayer* vl, const Qg
, mRelation( relation )
, mWidget( NULL )
{
initWidget(editor);
initWidget( editor );
}

QWidget* QgsRelationWidgetWrapper::createWidget( QWidget* parent )
Expand Down
2 changes: 1 addition & 1 deletion src/gui/editorwidgets/qgsuniquevaluewidgetwrapper.cpp
Expand Up @@ -56,7 +56,7 @@ void QgsUniqueValuesWidgetWrapper::initWidget( QWidget* editor )

layer()->uniqueValues( fieldIdx(), values );

Q_FOREACH( QVariant v, values )
Q_FOREACH ( QVariant v, values )
{
if ( mComboBox )
{
Expand Down

0 comments on commit 869c906

Please sign in to comment.