Skip to content

Commit

Permalink
automatic indentation update (r9138-r9226)
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@9227 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Aug 31, 2008
1 parent 401b8e1 commit edbdba1
Show file tree
Hide file tree
Showing 41 changed files with 1,181 additions and 1,181 deletions.
32 changes: 16 additions & 16 deletions src/app/composer/qgscomposer.cpp
Expand Up @@ -79,30 +79,30 @@ QgsComposer::QgsComposer( QgisApp *qgis ): QMainWindow()
// mActionSelectMoveItem

QAction* moveItemContentAction = new QAction( QIcon( QPixmap( myIconPath + "mActionMoveItemContent.png" ) ),
tr( "Move Content" ), 0 );
tr( "Move Content" ), 0 );
moveItemContentAction->setToolTip( tr( "Move item content" ) );
moveItemContentAction->setCheckable( true );
connect( moveItemContentAction, SIGNAL( triggered() ), this, SLOT( moveItemContent() ) );
toolBar->addAction( moveItemContentAction );
//toolBar->addAction(QIcon(QPixmap(myIconPath+"mActionMoveItemContent.png")), tr("Move Item content"), this, SLOT(moveItemContent()));

QAction* groupItemsAction = toolBar->addAction( QIcon( QPixmap( myIconPath + "mActionGroupItems.png" ) ),
tr( "&Group" ), this, SLOT( groupItems() ) );
tr( "&Group" ), this, SLOT( groupItems() ) );
groupItemsAction->setToolTip( tr( "Group items" ) );
QAction* ungroupItemsAction = toolBar->addAction( QIcon( QPixmap( myIconPath + "mActionUngroupItems.png" ) ),
tr( "&Ungroup" ), this, SLOT( ungroupItems() ) );
tr( "&Ungroup" ), this, SLOT( ungroupItems() ) );
ungroupItemsAction->setToolTip( tr( "Ungroup items" ) );
QAction* raiseItemsAction = toolBar->addAction( QIcon( QPixmap( myIconPath + "mActionRaiseItems.png" ) ),
tr( "Raise" ), this, SLOT( raiseSelectedItems() ) );
tr( "Raise" ), this, SLOT( raiseSelectedItems() ) );
raiseItemsAction->setToolTip( tr( "Raise selected items" ) );
QAction* lowerItemsAction = toolBar->addAction( QIcon( QPixmap( myIconPath + "mActionLowerItems.png" ) ),
tr( "Lower" ), this, SLOT( lowerSelectedItems() ) );
tr( "Lower" ), this, SLOT( lowerSelectedItems() ) );
lowerItemsAction->setToolTip( tr( "Lower selected items" ) );
QAction* moveItemsToTopAction = toolBar->addAction( QIcon( QPixmap( myIconPath + "mActionMoveItemsToTop.png" ) ),
tr( "Bring to Front" ), this, SLOT( moveSelectedItemsToTop() ) );
tr( "Bring to Front" ), this, SLOT( moveSelectedItemsToTop() ) );
moveItemsToTopAction->setToolTip( tr( "Move selected items to top" ) );
QAction* moveItemsToBottomAction = toolBar->addAction( QIcon( QPixmap( myIconPath + "mActionMoveItemsToBottom.png" ) ),
tr( "Send to Back" ), this, SLOT( moveSelectedItemsToBottom() ) );
tr( "Send to Back" ), this, SLOT( moveSelectedItemsToBottom() ) );
moveItemsToBottomAction->setToolTip( tr( "Move selected items to bottom" ) );

QActionGroup* toggleActionGroup = new QActionGroup( this );
Expand Down Expand Up @@ -179,7 +179,7 @@ QgsComposer::QgsComposer( QgisApp *qgis ): QMainWindow()
layoutMenu->addAction( lowerItemsAction );
layoutMenu->addAction( moveItemsToTopAction );
layoutMenu->addAction( moveItemsToBottomAction );

#ifndef Q_WS_MAC64 /* assertion failure in NSMenuItem setSubmenu (Qt 4.5.0-snapshot-20080830) */
menuBar()->addMenu( QgisApp::instance()->windowMenu() );

Expand Down Expand Up @@ -311,15 +311,15 @@ void QgsComposer::changeEvent( QEvent* event )
QMainWindow::changeEvent( event );
switch ( event->type() )
{
case QEvent::ActivationChange:
if ( QApplication::activeWindow() == this )
{
mWindowAction->setChecked( true );
}
break;
case QEvent::ActivationChange:
if ( QApplication::activeWindow() == this )
{
mWindowAction->setChecked( true );
}
break;

default:
break;
default:
break;
}
}

Expand Down
20 changes: 10 additions & 10 deletions src/app/composer/qgscomposerlegendwidget.cpp
Expand Up @@ -362,20 +362,20 @@ void QgsComposerLegendWidget::on_mUpdatePushButton_clicked()
{
return;
}

QModelIndex parentIndex = currentIndex.parent();
if ( !parentIndex.isValid() ) // a layer item
{
QString mapLayerId = currentItem->data().toString();
mLegend->model()->updateLayer(mapLayerId);
mLegend->update();
}
{
QString mapLayerId = currentItem->data().toString();
mLegend->model()->updateLayer( mapLayerId );
mLegend->update();
}
}

void QgsComposerLegendWidget::on_mUpdateAllPushButton_clicked()
{
if(mLegend)
{
mLegend->updateLegend();
}
if ( mLegend )
{
mLegend->updateLegend();
}
}
34 changes: 17 additions & 17 deletions src/app/qgisapp.cpp
Expand Up @@ -4688,25 +4688,25 @@ void QgisApp::changeEvent( QEvent* event )
#ifdef Q_WS_MAC
switch ( event->type() )
{
case QEvent::ActivationChange:
if ( QApplication::activeWindow() == this )
{
mWindowAction->setChecked( true );
}
// this should not be necessary since the action is part of an action group
// however this check is not cleared if PrintComposer is closed and reopened
else
{
mWindowAction->setChecked( false );
}
break;
case QEvent::ActivationChange:
if ( QApplication::activeWindow() == this )
{
mWindowAction->setChecked( true );
}
// this should not be necessary since the action is part of an action group
// however this check is not cleared if PrintComposer is closed and reopened
else
{
mWindowAction->setChecked( false );
}
break;

case QEvent::WindowTitleChange:
mWindowAction->setText( windowTitle() );
break;
case QEvent::WindowTitleChange:
mWindowAction->setText( windowTitle() );
break;

default:
break;
default:
break;
}
#endif
}
Expand Down
30 changes: 15 additions & 15 deletions src/app/qgsattributetabledisplay.cpp
Expand Up @@ -148,29 +148,29 @@ QgsAttributeTableDisplay::QgsAttributeTableDisplay( QgsVectorLayer* layer )
QAction *cutAction = editMenu->addAction( tr( "Cu&t" ), this, SLOT( cut() ), tr( "Ctrl+X" ) );
cutAction->setEnabled( false );
QAction *copyAction = editMenu->addAction(
mCopySelectedRowsButton->icon(), tr( "&Copy" ), this, SLOT( copySelectedRowsToClipboard() ), tr( "Ctrl+C" ) );
mCopySelectedRowsButton->icon(), tr( "&Copy" ), this, SLOT( copySelectedRowsToClipboard() ), tr( "Ctrl+C" ) );
QAction *pasteAction = editMenu->addAction( tr( "&Paste" ), this, SLOT( paste() ), tr( "Ctrl+V" ) );
pasteAction->setEnabled( false );
QAction *deleteAction = editMenu->addAction(
mRemoveSelectionButton->icon(), tr( "Delete" ), this, SLOT( removeSelection() ) );
mRemoveSelectionButton->icon(), tr( "Delete" ), this, SLOT( removeSelection() ) );

QMenu *layerMenu = menuBar->addMenu( tr( "Layer" ) );
QAction *zoomToSelectedAction = layerMenu->addAction(
mZoomMapToSelectedRowsButton->icon(), tr( "Zoom to Selection" ), this, SLOT( zoomMapToSelectedRows() ), tr( "Ctrl+J" ) );
mZoomMapToSelectedRowsButton->icon(), tr( "Zoom to Selection" ), this, SLOT( zoomMapToSelectedRows() ), tr( "Ctrl+J" ) );
layerMenu->addSeparator();
QAction *toggleEditingAction = layerMenu->addAction(
mToggleEditingButton->icon(), tr( "Toggle Editing" ), this, SLOT( toggleEditing() ) );
mToggleEditingButton->icon(), tr( "Toggle Editing" ), this, SLOT( toggleEditing() ) );
toggleEditingAction->setEnabled( mToggleEditingButton->isEnabled() );
toggleEditingAction->setCheckable( true );
toggleEditingAction->setChecked( mToggleEditingButton->isChecked() );
connect( mToggleEditingButton, SIGNAL( toggled( bool ) ), toggleEditingAction, SLOT( setChecked( bool ) ) );

QMenu *tableMenu = menuBar->addMenu( tr( "Table" ) );
QAction *moveToTopAction = tableMenu->addAction(
mSelectedToTopButton->icon(), tr( "Move to Top" ), this, SLOT( selectedToTop() ) );
mSelectedToTopButton->icon(), tr( "Move to Top" ), this, SLOT( selectedToTop() ) );
QAction *invertAction = tableMenu->addAction(
mInvertSelectionButton->icon(), tr( "Invert" ), this, SLOT( invertSelection() ) );
mInvertSelectionButton->icon(), tr( "Invert" ), this, SLOT( invertSelection() ) );

#ifndef Q_WS_MAC64 /* assertion failure in NSMenuItem setSubmenu (Qt 4.5.0-snapshot-20080830) */
menuBar->addMenu( QgisApp::instance()->windowMenu() );

Expand All @@ -195,15 +195,15 @@ void QgsAttributeTableDisplay::changeEvent( QEvent* event )
QDialog::changeEvent( event );
switch ( event->type() )
{
case QEvent::ActivationChange:
if ( QApplication::activeWindow() == this )
{
mWindowAction->setChecked( true );
}
break;
case QEvent::ActivationChange:
if ( QApplication::activeWindow() == this )
{
mWindowAction->setChecked( true );
}
break;

default:
break;
default:
break;
}
}
#endif
Expand Down
46 changes: 23 additions & 23 deletions src/app/qgsrasterlayerproperties.cpp
Expand Up @@ -170,7 +170,7 @@ QgsRasterLayerProperties::QgsRasterLayerProperties( QgsMapLayer *lyr, QWidget *p
{
//find out the name of this band
QString myRasterBandNameQString = mRasterLayer->getRasterBandName( myIteratorInt ) ;

//add the band to the histogram tab
//
QPixmap myPixmap( 10, 10 );
Expand Down Expand Up @@ -328,7 +328,7 @@ QgsRasterLayerProperties::~QgsRasterLayerProperties()
* PUBLIC METHODS
*
*/
void QgsRasterLayerProperties::populateColorMapTable(const QList<QgsColorRampShader::ColorRampItem>& theColorRampList)
void QgsRasterLayerProperties::populateColorMapTable( const QList<QgsColorRampShader::ColorRampItem>& theColorRampList )
{
if ( theColorRampList.size() > 0 )
{
Expand All @@ -342,7 +342,7 @@ void QgsRasterLayerProperties::populateColorMapTable(const QList<QgsColorRampSha
newItem->setText( 2, it->label );
}
}
}
}
void QgsRasterLayerProperties::populateTransparencyTable()
{
//Clear existsing color transparency list
Expand Down Expand Up @@ -867,7 +867,7 @@ void QgsRasterLayerProperties::syncColormapTab()
return;
}
//restore the colormap tab if layer has custom symbology
populateColorMapTable(myRasterShaderFunction->getColorRampItemList());
populateColorMapTable( myRasterShaderFunction->getColorRampItemList() );

sboxNumberOfEntries->setValue( mColormapTreeWidget->topLevelItemCount() );

Expand Down Expand Up @@ -979,7 +979,7 @@ void QgsRasterLayerProperties::apply()
QgsDebugMsg( "Setting Raster Drawing Style to :: PALETTED_SINGLE_BAND_GRAY" );
QgsDebugMsg( QString( "Combo value : %1 GrayBand Mapping : %2" ).arg( cboGray->currentText() ).arg( mRasterLayer->
getGrayBandName() ) );

mRasterLayer->setDrawingStyle( QgsRasterLayer::PALETTED_SINGLE_BAND_GRAY );
}
else if ( cboxColorMap->currentText() == tr( "Colormap" ) )
Expand All @@ -996,7 +996,7 @@ void QgsRasterLayerProperties::apply()

mRasterLayer->setDrawingStyle( QgsRasterLayer::PALETTED_SINGLE_BAND_PSEUDO_COLOR );
}

}
//
// Mutltiband
Expand Down Expand Up @@ -2642,9 +2642,9 @@ void QgsRasterLayerProperties::handleColormapTreeWidgetDoubleClick( QTreeWidgetI
void QgsRasterLayerProperties::on_pbtnAddColorMapEntry_clicked()
{
QTreeWidgetItem* newItem = new QTreeWidgetItem( mColormapTreeWidget );
newItem->setText( 0, "0.0");
newItem->setBackground( 1, QBrush( QColor(Qt::magenta) ) );
newItem->setText( 2, tr("Custom color map entry"));
newItem->setText( 0, "0.0" );
newItem->setBackground( 1, QBrush( QColor( Qt::magenta ) ) );
newItem->setText( 2, tr( "Custom color map entry" ) );
}

void QgsRasterLayerProperties::on_pbtnExportColorMapToFile_clicked()
Expand Down Expand Up @@ -2711,16 +2711,16 @@ void QgsRasterLayerProperties::on_pbtnExportColorMapToFile_clicked()
void QgsRasterLayerProperties::on_pbtnLoadColorMapFromBand_clicked()
{
QList<QgsColorRampShader::ColorRampItem> myColorRampList;
if(mRasterLayer->readColorTable(cboxColorMapBand->currentIndex()+1, &myColorRampList))
if ( mRasterLayer->readColorTable( cboxColorMapBand->currentIndex() + 1, &myColorRampList ) )
{
populateColorMapTable(myColorRampList);
populateColorMapTable( myColorRampList );
cboxColorInterpolation->setCurrentIndex( cboxColorInterpolation->findText( tr( "Exact" ) ) );
QgsDebugMsg("Color map loaded");
QgsDebugMsg( "Color map loaded" );
}
else
{
QMessageBox::warning(this, tr("Load Color Map"), tr("The color map for Band %n failed to load", "", cboxColorMapBand->currentIndex()+1));
QgsDebugMsg("Color map failed to load");
QMessageBox::warning( this, tr( "Load Color Map" ), tr( "The color map for Band %n failed to load", "", cboxColorMapBand->currentIndex() + 1 ) );
QgsDebugMsg( "Color map failed to load" );
}
}

Expand Down Expand Up @@ -2919,41 +2919,41 @@ void QgsRasterLayerProperties::on_pbtnSortColorMap_clicked()
{
myCurrentItem = mColormapTreeWidget->topLevelItem( i );
//If the item is null or does not have a pixel values set, skip
if(!myCurrentItem || myCurrentItem->text(0) == "")
if ( !myCurrentItem || myCurrentItem->text( 0 ) == "" )
{
continue;
}

//Create a copy of the new Color ramp Item
QgsColorRampShader::ColorRampItem myNewColorRampItem;
myNewColorRampItem.value = myCurrentItem->text( 0 ).toDouble();
myNewColorRampItem.color = myCurrentItem->background( 1 ).color();
myNewColorRampItem.label = myCurrentItem->text( 2 );

//Simple insertion sort - speed is not a huge factor here
inserted = false;
myCurrentIndex = 0;
while(!inserted)
while ( !inserted )
{
if(0 == myColorRampItems.size() || myCurrentIndex == myColorRampItems.size())
if ( 0 == myColorRampItems.size() || myCurrentIndex == myColorRampItems.size() )
{
myColorRampItems.push_back( myNewColorRampItem );
inserted = true;
}
else if(myColorRampItems[myCurrentIndex].value <= myNewColorRampItem.value && myCurrentIndex == myColorRampItems.size() - 1)
else if ( myColorRampItems[myCurrentIndex].value <= myNewColorRampItem.value && myCurrentIndex == myColorRampItems.size() - 1 )
{
myColorRampItems.push_back( myNewColorRampItem );
inserted = true;
}
else if(myColorRampItems[myCurrentIndex].value <= myNewColorRampItem.value && myColorRampItems[myCurrentIndex+1].value > myNewColorRampItem.value)
else if ( myColorRampItems[myCurrentIndex].value <= myNewColorRampItem.value && myColorRampItems[myCurrentIndex+1].value > myNewColorRampItem.value )
{
myColorRampItems.insert(myCurrentIndex+1,myNewColorRampItem );
myColorRampItems.insert( myCurrentIndex + 1, myNewColorRampItem );
inserted = true;
}
myCurrentIndex++;
}
}
populateColorMapTable(myColorRampItems);
populateColorMapTable( myColorRampItems );
}

QLinearGradient QgsRasterLayerProperties::redGradient()
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgsrasterlayerproperties.h
Expand Up @@ -179,9 +179,9 @@ class QgsRasterLayerProperties : public QDialog, private Ui::QgsRasterLayerPrope
included or not
*/
bool mRasterLayerIsWms;

/** \brief Clear current color map table and population with values from new list */
void populateColorMapTable(const QList<QgsColorRampShader::ColorRampItem>&);
void populateColorMapTable( const QList<QgsColorRampShader::ColorRampItem>& );

/** \brief Clear the current transparency table and populate the table with the correct types for current drawing mode and data type*/
void populateTransparencyTable();
Expand Down
10 changes: 5 additions & 5 deletions src/core/composer/qgscomposerlabel.cpp
Expand Up @@ -48,12 +48,12 @@ void QgsComposerLabel::paint( QPainter* painter, const QStyleOptionGraphicsItem*
painter->setFont( mFont );

QFontMetricsF fontSize( mFont );

//support multiline labels
double penWidth = pen().widthF();
QRectF painterRect(penWidth, penWidth, rect().width() - 2 * penWidth,
rect().height() - 2 * penWidth);
painter->drawText(painterRect, Qt::AlignLeft | Qt::AlignTop | Qt::TextWordWrap, mText);
QRectF painterRect( penWidth, penWidth, rect().width() - 2 * penWidth,
rect().height() - 2 * penWidth );
painter->drawText( painterRect, Qt::AlignLeft | Qt::AlignTop | Qt::TextWordWrap, mText );


drawFrame( painter );
Expand Down Expand Up @@ -86,7 +86,7 @@ void QgsComposerLabel::setFont( const QFont& f )
void QgsComposerLabel::adjustSizeToText()
{
QFontMetricsF fontInfo( mFont );
setSceneRect( QRectF( transform().dx(), transform().dy(), fontInfo.width( mText ) + 2 * mMargin + 2 * pen().widthF(), fontInfo.ascent() + 2 * mMargin + 2 * pen().widthF()) );
setSceneRect( QRectF( transform().dx(), transform().dy(), fontInfo.width( mText ) + 2 * mMargin + 2 * pen().widthF(), fontInfo.ascent() + 2 * mMargin + 2 * pen().widthF() ) );
}

QFont QgsComposerLabel::font() const
Expand Down
2 changes: 1 addition & 1 deletion src/core/composer/qgscomposerlegend.cpp
Expand Up @@ -440,7 +440,7 @@ QFont QgsComposerLegend::itemFont() const

void QgsComposerLegend::updateLegend()
{
mLegendModel.setLayerSet(layerIdList());
mLegendModel.setLayerSet( layerIdList() );
adjustBoxSize();
update();
}
Expand Down

0 comments on commit edbdba1

Please sign in to comment.