Skip to content

Commit 01ebd30

Browse files
author
jef
committed
minor update (indentation, debug output, plenks)
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@9189 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 70cf91a commit 01ebd30

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+393
-408
lines changed

python/core/qgsrasterdataprovider.sip

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public:
1919
{
2020
NoCapabilities = 0,
2121
Identify = 1
22-
// Capability2 = 1 << 1, , etc
22+
// Capability2 = 1 << 1, etc
2323
};
2424

2525

src/app/composer/qgscomposer.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -291,10 +291,10 @@ void QgsComposer::on_mActionZoomOut_activated( void )
291291

292292
void QgsComposer::on_mActionRefreshView_activated( void )
293293
{
294-
if(mComposition)
295-
{
296-
mComposition->update();
297-
}
294+
if ( mComposition )
295+
{
296+
mComposition->update();
297+
}
298298
}
299299

300300
void QgsComposer::on_mActionPrint_activated( void )
@@ -821,7 +821,7 @@ void QgsComposer::on_mActionExportAsImage_activated( void )
821821
QgsDebugMsg( QString( "Selected filter: %1" ).arg( myFilterString ) );
822822
QgsDebugMsg( QString( "Image type: %1" ).arg( myFilterMap[myFilterString] ) );
823823

824-
myQSettings.writeEntry( "/UI/lastSaveAsImageFormat" , myFilterMap[myFilterString] );
824+
myQSettings.writeEntry( "/UI/lastSaveAsImageFormat", myFilterMap[myFilterString] );
825825
myQSettings.writeEntry( "/UI/lastSaveAsImageFile", myOutputFileNameQString );
826826

827827
if ( myOutputFileNameQString == "" ) return;

src/app/legend/qgslegend.cpp

+19-26
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,8 @@ void QgsLegend::removeLayer( QString layer_key )
155155
}
156156

157157
QTreeWidgetItem* theItem = firstItem();
158-
#ifdef QGISDEBUG
159-
qWarning( "in QgsLegend::removeLayer" );
160-
#endif
158+
QgsDebugMsg( "called." )
159+
161160
while ( theItem )
162161
{
163162
QgsLegendItem *li = dynamic_cast<QgsLegendItem*>( theItem );
@@ -236,9 +235,8 @@ void QgsLegend::mouseMoveEvent( QMouseEvent * e )
236235
QgsLegendItem::DRAG_ACTION action = dest->accept( origin );
237236
if ( action == QgsLegendItem::REORDER )
238237
{
239-
#ifdef QGISDEBUG
240-
qWarning( "mouseMoveEvent::REORDER" );
241-
#endif
238+
QgsDebugMsg( "mouseMoveEvent::REORDER" );
239+
242240
if ( !yCoordAboveCenter( dest, e->y() ) ) //over bottom of item
243241
{
244242
if ( origin->nextSibling() != dest )
@@ -266,9 +264,8 @@ void QgsLegend::mouseMoveEvent( QMouseEvent * e )
266264
}
267265
else if ( action == QgsLegendItem::INSERT )
268266
{
269-
#ifdef QGISDEBUG
270-
qWarning( "mouseMoveEvent::INSERT" );
271-
#endif
267+
QgsDebugMsg( "mouseMoveEvent::INSERT" );
268+
272269
setCursor( QCursor( Qt::PointingHandCursor ) );
273270
if ( origin->parent() != dest )
274271
{
@@ -278,9 +275,8 @@ void QgsLegend::mouseMoveEvent( QMouseEvent * e )
278275
}
279276
else//no action
280277
{
281-
#ifdef QGISDEBUG
282-
qWarning( "mouseMoveEvent::NO_ACTION" );
283-
#endif
278+
QgsDebugMsg( "mouseMoveEvent::NO_ACTION" );
279+
284280
if ( origin->type() == QgsLegendItem::LEGEND_LAYER_FILE && mItemBeingMovedOrigPos != getItemPos( mItemBeingMoved ) )
285281
{
286282
resetToInitialPosition( mItemBeingMoved );
@@ -1121,17 +1117,15 @@ void QgsLegend::resetToInitialPosition( QTreeWidgetItem* li )
11211117
QgsLegendItem* formerParent = dynamic_cast<QgsLegendItem*>( li->parent() ); //todo: make sure legend layers are updated
11221118
if ( mRestoreInformation == FIRST_ITEM )
11231119
{
1124-
#ifdef QGISDEBUG
1125-
qWarning( "FIRST_ITEM" );
1126-
#endif
1120+
QgsDebugMsg( "FIRST_ITEM" );
1121+
11271122
removeItem( li );
11281123
insertTopLevelItem( 0, li );
11291124
}
11301125
else if ( mRestoreInformation == FIRST_CHILD )
11311126
{
1132-
#ifdef QGISDEBUG
1133-
qWarning( "FIRST_CHILD" );
1134-
#endif
1127+
QgsDebugMsg( "FIRST_CHILD" );
1128+
11351129
removeItem( li );
11361130
if ( formerParent )
11371131
{
@@ -1142,9 +1136,8 @@ void QgsLegend::resetToInitialPosition( QTreeWidgetItem* li )
11421136
}
11431137
else if ( mRestoreInformation == YOUNGER_SIBLING )
11441138
{
1145-
#ifdef QGISDEBUG
1146-
qWarning( "YOUNGER_SIBLING" );
1147-
#endif
1139+
QgsDebugMsg( "YOUNGER_SIBLING" );
1140+
11481141
if ( formerParent )
11491142
{
11501143
formerParent->release(( QgsLegendItem* )li );
@@ -1439,10 +1432,10 @@ std::deque<QString> QgsLegend::layerIDs()
14391432
}
14401433

14411434
#ifdef QGISDEBUG
1442-
qWarning( "QgsLegend::layerIDs()" );
1435+
QgsDebugMsg( "QgsLegend::layerIDs()" );
14431436
for ( std::deque<QString>::iterator it = layers.begin(); it != layers.end(); ++it )
14441437
{
1445-
qWarning(( *it ).toUtf8() );
1438+
QgsDebugMsg( *it );
14461439
}
14471440
#endif
14481441

@@ -1596,15 +1589,15 @@ void QgsLegend::handleItemChange( QTreeWidgetItem* item, int row )
15961589
#ifdef QGISDEBUG
15971590
if ( item->checkState( 0 ) == Qt::Checked )
15981591
{
1599-
qWarning( "item checked" );
1592+
QgsDebugMsg( "item checked" );
16001593
}
16011594
else if ( item->checkState( 0 ) == Qt::Unchecked )
16021595
{
1603-
qWarning( "item unchecked" );
1596+
QgsDebugMsg( "item unchecked" );
16041597
}
16051598
else if ( item->checkState( 0 ) == Qt::PartiallyChecked )
16061599
{
1607-
qWarning( "item partially checked" );
1600+
QgsDebugMsg( "item partially checked" );
16081601
}
16091602
#endif
16101603
blockSignals( true );

src/app/legend/qgslegendgroup.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#include <QCoreApplication>
2626
#include <QIcon>
2727

28-
QgsLegendGroup::QgsLegendGroup( QTreeWidgetItem * theItem , QString theName )
28+
QgsLegendGroup::QgsLegendGroup( QTreeWidgetItem * theItem, QString theName )
2929
: QgsLegendItem( theItem, theName )
3030
{
3131
mType = LEGEND_GROUP;

src/app/legend/qgslegendgroup.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ This is a specialised version of QLegendItem that specifies that the items below
3333
class QgsLegendGroup : public QgsLegendItem
3434
{
3535
public:
36-
QgsLegendGroup( QTreeWidgetItem * , QString );
36+
QgsLegendGroup( QTreeWidgetItem *, QString );
3737
QgsLegendGroup( QTreeWidget*, QString );
3838
QgsLegendGroup( QString name );
3939
~QgsLegendGroup();

src/app/legend/qgslegenditem.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include "qgslogger.h"
2424

2525

26-
QgsLegendItem::QgsLegendItem( QTreeWidgetItem * theItem , QString theName )
26+
QgsLegendItem::QgsLegendItem( QTreeWidgetItem * theItem, QString theName )
2727
: QTreeWidgetItem( theItem )
2828
{
2929
setText( 0, theName );

src/app/legend/qgslegendlayer.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ class QgsLegendLayer : public QgsLegendItem
4545
Q_OBJECT
4646

4747
public:
48-
QgsLegendLayer( QTreeWidgetItem * , QString );
49-
QgsLegendLayer( QTreeWidget* , QString );
48+
QgsLegendLayer( QTreeWidgetItem *, QString );
49+
QgsLegendLayer( QTreeWidget*, QString );
5050
QgsLegendLayer( QString name );
5151
~QgsLegendLayer();
5252
/**Sets an icon characterising the type of layer(s) it contains.

src/app/legend/qgslegendpropertygroup.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ container for layer properties (e.g. projection, scale dependent view)
3030
class QgsLegendPropertyGroup : public QgsLegendItem
3131
{
3232
public:
33-
QgsLegendPropertyGroup( QTreeWidgetItem * , QString );
33+
QgsLegendPropertyGroup( QTreeWidgetItem *, QString );
3434

3535
~QgsLegendPropertyGroup();
3636

src/app/legend/qgslegendpropertyitem.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include <QIcon>
2323

2424
QgsLegendPropertyItem::QgsLegendPropertyItem( QTreeWidgetItem * theItem, QString theString )
25-
: QgsLegendItem( theItem , theString )
25+
: QgsLegendItem( theItem, theString )
2626
{
2727
mType = LEGEND_PROPERTY_ITEM;
2828
QIcon myIcon( QgsApplication::pkgDataPath() + QString( "/images/icons/property_item.png" ) );

src/app/qgisapp.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -3439,7 +3439,7 @@ void QgisApp::saveMapAsImage()
34393439
myOutputFileNameQString += "." + myFilterMap[myFilterString];
34403440
}
34413441

3442-
myQSettings.setValue( "/UI/lastSaveAsImageFilter" , myFilterString );
3442+
myQSettings.setValue( "/UI/lastSaveAsImageFilter", myFilterString );
34433443
myQSettings.setValue( "/UI/lastSaveAsImageDir", myQFileDialog->directory().absolutePath() );
34443444

34453445
if ( myOutputFileNameQString != "" )

src/app/qgslabeldialog.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ void QgsLabelDialog::apply()
320320
{
321321
myTypeInt = QgsLabelAttributes::MapUnits;
322322
}
323-
myLabelAttributes->setSize( mFont.pointSize() , myTypeInt );
323+
myLabelAttributes->setSize( mFont.pointSize(), myTypeInt );
324324
myLabelAttributes->setBold( mFont.bold() );
325325
myLabelAttributes->setItalic( mFont.italic() );
326326
myLabelAttributes->setUnderline( mFont.underline() );
@@ -334,7 +334,7 @@ void QgsLabelDialog::apply()
334334
{
335335
myTypeInt = QgsLabelAttributes::MapUnits;
336336
}
337-
myLabelAttributes->setOffset( spinXOffset->value() , spinYOffset->value(), myTypeInt );
337+
myLabelAttributes->setOffset( spinXOffset->value(), spinYOffset->value(), myTypeInt );
338338
myLabelAttributes->setAngle( spinAngle->value() );
339339

340340
//the values here may seem a bit counterintuitive - basically everything

src/app/qgsrasterlayerproperties.cpp

+9-9
Original file line numberDiff line numberDiff line change
@@ -2123,9 +2123,9 @@ void QgsRasterLayerProperties::on_pbnHistRefresh_clicked()
21232123
{
21242124
myPainter.setPen( Qt::gray );
21252125
}
2126-
#ifdef QGISDEBUG
2127-
// QgsDebugMsg(QString("myPainter.fillRect(QRect(%1,%2,%3,%2) , myBrush );").arg(myX).arg(myY).arg(myBarWidth));
2128-
#endif
2126+
2127+
// QgsDebugMsg(QString("myPainter.fillRect(QRect(%1,%2,%3,%2), myBrush );").arg(myX).arg(myY).arg(myBarWidth));
2128+
21292129
myPainter.drawRect( myX + myYGutterWidth, myImageHeight - ( myY + myXGutterHeight ), myBarWidth, myY );
21302130
}
21312131
else //line graph
@@ -2209,10 +2209,10 @@ void QgsRasterLayerProperties::on_pbnHistRefresh_clicked()
22092209
for ( int i = 0;i < myXDivisions;++i )
22102210
{
22112211
QPolygon myPolygon;
2212-
myPolygon << QPoint(( i*myXDivisions ) + myYGutterWidth , myImageHeight - myXGutterHeight );
2213-
myPolygon << QPoint(( i*myXDivisions ) + myYGutterWidth , myImageHeight - ( myXGutterHeight - 5 ) );
2214-
myPolygon << QPoint(( i*myXDivisions ) + myYGutterWidth , myImageHeight - myXGutterHeight );
2215-
myPolygon << QPoint((( i + 1 )*myXDivisions ) + myYGutterWidth , myImageHeight - myXGutterHeight );
2212+
myPolygon << QPoint(( i*myXDivisions ) + myYGutterWidth, myImageHeight - myXGutterHeight );
2213+
myPolygon << QPoint(( i*myXDivisions ) + myYGutterWidth, myImageHeight - ( myXGutterHeight - 5 ) );
2214+
myPolygon << QPoint(( i*myXDivisions ) + myYGutterWidth, myImageHeight - myXGutterHeight );
2215+
myPolygon << QPoint((( i + 1 )*myXDivisions ) + myYGutterWidth, myImageHeight - myXGutterHeight );
22162216
myPainter.drawPolyline( myPolygon );
22172217
}
22182218
//
@@ -2235,7 +2235,7 @@ void QgsRasterLayerProperties::on_pbnHistRefresh_clicked()
22352235
//now draw the axis labels onto the graph
22362236
myPainter.drawText( 1, 12, myYMaxLabel );
22372237
myPainter.drawText( 1, myImageHeight - myXGutterHeight, QString::number( static_cast < unsigned int >( myYAxisMin ) ) );
2238-
myPainter.drawText( myYGutterWidth, myImageHeight - 1 , myXMinLabel );
2238+
myPainter.drawText( myYGutterWidth, myImageHeight - 1, myXMinLabel );
22392239
myPainter.drawText( myImageWidth - myXGutterWidth, myImageHeight - 1, myXMaxLabel );
22402240

22412241
//
@@ -2604,7 +2604,7 @@ void QgsRasterLayerProperties::on_mClassifyButton_clicked()
26042604
for ( int i = 0; i < numberOfEntries; ++i )
26052605
{
26062606
QColor currentColor;
2607-
currentColor.setRgb( colorDiff*i , 0, 255 - colorDiff * i );
2607+
currentColor.setRgb( colorDiff*i, 0, 255 - colorDiff * i );
26082608
entryColors.push_back( currentColor );
26092609
}
26102610

src/app/qgssinglesymboldialog.cpp

+10-19
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,13 @@
3737
QgsSingleSymbolDialog::QgsSingleSymbolDialog(): QDialog(), mVectorLayer( 0 )
3838
{
3939
setupUi( this );
40-
#ifdef QGISDEBUG
41-
qWarning( "constructor QgsSingleSymbolDialog called WITHOUT a layer" );
42-
#endif
40+
QgsDebugMsg( "entered." );
4341
}
4442

4543
QgsSingleSymbolDialog::QgsSingleSymbolDialog( QgsVectorLayer * layer, bool disabled ): QDialog(), mVectorLayer( layer )
4644
{
4745
setupUi( this );
48-
49-
#ifdef QGISDEBUG
50-
qWarning( "constructor QgsSingleSymbolDialog called WITH a layer" );
51-
#endif
46+
QgsDebugMsg( "entered." );
5247

5348
//
5449
//set point symbol list
@@ -110,7 +105,7 @@ QgsSingleSymbolDialog::QgsSingleSymbolDialog( QgsVectorLayer * layer, bool disab
110105
}
111106
else
112107
{
113-
qWarning( "Warning, data provider is null in QgsSingleSymbolDialog::QgsSingleSymbolDialog(...)" );
108+
QgsDebugMsg( "Warning, data provider is null" );
114109
return;
115110
}
116111
//
@@ -173,8 +168,7 @@ QgsSingleSymbolDialog::QgsSingleSymbolDialog( QgsVectorLayer * layer, bool disab
173168
}
174169
else
175170
{
176-
qWarning( "Warning, layer is a null pointer in "
177-
"QgsSingleSymbolDialog::QgsSingleSymbolDialog(QgsVectorLayer)" );
171+
QgsDebugMsg( "Warning, layer is a null pointer" );
178172
}
179173
}
180174

@@ -183,8 +177,8 @@ QgsSingleSymbolDialog::QgsSingleSymbolDialog( QgsVectorLayer * layer, bool disab
183177
connect( btnFillColor, SIGNAL( clicked() ), this, SLOT( selectFillColor() ) );
184178
connect( outlinewidthspinbox, SIGNAL( valueChanged( double ) ), this, SLOT( resendSettingsChanged() ) );
185179
connect( mLabelEdit, SIGNAL( textChanged( const QString& ) ), this, SLOT( resendSettingsChanged() ) );
186-
connect( lstSymbols, SIGNAL( currentItemChanged( QListWidgetItem * , QListWidgetItem * ) ),
187-
this, SLOT( symbolChanged( QListWidgetItem * , QListWidgetItem * ) ) );
180+
connect( lstSymbols, SIGNAL( currentItemChanged( QListWidgetItem *, QListWidgetItem * ) ),
181+
this, SLOT( symbolChanged( QListWidgetItem *, QListWidgetItem * ) ) );
188182
connect( mPointSizeSpinBox, SIGNAL( valueChanged( double ) ), this, SLOT( resendSettingsChanged() ) );
189183
connect( mRotationClassificationComboBox, SIGNAL( currentIndexChanged( const QString & ) ),
190184
this, SLOT( resendSettingsChanged() ) );
@@ -203,9 +197,7 @@ QgsSingleSymbolDialog::QgsSingleSymbolDialog( QgsVectorLayer * layer, bool disab
203197

204198
QgsSingleSymbolDialog::~QgsSingleSymbolDialog()
205199
{
206-
#ifdef QGISDEBUG
207-
qWarning( "destructor QgsSingleSymbolDialog" );
208-
#endif
200+
QgsDebugMsg( "entered." );
209201
}
210202

211203
void QgsSingleSymbolDialog::selectOutlineColor()
@@ -508,9 +500,8 @@ void QgsSingleSymbolDialog::setFillColor( QColor& c )
508500

509501
void QgsSingleSymbolDialog::setFillStyle( Qt::BrushStyle fstyle )
510502
{
511-
#ifdef QGISDEBUG
512-
qWarning(( "Setting fill style: " + QgsSymbologyUtils::brushStyle2QString( fstyle ) ).toLocal8Bit().data() );
513-
#endif
503+
QgsDebugMsg( QString( "Setting fill style: %1" ).arg( QgsSymbologyUtils::brushStyle2QString( fstyle ) ) );
504+
514505
QString myFillStyle = QgsSymbologyUtils::brushStyle2QString( fstyle );
515506
for ( int i = 0; i < cboFillStyle->count(); ++i )
516507
{
@@ -587,7 +578,7 @@ void QgsSingleSymbolDialog::fillStyleChanged( int theIndex )
587578
//if the new style is texture we need to enable the texture
588579
//selection button, otherwise disable it
589580
QString myFillStyle =
590-
cboFillStyle->itemData( theIndex , Qt::UserRole ).toString();
581+
cboFillStyle->itemData( theIndex, Qt::UserRole ).toString();
591582
if ( "TexturePattern" == myFillStyle )
592583
{
593584
toolSelectTexture->setEnabled( true );

src/core/composer/qgscomposermap.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class QPainter;
3636
* \brief Object representing map window.
3737
*/
3838
// NOTE: QgsComposerMapBase must be first, otherwise does not compile
39-
class CORE_EXPORT QgsComposerMap : /*public QWidget , private Ui::QgsComposerMapBase,*/ public QObject, public QgsComposerItem
39+
class CORE_EXPORT QgsComposerMap : /*public QWidget, private Ui::QgsComposerMapBase,*/ public QObject, public QgsComposerItem
4040
{
4141
Q_OBJECT
4242

0 commit comments

Comments
 (0)