Skip to content
Permalink
Browse files
indentation update
  • Loading branch information
jef-n committed May 24, 2014
1 parent 29e4aea commit 43dfb9c4846d7a8ae9242418ec7de5fcb62ddf53
Showing with 168 additions and 162 deletions.
  1. +4 −3 src/app/composer/qgscomposer.cpp
  2. +2 −2 src/app/composer/qgscomposermapwidget.cpp
  3. +1 −1 src/app/legend/qgsapplegendinterface.cpp
  4. +2 −2 src/app/qgsattributetabledialog.cpp
  5. +2 −2 src/app/qgsattributetypedialog.cpp
  6. +2 −2 src/app/qgsfieldsproperties.cpp
  7. +1 −1 src/app/qgsidentifyresultsdialog.cpp
  8. +2 −1 src/core/composer/qgsatlascomposition.cpp
  9. +6 −4 src/core/composer/qgscomposermap.cpp
  10. +2 −1 src/core/pal/util.h
  11. +10 −10 src/core/qgsapplication.h
  12. +1 −1 src/core/qgslegacyhelpers.cpp
  13. +1 −1 src/core/qgslegacyhelpers.h
  14. +4 −4 src/core/qgspallabeling.cpp
  15. +17 −17 src/core/qgsvectorlayer.cpp
  16. +3 −3 src/gui/attributetable/qgsattributetablefiltermodel.cpp
  17. +1 −1 src/gui/attributetable/qgsdualview.cpp
  18. +1 −1 src/gui/attributetable/qgsfeaturelistview.cpp
  19. +1 −1 src/gui/attributetable/qgsfeaturelistview.h
  20. +3 −3 src/gui/editorwidgets/qgscolorwidget.h
  21. +2 −2 src/gui/editorwidgets/qgscolorwidgetfactory.cpp
  22. +2 −2 src/gui/editorwidgets/qgscolorwidgetfactory.h
  23. +2 −2 src/gui/editorwidgets/qgsdatetimeeditfactory.cpp
  24. +2 −2 src/gui/editorwidgets/qgsdatetimeeditfactory.h
  25. +1 −1 src/gui/editorwidgets/qgsenumerationwidgetfactory.cpp
  26. +1 −1 src/gui/editorwidgets/qgsenumerationwidgetfactory.h
  27. +2 −2 src/gui/editorwidgets/qgsphotoconfigdlg.cpp
  28. +1 −1 src/gui/editorwidgets/qgsphotoconfigdlg.h
  29. +4 −4 src/gui/editorwidgets/qgsphotowidget.h
  30. +4 −4 src/gui/editorwidgets/qgsphotowidgetfactory.cpp
  31. +4 −4 src/gui/editorwidgets/qgsphotowidgetfactory.h
  32. +9 −9 src/gui/editorwidgets/qgsrangeconfigdlg.cpp
  33. +3 −3 src/gui/editorwidgets/qgsrangewidgetfactory.cpp
  34. +1 −1 src/gui/editorwidgets/qgsrangewidgetfactory.h
  35. +5 −5 src/gui/editorwidgets/qgsrelationwidgetwrapper.cpp
  36. +2 −2 src/gui/editorwidgets/qgsrelationwidgetwrapper.h
  37. +3 −3 src/gui/editorwidgets/qgstexteditconfigdlg.cpp
  38. +1 −1 src/gui/editorwidgets/qgstexteditconfigdlg.h
  39. +2 −2 src/gui/editorwidgets/qgstexteditwidgetfactory.cpp
  40. +2 −2 src/gui/editorwidgets/qgstexteditwidgetfactory.h
  41. +3 −3 src/gui/editorwidgets/qgsuuidwidget.h
  42. +2 −2 src/gui/editorwidgets/qgsuuidwidgetfactory.cpp
  43. +2 −2 src/gui/editorwidgets/qgsuuidwidgetfactory.h
  44. +1 −1 src/gui/editorwidgets/qgsvaluerelationconfigdlg.h
  45. +3 −3 src/gui/editorwidgets/qgswebviewconfigdlg.cpp
  46. +1 −1 src/gui/editorwidgets/qgswebviewconfigdlg.h
  47. +4 −4 src/gui/editorwidgets/qgswebviewwidgetfactory.h
  48. +1 −1 src/gui/qgsattributedialog.cpp
  49. +2 −2 src/gui/qgsattributeforminterface.cpp
  50. +8 −8 src/gui/qgsattributeformlegacyinterface.cpp
  51. +1 −1 src/gui/qgsdial.cpp
  52. +5 −5 src/gui/qgsdial.h
  53. +4 −4 src/gui/qgsexpressionbuilderwidget.cpp
  54. +4 −4 src/gui/qgsslider.cpp
  55. +6 −6 src/gui/qgsslider.h
  56. +2 −1 tests/src/core/testqgsatlascomposition.cpp
7 src/app/composer/qgscomposer.cpp 100755 → 100644
@@ -3481,7 +3481,8 @@ void QgsComposer::updateAtlasMapLayerAction( bool atlasEnabled )

void QgsComposer::loadAtlasPredefinedScalesFromProject()
{
if ( !mComposition ) {
if ( !mComposition )
{
return;
}
QgsAtlasComposition& atlasMap = mComposition->atlasComposition();
@@ -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() );
}
@@ -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();
@@ -224,7 +224,7 @@ void QgsComposerMapWidget::on_mAtlasFixedScaleRadio_toggled( bool checked )
return;
}

if (checked)
if ( checked )
{
mComposerMap->setAtlasScalingMode( QgsComposerMap::Fixed );
updateMapForAtlas();
@@ -324,7 +324,7 @@ bool QgsAppLegendInterface::removeLegendLayerAction( QAction* action )
if ( !menuProvider )
return false;

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

QgsMapLayer* QgsAppLegendInterface::currentLayer()
@@ -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 )
@@ -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 )
@@ -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 )
@@ -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 );

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

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

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

setConfigForRow( row, cfg );
@@ -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] );

@@ -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;
}
@@ -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();
}
@@ -74,7 +74,8 @@ namespace pal
int new_label;
} ElemTrans;

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

@@ -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
@@ -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
@@ -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;
}
@@ -28,7 +28,7 @@ class CORE_EXPORT QgsLegacyHelpers

private:
QgsLegacyHelpers()
{}
{}
};

#endif // QGSLEGACYHELPERS_H
@@ -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();
@@ -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
{
@@ -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 );
@@ -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()
@@ -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 )
@@ -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;
}
@@ -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 );
@@ -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 );
@@ -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
@@ -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;
@@ -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." ) );
}
@@ -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
@@ -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 );
@@ -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 )
@@ -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
@@ -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 );

0 comments on commit 43dfb9c

Please sign in to comment.