Skip to content
Permalink
Browse files

indentation update, Q_FOREACH support in astyle, doxygen fix

  • Loading branch information
jef-n committed Sep 1, 2014
1 parent 252dc37 commit 869c9069997faad3265cfea2d4c14c3a5f7a6449
Showing with 85 additions and 84 deletions.
  1. +3 −3 src/app/composer/qgscomposerlegendwidget.cpp
  2. +3 −3 src/app/ogr/qgsvectorlayersaveasdialog.cpp
  3. +7 −7 src/app/qgsfieldsproperties.cpp
  4. +3 −1 src/astyle/ASResource.cpp
  5. +1 −1 src/astyle/astyle.h
  6. +6 −6 src/core/composer/qgscomposerlegend.cpp
  7. +7 −7 src/core/layertree/qgslayertreemodellegendnode.cpp
  8. +1 −1 src/core/layertree/qgslayertreeutils.cpp
  9. +2 −2 src/core/qgsexpressionfieldbuffer.cpp
  10. +1 −1 src/core/qgsrelation.cpp
  11. +1 −1 src/core/qgsrelationmanager.cpp
  12. +6 −6 src/core/qgsvectorlayer.cpp
  13. +1 −1 src/core/qgsvectorlayercache.cpp
  14. +1 −1 src/core/qgsvectorlayerfeatureiterator.cpp
  15. +1 −1 src/gui/attributetable/qgsdualview.cpp
  16. +1 −1 src/gui/attributetable/qgsdualview.h
  17. +1 −1 src/gui/attributetable/qgsfeaturelistview.cpp
  18. +1 −1 src/gui/editorwidgets/qgsenumerationwidgetwrapper.cpp
  19. +1 −1 src/gui/editorwidgets/qgsrangewidgetwrapper.h
  20. +1 −1 src/gui/editorwidgets/qgsrelationwidgetwrapper.cpp
  21. +1 −1 src/gui/editorwidgets/qgsuniquevaluewidgetwrapper.cpp
  22. +2 −2 src/gui/editorwidgets/qgsvaluerelationwidgetfactory.cpp
  23. +3 −3 src/gui/editorwidgets/qgsvaluerelationwidgetwrapper.cpp
  24. +15 −15 src/gui/qgsattributeform.cpp
  25. +3 −3 src/gui/qgscollapsiblegroupbox.cpp
  26. +0 −1 src/gui/qgscomposerview.h
  27. +2 −2 src/gui/qgsrelationmanagerdialog.cpp
  28. +3 −3 src/gui/qgsrubberband.cpp
  29. +2 −2 src/mapserver/qgswmsserver.cpp
  30. +1 −1 src/providers/memory/qgsmemoryprovider.cpp
  31. +4 −4 tests/src/core/testqgslegendrenderer.cpp
@@ -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;
@@ -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 );
}
@@ -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;

@@ -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 );
}
@@ -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 );
}
@@ -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 );
}
@@ -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 );
}
@@ -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() );
}
@@ -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 );

@@ -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>() );
@@ -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 )
@@ -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 )
@@ -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 )
{
@@ -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");
@@ -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
}
}

@@ -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;
};
@@ -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 )
{

}
@@ -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
@@ -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 );
@@ -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() ) );
}
}

@@ -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 )
{
}

@@ -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 )
{
}

@@ -332,7 +332,7 @@ void QgsLayerTreeUtils::updateEmbeddedGroupsProjectPath( QgsLayerTreeGroup* grou

if ( QgsLayerTree::isGroup( node ) )
{
updateEmbeddedGroupsProjectPath( QgsLayerTree::toGroup( node ) );
updateEmbeddedGroupsProjectPath( QgsLayerTree::toGroup( node ) );
}
}
}
@@ -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" );

@@ -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;
@@ -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 ) )
@@ -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 );

@@ -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();
@@ -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() );
@@ -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 ) );
}
@@ -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 )
{
@@ -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 );
}
@@ -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 ) );
}
@@ -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>')" );
}
@@ -42,7 +42,7 @@ class QgsMapLayerAction;
class GUI_EXPORT QgsDualView : public QStackedWidget, private Ui::QgsDualViewBase
{
Q_OBJECT
Q_ENUMS(ViewMode)
Q_ENUMS( ViewMode )

public:

@@ -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>();
}
@@ -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 );
}
@@ -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:
@@ -24,7 +24,7 @@ QgsRelationWidgetWrapper::QgsRelationWidgetWrapper( QgsVectorLayer* vl, const Qg
, mRelation( relation )
, mWidget( NULL )
{
initWidget(editor);
initWidget( editor );
}

QWidget* QgsRelationWidgetWrapper::createWidget( QWidget* parent )
@@ -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 )
{

0 comments on commit 869c906

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