Skip to content

Commit

Permalink
indentation update
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed May 24, 2014
1 parent 29e4aea commit 43dfb9c
Show file tree
Hide file tree
Showing 56 changed files with 168 additions and 162 deletions.
7 changes: 4 additions & 3 deletions src/app/composer/qgscomposer.cpp 100755 → 100644
Expand Up @@ -3481,7 +3481,8 @@ void QgsComposer::updateAtlasMapLayerAction( bool atlasEnabled )

void QgsComposer::loadAtlasPredefinedScalesFromProject()
{
if ( !mComposition ) {
if ( !mComposition )
{
return;
}
QgsAtlasComposition& atlasMap = mComposition->atlasComposition();
Expand All @@ -3499,8 +3500,8 @@ void QgsComposer::loadAtlasPredefinedScalesFromProject()

for ( QStringList::const_iterator scaleIt = scales.constBegin(); scaleIt != scales.constEnd(); ++scaleIt )
{
QStringList parts(scaleIt->split(':'));
if (parts.size() == 2)
QStringList parts( scaleIt->split( ':' ) );
if ( parts.size() == 2 )
{
pScales.push_back( parts[1].toDouble() );
}
Expand Down
4 changes: 2 additions & 2 deletions src/app/composer/qgscomposermapwidget.cpp
Expand Up @@ -199,7 +199,7 @@ void QgsComposerMapWidget::on_mAtlasMarginRadio_toggled( bool checked )
{
mAtlasMarginSpinBox->setEnabled( checked );

if (checked && mComposerMap)
if ( checked && mComposerMap )
{
mComposerMap->setAtlasScalingMode( QgsComposerMap::Auto );
updateMapForAtlas();
Expand All @@ -224,7 +224,7 @@ void QgsComposerMapWidget::on_mAtlasFixedScaleRadio_toggled( bool checked )
return;
}

if (checked)
if ( checked )
{
mComposerMap->setAtlasScalingMode( QgsComposerMap::Fixed );
updateMapForAtlas();
Expand Down
2 changes: 1 addition & 1 deletion src/app/legend/qgsapplegendinterface.cpp
Expand Up @@ -324,7 +324,7 @@ bool QgsAppLegendInterface::removeLegendLayerAction( QAction* action )
if ( !menuProvider )
return false;

menuProvider->removeLegendLayerAction( action );
return menuProvider->removeLegendLayerAction( action );
}

QgsMapLayer* QgsAppLegendInterface::currentLayer()
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgsattributetabledialog.cpp
Expand Up @@ -225,9 +225,9 @@ void QgsAttributeTableDialog::updateTitle()
);

if ( mMainView->filterMode() == QgsAttributeTableFilterModel::ShowAll )
mRunFieldCalc->setText( tr( "Update All") );
mRunFieldCalc->setText( tr( "Update All" ) );
else
mRunFieldCalc->setText( tr( "Update Filtered") );
mRunFieldCalc->setText( tr( "Update Filtered" ) );
}

void QgsAttributeTableDialog::closeEvent( QCloseEvent* event )
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgsattributetypedialog.cpp
Expand Up @@ -37,7 +37,7 @@
#include <climits>
#include <cfloat>

QgsAttributeTypeDialog::QgsAttributeTypeDialog(QgsVectorLayer *vl , int fieldIdx )
QgsAttributeTypeDialog::QgsAttributeTypeDialog( QgsVectorLayer *vl , int fieldIdx )
: QDialog()
, mLayer( vl )
, mFieldIdx( fieldIdx )
Expand Down Expand Up @@ -112,7 +112,7 @@ const QgsEditorWidgetConfig QgsAttributeTypeDialog::editorWidgetV2Config()

void QgsAttributeTypeDialog::setWidgetV2Type( const QString& type )
{
for( int i = 0; i < selectionListWidget->count(); i++ )
for ( int i = 0; i < selectionListWidget->count(); i++ )
{
QListWidgetItem* item = selectionListWidget->item( i );
if ( item->data( Qt::UserRole ).toString() == type )
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgsfieldsproperties.cpp
Expand Up @@ -230,7 +230,7 @@ void QgsFieldsProperties::setRow( int row, int idx, const QgsField& field )
cfg.mButton = pb;
mFieldsList->setCellWidget( row, attrEditTypeCol, pb );

connect( pb, SIGNAL( pressed() ), this, SLOT(attributeTypeDialog()) );
connect( pb, SIGNAL( pressed() ), this, SLOT( attributeTypeDialog() ) );

setConfigForRow( row, cfg );

Expand Down Expand Up @@ -421,7 +421,7 @@ void QgsFieldsProperties::attributeTypeDialog()

cfg.mEditorWidgetV2Type = attributeTypeDialog.editorWidgetV2Type();
cfg.mEditorWidgetV2Config = attributeTypeDialog.editorWidgetV2Config();

pb->setText( attributeTypeDialog.editorWidgetV2Text() );

setConfigForRow( row, cfg );
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsidentifyresultsdialog.cpp
Expand Up @@ -413,7 +413,7 @@ void QgsIdentifyResultsDialog::addFeature( QgsVectorLayer *vlayer, const QgsFeat

if ( widgetType == "Hidden" )
delete attrItem;
continue;
continue;

value = representValue( vlayer, fields[i].name(), attrs[i] );

Expand Down
3 changes: 2 additions & 1 deletion src/core/composer/qgsatlascomposition.cpp
Expand Up @@ -493,7 +493,8 @@ void QgsAtlasComposition::prepareMap( QgsComposerMap* map )
double ratio = scales[i] / scale;
n_width = extent.width() * ratio;
n_height = extent.height() * ratio;
if ( (n_width >= new_extent.width()) && (n_height >= new_extent.height()) ) {
if (( n_width >= new_extent.width() ) && ( n_height >= new_extent.height() ) )
{
// this is the smallest extent that embeds the feature, stop here
break;
}
Expand Down
10 changes: 6 additions & 4 deletions src/core/composer/qgscomposermap.cpp
Expand Up @@ -1323,11 +1323,13 @@ bool QgsComposerMap::readXML( const QDomElement& itemElem, const QDomDocument& d
{
QDomElement atlasElem = atlasNodeList.at( 0 ).toElement();
mAtlasDriven = ( atlasElem.attribute( "atlasDriven", "0" ) != "0" );
if ( atlasElem.hasAttribute("fixedScale") ) { // deprecated XML
mAtlasScalingMode = (atlasElem.attribute( "fixedScale", "0" ) != "0") ? Fixed : Auto;
if ( atlasElem.hasAttribute( "fixedScale" ) ) // deprecated XML
{
mAtlasScalingMode = ( atlasElem.attribute( "fixedScale", "0" ) != "0" ) ? Fixed : Auto;
}
else if ( atlasElem.hasAttribute("scalingMode") ) {
mAtlasScalingMode = static_cast<AtlasScalingMode>(atlasElem.attribute("scalingMode").toInt());
else if ( atlasElem.hasAttribute( "scalingMode" ) )
{
mAtlasScalingMode = static_cast<AtlasScalingMode>( atlasElem.attribute( "scalingMode" ).toInt() );
}
mAtlasMargin = atlasElem.attribute( "margin", "0.1" ).toDouble();
}
Expand Down
3 changes: 2 additions & 1 deletion src/core/pal/util.h
Expand Up @@ -74,7 +74,8 @@ namespace pal
int new_label;
} ElemTrans;

struct Point {
struct Point
{
double x, y;
};

Expand Down
20 changes: 10 additions & 10 deletions src/core/qgsapplication.h
Expand Up @@ -279,13 +279,13 @@ class CORE_EXPORT QgsApplication : public QApplication
* @note added in 2.0 */
static void applyGdalSkippedDrivers();

/** Get maximum concurrent thread count
* @note added in 2.4 */
static int maxThreads() { return ABISYM( mMaxThreads ); }
/** Set maximum concurrent thread count
* @note must be between 1 and #cores, -1 means use all available cores
* @note added in 2.4 */
static void setMaxThreads( int maxThreads );
/** Get maximum concurrent thread count
* @note added in 2.4 */
static int maxThreads() { return ABISYM( mMaxThreads ); }
/** Set maximum concurrent thread count
* @note must be between 1 and #cores, -1 means use all available cores
* @note added in 2.4 */
static void setMaxThreads( int maxThreads );

#ifdef ANDROID
//dummy method to workaround sip generation issue issue
Expand Down Expand Up @@ -328,9 +328,9 @@ class CORE_EXPORT QgsApplication : public QApplication
* @see skipGdalDriver, restoreGdalDriver
* @note added in 2.0 */
static QStringList ABISYM( mGdalSkipList );
/**
* @note added in 2.4 */
static int ABISYM( mMaxThreads );
/**
* @note added in 2.4 */
static int ABISYM( mMaxThreads );
};

#endif
2 changes: 1 addition & 1 deletion src/core/qgslegacyhelpers.cpp
Expand Up @@ -241,7 +241,7 @@ QgsVectorLayer::EditType QgsLegacyHelpers::convertEditType( const QString& editT
{
return QgsVectorLayer::SliderRange;
}
else if ( cfg.value( "Style" ).toString() == "DialRange" )
else if ( cfg.value( "Style" ).toString() == "DialRange" )
{
return QgsVectorLayer::DialRange;
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgslegacyhelpers.h
Expand Up @@ -28,7 +28,7 @@ class CORE_EXPORT QgsLegacyHelpers

private:
QgsLegacyHelpers()
{}
{}
};

#endif // QGSLEGACYHELPERS_H
8 changes: 4 additions & 4 deletions src/core/qgspallabeling.cpp
Expand Up @@ -1013,9 +1013,9 @@ void QgsPalLayerSettings::readFromLayer( QgsVectorLayer* layer )
maxCurvedCharAngleOut = layer->customProperty( "labeling/maxCurvedCharAngleOut", QVariant( -20.0 ) ).toDouble();
priority = layer->customProperty( "labeling/priority" ).toInt();
repeatDistance = layer->customProperty( "labeling/repeatDistance", 0.0 ).toDouble();
repeatDistanceUnit = (SizeUnit) layer->customProperty( "labeling/repeatDistanceUnit", QVariant( MM )).toUInt();
repeatDistanceMapUnitScale.minScale = layer->customProperty( "labeling/repeatDistanceMapUnitMinScale", 0.0).toDouble();
repeatDistanceMapUnitScale.maxScale = layer->customProperty( "labeling/repeatDistanceMapUnitMaxScale", 0.0).toDouble();
repeatDistanceUnit = ( SizeUnit ) layer->customProperty( "labeling/repeatDistanceUnit", QVariant( MM ) ).toUInt();
repeatDistanceMapUnitScale.minScale = layer->customProperty( "labeling/repeatDistanceMapUnitMinScale", 0.0 ).toDouble();
repeatDistanceMapUnitScale.maxScale = layer->customProperty( "labeling/repeatDistanceMapUnitMaxScale", 0.0 ).toDouble();

// rendering
int scalemn = layer->customProperty( "labeling/scaleMin", QVariant( 0 ) ).toInt();
Expand Down Expand Up @@ -2260,7 +2260,7 @@ void QgsPalLayerSettings::registerFeature( QgsFeature& f, const QgsRenderContext
{
if ( !repeatdistinmapunit ) //convert distance from mm/map units to pixels
{
repeatDist *= repeatDistanceMapUnitScale.computeMapUnitsPerPixel(context) * context.scaleFactor();
repeatDist *= repeatDistanceMapUnitScale.computeMapUnitsPerPixel( context ) * context.scaleFactor();
}
else //mm
{
Expand Down
34 changes: 17 additions & 17 deletions src/core/qgsvectorlayer.cpp
Expand Up @@ -1890,18 +1890,18 @@ bool QgsVectorLayer::writeSymbology( QDomNode& node, QDomDocument& doc, QString&
QDomElement editorLayoutElem = doc.createElement( "editorlayout" );
switch ( mEditorLayout )
{
case UiFileLayout:
editorLayoutElem.appendChild( doc.createTextNode( "uifilelayout" ) );
break;
case UiFileLayout:
editorLayoutElem.appendChild( doc.createTextNode( "uifilelayout" ) );
break;

case TabLayout:
editorLayoutElem.appendChild( doc.createTextNode( "tablayout" ) );
break;
case TabLayout:
editorLayoutElem.appendChild( doc.createTextNode( "tablayout" ) );
break;

case GeneratedLayout:
default:
editorLayoutElem.appendChild( doc.createTextNode( "generatedlayout" ) );
break;
case GeneratedLayout:
default:
editorLayoutElem.appendChild( doc.createTextNode( "generatedlayout" ) );
break;
}

node.appendChild( editorLayoutElem );
Expand Down Expand Up @@ -2566,12 +2566,12 @@ void QgsVectorLayer::setEditorLayout( EditorLayout editorLayout )

void QgsVectorLayer::setEditorWidgetV2( int attrIdx, const QString& widgetType )
{
mEditorWidgetV2Types[ mUpdatedFields[ attrIdx ].name() ] = widgetType;
mEditorWidgetV2Types[ mUpdatedFields[ attrIdx ].name()] = widgetType;
}

void QgsVectorLayer::setEditorWidgetV2Config(int attrIdx, const QgsEditorWidgetConfig& config )
void QgsVectorLayer::setEditorWidgetV2Config( int attrIdx, const QgsEditorWidgetConfig& config )
{
mEditorWidgetV2Configs[ mUpdatedFields[ attrIdx ].name() ] = config;
mEditorWidgetV2Configs[ mUpdatedFields[ attrIdx ].name()] = config;
}

QString QgsVectorLayer::editForm()
Expand Down Expand Up @@ -2608,10 +2608,10 @@ QgsVectorLayer::RangeData QgsVectorLayer::range( int idx )
{
const QgsEditorWidgetConfig cfg = editorWidgetV2Config( idx );
return RangeData(
cfg.value( "Min" ),
cfg.value( "Max" ),
cfg.value( "Step" )
);
cfg.value( "Min" ),
cfg.value( "Max" ),
cfg.value( "Step" )
);
}

QString QgsVectorLayer::dateFormat( int idx )
Expand Down
6 changes: 3 additions & 3 deletions src/gui/attributetable/qgsattributetablefiltermodel.cpp
Expand Up @@ -133,10 +133,10 @@ void QgsAttributeTableFilterModel::setFilteredFeatures( QgsFeatureIds ids )
QgsFeatureIds QgsAttributeTableFilterModel::filteredFeatures()
{
QgsFeatureIds ids;
for (int i = 0; i < rowCount(); ++i)
for ( int i = 0; i < rowCount(); ++i )
{
QModelIndex row = index( i, 0 );
ids << rowToId( row );
QModelIndex row = index( i, 0 );
ids << rowToId( row );
}
return ids;
}
Expand Down
2 changes: 1 addition & 1 deletion src/gui/attributetable/qgsdualview.cpp
Expand Up @@ -69,7 +69,7 @@ void QgsDualView::init( QgsVectorLayer* layer, QgsMapCanvas* mapCanvas, const Qg

mTableView->setModel( mFilterModel );
mFeatureList->setModel( mFeatureListModel );
mAttributeForm = new QgsAttributeForm( layer,QgsFeature(), mEditorContext );
mAttributeForm = new QgsAttributeForm( layer, QgsFeature(), mEditorContext );
mAttributeEditorScrollArea->setLayout( new QGridLayout() );
mAttributeEditorScrollArea->layout()->addWidget( mAttributeForm );
mAttributeEditorScrollArea->setWidget( mAttributeForm );
Expand Down
2 changes: 1 addition & 1 deletion src/gui/attributetable/qgsfeaturelistview.cpp
Expand Up @@ -175,7 +175,7 @@ void QgsFeatureListView::setEditSelection( const QgsFeatureIds &fids )
mCurrentEditSelectionModel->select( selection, QItemSelectionModel::ClearAndSelect );
}

void QgsFeatureListView::setEditSelection(const QModelIndex& index, QItemSelectionModel::SelectionFlags command )
void QgsFeatureListView::setEditSelection( const QModelIndex& index, QItemSelectionModel::SelectionFlags command )
{
bool ok = true;
emit aboutToChangeEditSelection( ok );
Expand Down
2 changes: 1 addition & 1 deletion src/gui/attributetable/qgsfeaturelistview.h
Expand Up @@ -149,7 +149,7 @@ class GUI_EXPORT QgsFeatureListView : public QListView
*
* @param index The selection to set
*/
void setEditSelection(const QModelIndex& index , QItemSelectionModel::SelectionFlags command );
void setEditSelection( const QModelIndex& index, QItemSelectionModel::SelectionFlags command );

/**
* Select all currently visible features
Expand Down
6 changes: 3 additions & 3 deletions src/gui/editorwidgets/qgscolorwidget.h
Expand Up @@ -31,11 +31,11 @@ class GUI_EXPORT QgsColorWidget : public QgsEditorWidgetWrapper
QVariant value();

protected:
QWidget*createWidget(QWidget* parent);
void initWidget(QWidget* editor);
QWidget*createWidget( QWidget* parent );
void initWidget( QWidget* editor );

public slots:
void setValue(const QVariant& value);
void setValue( const QVariant& value );

private:
QgsColorButton* mColorButton;
Expand Down
4 changes: 2 additions & 2 deletions src/gui/editorwidgets/qgscolorwidgetfactory.cpp
Expand Up @@ -24,12 +24,12 @@ QgsColorWidgetFactory::QgsColorWidgetFactory( const QString& name )
}


QgsEditorWidgetWrapper* QgsColorWidgetFactory::create(QgsVectorLayer* vl, int fieldIdx, QWidget* editor, QWidget* parent) const
QgsEditorWidgetWrapper* QgsColorWidgetFactory::create( QgsVectorLayer* vl, int fieldIdx, QWidget* editor, QWidget* parent ) const
{
return new QgsColorWidget( vl, fieldIdx, editor, parent );
}

QgsEditorConfigWidget* QgsColorWidgetFactory::configWidget(QgsVectorLayer* vl, int fieldIdx, QWidget* parent) const
QgsEditorConfigWidget* QgsColorWidgetFactory::configWidget( QgsVectorLayer* vl, int fieldIdx, QWidget* parent ) const
{
return new QgsDummyConfigDlg( vl, fieldIdx, parent, QObject::tr( "Field contains a color." ) );
}
4 changes: 2 additions & 2 deletions src/gui/editorwidgets/qgscolorwidgetfactory.h
Expand Up @@ -25,8 +25,8 @@ class GUI_EXPORT QgsColorWidgetFactory : public QgsEditorWidgetFactory

// QgsEditorWidgetFactory interface
public:
QgsEditorWidgetWrapper* create(QgsVectorLayer* vl, int fieldIdx, QWidget* editor, QWidget* parent) const;
QgsEditorConfigWidget* configWidget(QgsVectorLayer* vl, int fieldIdx, QWidget* parent) const;
QgsEditorWidgetWrapper* create( QgsVectorLayer* vl, int fieldIdx, QWidget* editor, QWidget* parent ) const;
QgsEditorConfigWidget* configWidget( QgsVectorLayer* vl, int fieldIdx, QWidget* parent ) const;
};

#endif // QGSCOLORWIDGETFACTORY_H
4 changes: 2 additions & 2 deletions src/gui/editorwidgets/qgsdatetimeeditfactory.cpp
Expand Up @@ -47,7 +47,7 @@ QgsEditorWidgetConfig QgsDateTimeEditFactory::readConfig( const QDomElement &con
return cfg;
}

void QgsDateTimeEditFactory::writeConfig(const QgsEditorWidgetConfig& config, QDomElement& configElement, QDomDocument& doc, const QgsVectorLayer* layer, int fieldIdx)
void QgsDateTimeEditFactory::writeConfig( const QgsEditorWidgetConfig& config, QDomElement& configElement, QDomDocument& doc, const QgsVectorLayer* layer, int fieldIdx )
{
Q_UNUSED( doc );
Q_UNUSED( layer );
Expand All @@ -58,7 +58,7 @@ void QgsDateTimeEditFactory::writeConfig(const QgsEditorWidgetConfig& config, QD
configElement.setAttribute( "calendar_popup", config["calendar_popup"].toBool() );
}

QString QgsDateTimeEditFactory::representValue(QgsVectorLayer* vl, int fieldIdx, const QgsEditorWidgetConfig& config, const QVariant& cache, const QVariant& value) const
QString QgsDateTimeEditFactory::representValue( QgsVectorLayer* vl, int fieldIdx, const QgsEditorWidgetConfig& config, const QVariant& cache, const QVariant& value ) const
{
Q_UNUSED( vl )
Q_UNUSED( fieldIdx )
Expand Down
4 changes: 2 additions & 2 deletions src/gui/editorwidgets/qgsdatetimeeditfactory.h
Expand Up @@ -32,8 +32,8 @@ class GUI_EXPORT QgsDateTimeEditFactory : public QgsEditorWidgetFactory
QgsEditorWidgetWrapper *create( QgsVectorLayer *vl, int fieldIdx, QWidget *editor, QWidget *parent ) const;
QgsEditorConfigWidget *configWidget( QgsVectorLayer *vl, int fieldIdx, QWidget *parent ) const;
QgsEditorWidgetConfig readConfig( const QDomElement &configElement, QgsVectorLayer *layer, int fieldIdx );
void writeConfig(const QgsEditorWidgetConfig& config, QDomElement& configElement, QDomDocument& doc, const QgsVectorLayer* layer, int fieldIdx);
QString representValue(QgsVectorLayer* vl, int fieldIdx, const QgsEditorWidgetConfig& config, const QVariant& cache, const QVariant& value) const;
void writeConfig( const QgsEditorWidgetConfig& config, QDomElement& configElement, QDomDocument& doc, const QgsVectorLayer* layer, int fieldIdx );
QString representValue( QgsVectorLayer* vl, int fieldIdx, const QgsEditorWidgetConfig& config, const QVariant& cache, const QVariant& value ) const;
};

#endif // QGSDATETIMEEDITFACTORY_H
2 changes: 1 addition & 1 deletion src/gui/editorwidgets/qgsenumerationwidgetfactory.cpp
Expand Up @@ -36,7 +36,7 @@ QgsEditorConfigWidget* QgsEnumerationWidgetFactory::configWidget( QgsVectorLayer
}


bool QgsEnumerationWidgetFactory::isFieldSupported(QgsVectorLayer* vl, int fieldIdx)
bool QgsEnumerationWidgetFactory::isFieldSupported( QgsVectorLayer* vl, int fieldIdx )
{
QStringList list;
vl->dataProvider()->enumValues( fieldIdx, list );
Expand Down

0 comments on commit 43dfb9c

Please sign in to comment.