Skip to content

Commit

Permalink
indentation update
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Oct 31, 2012
1 parent 62ebf88 commit 98e8ba4
Show file tree
Hide file tree
Showing 36 changed files with 397 additions and 384 deletions.
42 changes: 21 additions & 21 deletions src/app/composer/qgsatlascompositionwidget.cpp
Expand Up @@ -23,7 +23,7 @@
#include "qgscomposermap.h"

QgsAtlasCompositionWidget::QgsAtlasCompositionWidget( QWidget* parent, QgsComposition* c ):
QWidget( parent ), mComposition( c )
QWidget( parent ), mComposition( c )
{
setupUi( this );

Expand All @@ -34,34 +34,34 @@ QgsAtlasCompositionWidget::QgsAtlasCompositionWidget( QWidget* parent, QgsCompos
for ( QMap<QString, QgsMapLayer*>::const_iterator it = layers.begin(); it != layers.end(); ++it )
{
// Only consider vector layers
if ( dynamic_cast<QgsVectorLayer*>(it.value()) )
if ( dynamic_cast<QgsVectorLayer*>( it.value() ) )
{
mAtlasCoverageLayerComboBox->insertItem( idx++, it.value()->name(), /* userdata */ qVariantFromValue( (void*)it.value() ) );
mAtlasCoverageLayerComboBox->insertItem( idx++, it.value()->name(), /* userdata */ qVariantFromValue(( void* )it.value() ) );
}
}

// Connect to addition / removal of layers
QgsMapLayerRegistry* layerRegistry = QgsMapLayerRegistry::instance();
if ( layerRegistry )
{
connect( layerRegistry, SIGNAL( layerWillBeRemoved( QString ) ), this, SLOT( onLayerRemoved( QString ) ) );
connect( layerRegistry, SIGNAL( layerWasAdded( QgsMapLayer* ) ), this, SLOT( onLayerAdded( QgsMapLayer* ) ) );
}

// update the composer map combo box
// populate the map list
mComposerMapComboBox->clear();
QList<const QgsComposerMap*> availableMaps = mComposition->composerMapItems();
QList<const QgsComposerMap*>::const_iterator mapItemIt = availableMaps.constBegin();
for ( ; mapItemIt != availableMaps.constEnd(); ++mapItemIt )
{
mComposerMapComboBox->addItem( tr( "Map %1" ).arg(( *mapItemIt )->id() ), qVariantFromValue( (void*)*mapItemIt ) );
mComposerMapComboBox->addItem( tr( "Map %1" ).arg(( *mapItemIt )->id() ), qVariantFromValue(( void* )*mapItemIt ) );
}

// Connect to addition / removal of maps
connect( mComposition, SIGNAL( composerMapAdded( QgsComposerMap* ) ), this, SLOT( onComposerMapAdded( QgsComposerMap* ) ) );
connect( mComposition, SIGNAL( itemRemoved( QgsComposerItem* ) ), this, SLOT( onItemRemoved( QgsComposerItem* ) ) );

// connect to updates
connect( &mComposition->atlasComposition(), SIGNAL( parameterChanged() ), this, SLOT( updateGuiElements() ) );

Expand All @@ -84,7 +84,7 @@ void QgsAtlasCompositionWidget::on_mUseAtlasCheckBox_stateChanged( int state )
{
atlasMap->setEnabled( false );
mAtlasFrame->setEnabled( false );
}
}
}

void QgsAtlasCompositionWidget::onLayerRemoved( QString layerName )
Expand Down Expand Up @@ -113,7 +113,7 @@ void QgsAtlasCompositionWidget::onLayerAdded( QgsMapLayer* map )
QgsVectorLayer* vectorLayer = dynamic_cast<QgsVectorLayer*>( map );
if ( vectorLayer )
{
mAtlasCoverageLayerComboBox->addItem( map->name(), qVariantFromValue( (void*)map ) );
mAtlasCoverageLayerComboBox->addItem( map->name(), qVariantFromValue(( void* )map ) );
}
if ( mAtlasCoverageLayerComboBox->count() == 1 )
{
Expand All @@ -124,7 +124,7 @@ void QgsAtlasCompositionWidget::onLayerAdded( QgsMapLayer* map )
void QgsAtlasCompositionWidget::onComposerMapAdded( QgsComposerMap* map )
{
QgsAtlasComposition* atlasMap = &mComposition->atlasComposition();
mComposerMapComboBox->addItem( tr( "Map %1" ).arg( map->id() ), qVariantFromValue( (void*)map ) );
mComposerMapComboBox->addItem( tr( "Map %1" ).arg( map->id() ), qVariantFromValue(( void* )map ) );
if ( mComposerMapComboBox->count() == 1 )
{
atlasMap->setComposerMap( map );
Expand All @@ -137,7 +137,7 @@ void QgsAtlasCompositionWidget::onItemRemoved( QgsComposerItem* item )
QgsComposerMap* map = dynamic_cast<QgsComposerMap*>( item );
if ( map )
{
int idx = mComposerMapComboBox->findData( qVariantFromValue( (void*)map ) );
int idx = mComposerMapComboBox->findData( qVariantFromValue(( void* )map ) );
if ( idx != -1 )
{
mComposerMapComboBox->removeItem( idx );
Expand All @@ -162,7 +162,7 @@ void QgsAtlasCompositionWidget::on_mAtlasCoverageLayerComboBox_currentIndexChang
}
else
{
QgsVectorLayer* layer = reinterpret_cast<QgsVectorLayer*>(mAtlasCoverageLayerComboBox->itemData( index ).value<void*>());
QgsVectorLayer* layer = reinterpret_cast<QgsVectorLayer*>( mAtlasCoverageLayerComboBox->itemData( index ).value<void*>() );
atlasMap->setCoverageLayer( layer );
}
}
Expand All @@ -180,7 +180,7 @@ void QgsAtlasCompositionWidget::on_mComposerMapComboBox_currentIndexChanged( int
}
else
{
QgsComposerMap* map = reinterpret_cast<QgsComposerMap*>(mComposerMapComboBox->itemData( index ).value<void*>());
QgsComposerMap* map = reinterpret_cast<QgsComposerMap*>( mComposerMapComboBox->itemData( index ).value<void*>() );
atlasMap->setComposerMap( map );
}
}
Expand All @@ -203,7 +203,7 @@ void QgsAtlasCompositionWidget::on_mAtlasFilenameExpressionButton_clicked()
{
return;
}

QgsExpressionBuilderDialog exprDlg( atlasMap->coverageLayer(), mAtlasFilenamePatternEdit->text(), this );
exprDlg.setWindowTitle( tr( "Expression based filename" ) );
if ( exprDlg.exec() == QDialog::Accepted )
Expand Down Expand Up @@ -268,19 +268,19 @@ void QgsAtlasCompositionWidget::updateGuiElements()
{
mUseAtlasCheckBox->setCheckState( Qt::Unchecked );
}
int idx = mAtlasCoverageLayerComboBox->findData( qVariantFromValue( (void*)atlasMap->coverageLayer() ));

int idx = mAtlasCoverageLayerComboBox->findData( qVariantFromValue(( void* )atlasMap->coverageLayer() ) );
if ( idx != -1 )
{
mAtlasCoverageLayerComboBox->setCurrentIndex( idx );
}
idx = mComposerMapComboBox->findData( qVariantFromValue( (void*)atlasMap->composerMap() ));
idx = mComposerMapComboBox->findData( qVariantFromValue(( void* )atlasMap->composerMap() ) );
if ( idx != -1 )
{
mComposerMapComboBox->setCurrentIndex( idx );
}
mAtlasMarginSpinBox->setValue( static_cast<int>(atlasMap->margin() * 100) );

mAtlasMarginSpinBox->setValue( static_cast<int>( atlasMap->margin() * 100 ) );
mAtlasFilenamePatternEdit->setText( atlasMap->filenamePattern() );
mAtlasFixedScaleCheckBox->setCheckState( atlasMap->fixedScale() ? Qt::Checked : Qt::Unchecked );
mAtlasHideCoverageCheckBox->setCheckState( atlasMap->hideCoverage() ? Qt::Checked : Qt::Unchecked );
Expand All @@ -290,5 +290,5 @@ void QgsAtlasCompositionWidget::updateGuiElements()
void QgsAtlasCompositionWidget::blockAllSignals( bool b )
{
mUseAtlasCheckBox->blockSignals( b );
mAtlasFrame->blockSignals( b );
mAtlasFrame->blockSignals( b );
}
20 changes: 10 additions & 10 deletions src/app/composer/qgsatlascompositionwidget.h
Expand Up @@ -25,15 +25,15 @@ class QgsComposerItem;
* Input widget for QgsAtlasComposition
*/
class QgsAtlasCompositionWidget:
public QWidget,
private Ui::QgsAtlasCompositionWidgetBase
public QWidget,
private Ui::QgsAtlasCompositionWidgetBase
{
Q_OBJECT
public:
public:
QgsAtlasCompositionWidget( QWidget* parent, QgsComposition* c );
~QgsAtlasCompositionWidget();
public slots:

public slots:
void on_mUseAtlasCheckBox_stateChanged( int state );
void on_mComposerMapComboBox_currentIndexChanged( int index );
void on_mAtlasCoverageLayerComboBox_currentIndexChanged( int index );
Expand All @@ -42,17 +42,17 @@ public slots:
void on_mAtlasHideCoverageCheckBox_stateChanged( int state );
void on_mAtlasFixedScaleCheckBox_stateChanged( int state );
void on_mAtlasSingleFileCheckBox_stateChanged( int state );
private slots:

private slots:
void onLayerRemoved( QString );
void onLayerAdded( QgsMapLayer* );
void onComposerMapAdded( QgsComposerMap* );
void onItemRemoved( QgsComposerItem* );

void updateGuiElements();
private:

private:
QgsComposition* mComposition;

void blockAllSignals( bool b );
};

0 comments on commit 98e8ba4

Please sign in to comment.