Skip to content

Commit

Permalink
automatic indentation update (r10980-r11003)
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@11004 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Jul 1, 2009
1 parent 33c579c commit 238ba8e
Show file tree
Hide file tree
Showing 29 changed files with 933 additions and 933 deletions.
6 changes: 3 additions & 3 deletions src/app/attributetable/qgsattributetablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ void QgsAttributeTableModel::layerModified( bool onlyGeometry )

loadLayer();
emit modelChanged();
emit headerDataChanged ( Qt::Horizontal, 0, columnCount());
emit headerDataChanged( Qt::Horizontal, 0, columnCount() );
}

void QgsAttributeTableModel::loadLayer()
Expand Down Expand Up @@ -274,12 +274,12 @@ QVariant QgsAttributeTableModel::headerData( int section, Qt::Orientation orient
else
{
QString attributeName = mLayer->attributeAlias( mAttributes[section] );
if(attributeName.isEmpty())
if ( attributeName.isEmpty() )
{
QgsField field = mLayer->pendingFields()[ mAttributes[section] ];
attributeName = field.name();
}
return QVariant(attributeName);
return QVariant( attributeName );
}
}
else return QVariant();
Expand Down
6 changes: 3 additions & 3 deletions src/app/legend/qgslegendlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,10 +373,10 @@ void QgsLegendLayer::vectorLayerSymbology( const QgsVectorLayer* layer, double w
const QgsFieldMap& fields = layer->pendingFields();
for ( QgsAttributeList::iterator it = classfieldlist.begin(); it != classfieldlist.end(); ++it )
{
QString classfieldname = layer->attributeAlias(*it);
if(classfieldname.isEmpty())
QString classfieldname = layer->attributeAlias( *it );
if ( classfieldname.isEmpty() )
{
classfieldname = fields[*it].name();
classfieldname = fields[*it].name();
}
itemList.push_front( std::make_pair( classfieldname, QPixmap() ) );
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsattributedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ QgsAttributeDialog::QgsAttributeDialog( QgsVectorLayer *vl, QgsFeature *thepFeat
const QgsField &field = theFieldMap[it.key()];

//show attribute alias if available
QString myFieldName = vl->attributeDisplayName(it.key());
QString myFieldName = vl->attributeDisplayName( it.key() );
int myFieldType = field.type();
QLabel * mypLabel = new QLabel();
mypInnerLayout->addWidget( mypLabel, index, 0 );
Expand Down
6 changes: 3 additions & 3 deletions src/app/qgscontinuouscolordialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ QgsContinuousColorDialog::QgsContinuousColorDialog( QgsVectorLayer * layer )
QVariant::Type type = it->type();
if ( type == QVariant::Int || type == QVariant::Double )
{
displayName = mVectorLayer->attributeDisplayName(it.key());
displayName = mVectorLayer->attributeDisplayName( it.key() );
classificationComboBox->addItem( displayName, it.key() );
}
}
Expand Down Expand Up @@ -140,7 +140,7 @@ void QgsContinuousColorDialog::apply()

//create the render items for minimum and maximum value
QString minimumString;
if(minimum - floor(minimum) > 0)
if ( minimum - floor( minimum ) > 0 )
{
minimumString = QString::number( minimum, 'f' );
}
Expand All @@ -163,7 +163,7 @@ void QgsContinuousColorDialog::apply()
}

QString maximumString;
if(maximum - floor(maximum) > 0)
if ( maximum - floor( maximum ) > 0 )
{
maximumString = QString::number( maximum, 'f' );
}
Expand Down
46 changes: 23 additions & 23 deletions src/app/qgsgraduatedsymboldialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ QgsGraduatedSymbolDialog::QgsGraduatedSymbolDialog( QgsVectorLayer * layer ): QD
QString displayName;

for ( QgsFieldMap::const_iterator it = fields.begin(); it != fields.end(); ++it )
{
QVariant::Type type = ( *it ).type();
if ( type == QVariant::Int || type == QVariant::Double )
{
QVariant::Type type = ( *it ).type();
if ( type == QVariant::Int || type == QVariant::Double )
{
displayName = layer->attributeDisplayName(it.key());
classificationComboBox->addItem( displayName );
mFieldMap.insert( std::make_pair( displayName, it.key() ) );
}
displayName = layer->attributeDisplayName( it.key() );
classificationComboBox->addItem( displayName );
mFieldMap.insert( std::make_pair( displayName, it.key() ) );
}
}

//restore the correct settings
const QgsGraduatedSymbolRenderer* renderer = dynamic_cast < const QgsGraduatedSymbolRenderer * >( layer->renderer() );
Expand Down Expand Up @@ -345,25 +345,25 @@ void QgsGraduatedSymbolDialog::adjustClassification()
{
if ( last_it != quantileBorders.end() )
{
if(*last_it - floor(*last_it) > 0)
if ( *last_it - floor( *last_it ) > 0 )
{
lowerString = QString::number(*last_it, 'f');
lowerString = QString::number( *last_it, 'f' );
}
else
{
lowerString = QString::number(*last_it, 'f', 0);
lowerString = QString::number( *last_it, 'f', 0 );
}
( *symbol_it )->setLowerValue(lowerString);
( *symbol_it )->setLowerValue( lowerString );

if(*it - floor(*it) > 0)
if ( *it - floor( *it ) > 0 )
{
upperString = QString::number(*it, 'f');
upperString = QString::number( *it, 'f' );
}
else
{
upperString = QString::number(*it, 'f', 0);
upperString = QString::number( *it, 'f', 0 );
}
( *symbol_it )->setUpperValue(upperString);
( *symbol_it )->setUpperValue( upperString );


listBoxText = lowerString + " - " + upperString;
Expand All @@ -386,28 +386,28 @@ void QgsGraduatedSymbolDialog::adjustClassification()
double upper = minimum + ( maximum - minimum ) / numberofclassesspinbox->value() * ( i + 1 );

QString lowerString;
if(lower - floor(lower) > 0)
if ( lower - floor( lower ) > 0 )
{
lowerString = QString::number(lower, 'f');
lowerString = QString::number( lower, 'f' );
}
else
{
lowerString = QString::number(lower, 'f', 0);
lowerString = QString::number( lower, 'f', 0 );
}

( *symbol_it )->setLowerValue(lowerString);
( *symbol_it )->setLowerValue( lowerString );

QString upperString;
if(upper - floor(upper) > 0)
if ( upper - floor( upper ) > 0 )
{
upperString = QString::number(upper, 'f');
upperString = QString::number( upper, 'f' );
}
else
{
upperString = QString::number(upper, 'f', 0);
upperString = QString::number( upper, 'f', 0 );
}

( *symbol_it )->setUpperValue(upperString);
( *symbol_it )->setUpperValue( upperString );
listBoxText = lowerString + " - " + upperString;

QListWidgetItem * mypItem = new QListWidgetItem( listBoxText );
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsmaptoolidentify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ void QgsMapToolIdentify::identifyVectorLayer( const QgsPoint& point )
{
featureNode->setText( 1, it->toString() );
}
QString attributeName = layer->attributeDisplayName(it.key());
QString attributeName = layer->attributeDisplayName( it.key() );
mResults->addAttribute( featureNode, attributeName, it->isNull() ? "NULL" : it->toString() );
}

Expand Down
12 changes: 6 additions & 6 deletions src/app/qgsuniquevaluedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,19 @@ QgsUniqueValueDialog::QgsUniqueValueDialog( QgsVectorLayer* vl ): QDialog(), mVe
setOrientation( Qt::Vertical );

//find out the fields of mVectorLayer
if(mVectorLayer)
if ( mVectorLayer )
{
//we cannot use unique values for not-commited fields because QgsVectorLayer has no 'unique values' method...
QgsVectorDataProvider* provider = mVectorLayer->dataProvider();
if(provider)
if ( provider )
{
const QgsFieldMap & fields = provider->fields();
QString str;

for ( QgsFieldMap::const_iterator it = fields.begin(); it != fields.end(); ++it )
{
str = ( *it ).name();
str = mVectorLayer->attributeDisplayName(it.key());
str = mVectorLayer->attributeDisplayName( it.key() );
mClassificationComboBox->addItem( str, it.key() );
}
}
Expand All @@ -57,14 +57,14 @@ QgsUniqueValueDialog::QgsUniqueValueDialog( QgsVectorLayer* vl ): QDialog(), mVe
mClassListWidget->setEditTriggers( QAbstractItemView::DoubleClicked | QAbstractItemView::EditKeyPressed | QAbstractItemView::AnyKeyPressed );
mClassListWidget->setSortingEnabled( true );

if(mVectorLayer)
if ( mVectorLayer )
{
const QgsUniqueValueRenderer* renderer = dynamic_cast < const QgsUniqueValueRenderer * >( mVectorLayer->renderer() );

if ( renderer )
{
mClassListWidget->clear();
QString field = mVectorLayer->attributeDisplayName(renderer->classificationField());
QString field = mVectorLayer->attributeDisplayName( renderer->classificationField() );
mOldClassificationAttribute = field;
mClassificationComboBox->setCurrentIndex( mClassificationComboBox->findText( field ) );

Expand Down Expand Up @@ -291,7 +291,7 @@ void QgsUniqueValueDialog::changeClassificationAttribute()
QgsVectorDataProvider *provider = dynamic_cast<QgsVectorDataProvider *>( mVectorLayer->dataProvider() );
if ( provider )
{
int nr = mClassificationComboBox->itemData(mClassificationComboBox->currentIndex()).toInt();
int nr = mClassificationComboBox->itemData( mClassificationComboBox->currentIndex() ).toInt();
if ( nr == -1 )
{
return;
Expand Down
20 changes: 10 additions & 10 deletions src/app/qgsvectorlayerproperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ void QgsVectorLayerProperties::setRow( int row, int idx, const QgsField &field )
tblAttributes->setItem( row, 2, new QTableWidgetItem( field.typeName() ) );
tblAttributes->setItem( row, 3, new QTableWidgetItem( QString::number( field.length() ) ) );
tblAttributes->setItem( row, 4, new QTableWidgetItem( QString::number( field.precision() ) ) );
tblAttributes->setItem( row, 5, new QTableWidgetItem( field.comment() ) );
tblAttributes->setItem( row, 5, new QTableWidgetItem( field.comment() ) );

for ( int i = 0; i < 6; i++ )
tblAttributes->item( row, i )->setFlags( tblAttributes->item( row, i )->flags() & ~Qt::ItemIsEditable );
Expand Down Expand Up @@ -226,7 +226,7 @@ void QgsVectorLayerProperties::setRow( int row, int idx, const QgsField &field )
}

//set the alias for the attribute
tblAttributes->setItem( row, 8, new QTableWidgetItem(layer->attributeAlias(idx)));
tblAttributes->setItem( row, 8, new QTableWidgetItem( layer->attributeAlias( idx ) ) );
}


Expand Down Expand Up @@ -385,7 +385,7 @@ void QgsVectorLayerProperties::setDisplayField( QString name )
//! @note in raster props, this method is called sync()
void QgsVectorLayerProperties::reset( void )
{
QObject::disconnect(tblAttributes, SIGNAL(cellChanged(int, int)), this, SLOT(on_tblAttributes_cellChanged(int,int)));
QObject::disconnect( tblAttributes, SIGNAL( cellChanged( int, int ) ), this, SLOT( on_tblAttributes_cellChanged( int, int ) ) );

// populate the general information
txtDisplayName->setText( layer->name() );
Expand Down Expand Up @@ -493,7 +493,7 @@ void QgsVectorLayerProperties::reset( void )
sliderTransparency_valueChanged( 255 - layer->getTransparency() );

loadRows();
QObject::connect(tblAttributes, SIGNAL(cellChanged(int, int)), this, SLOT(on_tblAttributes_cellChanged(int,int)));
QObject::connect( tblAttributes, SIGNAL( cellChanged( int, int ) ), this, SLOT( on_tblAttributes_cellChanged( int, int ) ) );
} // reset()


Expand Down Expand Up @@ -1073,23 +1073,23 @@ void QgsVectorLayerProperties::on_pbnSaveStyleAs_clicked()
}
}

void QgsVectorLayerProperties::on_tblAttributes_cellChanged(int row, int column)
void QgsVectorLayerProperties::on_tblAttributes_cellChanged( int row, int column )
{
if(column == 8 && layer) //only consider attribute aliases in this function
if ( column == 8 && layer ) //only consider attribute aliases in this function
{
const QgsFieldMap &fields = layer->pendingFields();
if(row >= fields.size())
if ( row >= fields.size() )
{
return; //index must be wrong
}

QgsFieldMap::const_iterator f_it = fields.constBegin();
f_it += row;
int index = f_it.key();
QTableWidgetItem* aliasItem = tblAttributes->item(row, column);
if(aliasItem)
QTableWidgetItem* aliasItem = tblAttributes->item( row, column );
if ( aliasItem )
{
layer->addAttributeAlias(index, aliasItem->text());
layer->addAttributeAlias( index, aliasItem->text() );
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsvectorlayerproperties.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class QgsVectorLayerProperties : public QDialog, private Ui::QgsVectorLayerPrope
void on_pbnSaveDefaultStyle_clicked();
void on_pbnLoadStyle_clicked();
void on_pbnSaveStyleAs_clicked();
void on_tblAttributes_cellChanged(int row, int column);
void on_tblAttributes_cellChanged( int row, int column );

void addAttribute();
void deleteAttribute();
Expand Down
2 changes: 1 addition & 1 deletion src/core/composer/qgslegendmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ int QgsLegendModel::addVectorLayerItems( QStandardItem* layerItem, QgsMapLayer*
QgsFieldMap::const_iterator fieldIt = layerFields.find( *att_it );
if ( fieldIt != layerFields.constEnd() )
{
QString attributeName = vectorLayer->attributeDisplayName(fieldIt.key());
QString attributeName = vectorLayer->attributeDisplayName( fieldIt.key() );
QStandardItem* attributeItem = new QStandardItem( attributeName );
layerItem->setChild( layerItem->rowCount(), 0, attributeItem );
}
Expand Down
6 changes: 3 additions & 3 deletions src/core/qgsvectorlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -403,15 +403,15 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer

/**Sets an alias (a display name) for attributes to display in dialogs
@note added in version 1.2*/
void addAttributeAlias(int attIndex, QString aliasString);
void addAttributeAlias( int attIndex, QString aliasString );

/**Returns the alias of an attribute name or an empty string if there is no alias
@note added in version 1.2*/
QString attributeAlias(int attributeIndex) const;
QString attributeAlias( int attributeIndex ) const;

/**Convenience function that returns the attribute alias if defined or the field name else
@note added in version 1.2*/
QString attributeDisplayName(int attributeIndex) const;
QString attributeDisplayName( int attributeIndex ) const;

/** delete an attribute field (but does not commit it) */
bool deleteAttribute( int attr );
Expand Down
Loading

0 comments on commit 238ba8e

Please sign in to comment.