Skip to content

Commit 1e4e5fa

Browse files
author
jef
committed
cleanups
- remove superfluous backslashes - fix QgsDebugMsg macro - disable code with #if 0/#endif instead of commenting it out - remove namespaces from ogr converter plugin git-svn-id: http://svn.osgeo.org/qgis/trunk@9218 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent f6e43c7 commit 1e4e5fa

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

+107
-179
lines changed

src/app/legend/qgslegend.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ void QgsLegend::removeLayer( QString layer_key )
155155
}
156156

157157
QTreeWidgetItem* theItem = firstItem();
158-
QgsDebugMsg( "called." )
158+
QgsDebugMsg( "called." );
159159

160160
while ( theItem )
161161
{
@@ -1255,7 +1255,7 @@ QTreeWidgetItem* QgsLegend::nextItem( QTreeWidgetItem* item )
12551255
{
12561256
return ( dynamic_cast<QgsLegendItem*>( litem->parent()->parent() )->nextSibling() );
12571257
}
1258-
else if ( litem->parent() && litem->parent()->parent() && litem->parent()->parent()->parent() && \
1258+
else if ( litem->parent() && litem->parent()->parent() && litem->parent()->parent()->parent() &&
12591259
(( QgsLegendItem* )( litem->parent()->parent()->parent() ) )->nextSibling() )//maximum four nesting states in the current legend
12601260
{
12611261
return ( dynamic_cast<QgsLegendItem*>( litem->parent()->parent()->parent() )->nextSibling() );

src/app/qgisapp.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2859,7 +2859,7 @@ void QgisApp::newVectorLayer()
28592859
{
28602860
QgsDebugMsg( "ogr provider loaded" );
28612861

2862-
typedef bool ( *createEmptyDataSourceProc )( const QString&, const QString&, const QString&, QGis::WKBTYPE, \
2862+
typedef bool ( *createEmptyDataSourceProc )( const QString&, const QString&, const QString&, QGis::WKBTYPE,
28632863
const std::list<std::pair<QString, QString> >& );
28642864
createEmptyDataSourceProc createEmptyDataSource = ( createEmptyDataSourceProc ) cast_to_fptr( myLib->resolve( "createEmptyDataSource" ) );
28652865
if ( createEmptyDataSource )

src/app/qgisappinterface.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ QgsRasterLayer* QgisAppInterface::addRasterLayer( QString rasterLayerPath, QStri
7777
return qgis->addRasterLayer( rasterLayerPath, baseName );
7878
}
7979

80-
QgsRasterLayer* QgisAppInterface::addRasterLayer( const QString& url, const QString& baseName, const QString& providerKey, \
80+
QgsRasterLayer* QgisAppInterface::addRasterLayer( const QString& url, const QString& baseName, const QString& providerKey,
8181
const QStringList& layers, const QStringList& styles, const QString& format, const QString& crs )
8282
{
8383
return qgis->addRasterLayer( url, baseName, providerKey, layers, styles, format, crs );

src/app/qgisappinterface.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class QgisAppInterface : public QgisInterface
5555
//! Add a raster layer given its file name
5656
QgsRasterLayer* addRasterLayer( QString rasterLayerPath, QString baseName );
5757
//! Add a WMS layer
58-
QgsRasterLayer* addRasterLayer( const QString& url, const QString& baseName, const QString& providerKey, \
58+
QgsRasterLayer* addRasterLayer( const QString& url, const QString& baseName, const QString& providerKey,
5959
const QStringList& layers, const QStringList& styles, const QString& format, const QString& crs );
6060

6161
//! Add a project

src/app/qgsmaptooladdfeature.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ void QgsMapToolAddFeature::canvasReleaseEvent( QMouseEvent * e )
5353
QGis::WKBTYPE layerWKBType = vlayer->geometryType();
5454

5555
//no support for adding features to 2.5D types yet
56-
if ( layerWKBType == QGis::WKBLineString25D || layerWKBType == QGis::WKBPolygon25D || \
56+
if ( layerWKBType == QGis::WKBLineString25D || layerWKBType == QGis::WKBPolygon25D ||
5757
layerWKBType == QGis::WKBMultiLineString25D || layerWKBType == QGis::WKBPoint25D || layerWKBType == QGis::WKBMultiPoint25D )
5858
{
5959
QMessageBox::critical( 0, QObject::tr( "2.5D shape type not supported" ), QObject::tr( "Adding features to 2.5D shapetypes is not supported yet" ) );
@@ -109,7 +109,7 @@ void QgsMapToolAddFeature::canvasReleaseEvent( QMouseEvent * e )
109109
catch ( QgsCsException &cse )
110110
{
111111
Q_UNUSED( cse );
112-
QMessageBox::information( 0, QObject::tr( "Coordinate transform error" ), \
112+
QMessageBox::information( 0, QObject::tr( "Coordinate transform error" ),
113113
QObject::tr( "Cannot transform the point to the layers coordinate system" ) );
114114
return;
115115
}
@@ -219,7 +219,7 @@ void QgsMapToolAddFeature::canvasReleaseEvent( QMouseEvent * e )
219219
else if ( error == 2 )
220220
{
221221
//problem with coordinate transformation
222-
QMessageBox::information( 0, QObject::tr( "Coordinate transform error" ), \
222+
QMessageBox::information( 0, QObject::tr( "Coordinate transform error" ),
223223
QObject::tr( "Cannot transform the point to the layers coordinate system" ) );
224224
return;
225225
}

src/app/qgsmaptooladdisland.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ void QgsMapToolAddIsland::canvasReleaseEvent( QMouseEvent * e )
4040

4141
if ( !vlayer )
4242
{
43-
QMessageBox::information( 0, QObject::tr( "Not a vector layer" ), \
43+
QMessageBox::information( 0, QObject::tr( "Not a vector layer" ),
4444
QObject::tr( "The current layer is not a vector layer" ) );
4545
return;
4646
}
@@ -63,7 +63,7 @@ void QgsMapToolAddIsland::canvasReleaseEvent( QMouseEvent * e )
6363
else if ( error == 2 )
6464
{
6565
//problem with coordinate transformation
66-
QMessageBox::information( 0, QObject::tr( "Coordinate transform error" ), \
66+
QMessageBox::information( 0, QObject::tr( "Coordinate transform error" ),
6767
QObject::tr( "Cannot transform the point to the layers coordinate system" ) );
6868
return;
6969
}

src/app/qgsmaptooladdring.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ void QgsMapToolAddRing::canvasReleaseEvent( QMouseEvent * e )
4040

4141
if ( !vlayer )
4242
{
43-
QMessageBox::information( 0, QObject::tr( "Not a vector layer" ), \
43+
QMessageBox::information( 0, QObject::tr( "Not a vector layer" ),
4444
QObject::tr( "The current layer is not a vector layer" ) );
4545
return;
4646
}
@@ -63,7 +63,7 @@ void QgsMapToolAddRing::canvasReleaseEvent( QMouseEvent * e )
6363
else if ( error == 2 )
6464
{
6565
//problem with coordinate transformation
66-
QMessageBox::information( 0, QObject::tr( "Coordinate transform error" ), \
66+
QMessageBox::information( 0, QObject::tr( "Coordinate transform error" ),
6767
QObject::tr( "Cannot transform the point to the layers coordinate system" ) );
6868
return;
6969
}

src/app/qgsmaptoolsplitfeatures.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ void QgsMapToolSplitFeatures::canvasReleaseEvent( QMouseEvent * e )
3939

4040
if ( !vlayer )
4141
{
42-
QMessageBox::information( 0, QObject::tr( "Not a vector layer" ), \
42+
QMessageBox::information( 0, QObject::tr( "Not a vector layer" ),
4343
QObject::tr( "The current layer is not a vector layer" ) );
4444
return;
4545
}
@@ -62,7 +62,7 @@ void QgsMapToolSplitFeatures::canvasReleaseEvent( QMouseEvent * e )
6262
else if ( error == 2 )
6363
{
6464
//problem with coordinate transformation
65-
QMessageBox::information( 0, QObject::tr( "Coordinate transform error" ), \
65+
QMessageBox::information( 0, QObject::tr( "Coordinate transform error" ),
6666
QObject::tr( "Cannot transform the point to the layers coordinate system" ) );
6767
return;
6868
}

src/app/qgspastetransformations.cpp

-17
Original file line numberDiff line numberDiff line change
@@ -175,23 +175,6 @@ void QgsPasteTransformations::layerChanged( const QString& layerName, std::vecto
175175
// Fetch the fields that will be populated into the Transfer rows.
176176
QgsDebugMsg( QString( "Layer changed to %1." ).arg( layerName ) );
177177

178-
/*
179-
// XXX What does this code do??? [MD]
180-
std::vector<QgsField> layerFields =
181-
(mMapNameLookup[ layerName ])->fields();
182-
183-
fields->clear();
184-
185-
for (std::vector<QgsField>::iterator it = layerFields.begin();
186-
it != layerFields.end();
187-
++it )
188-
{
189-
QgsDebugMsg(QString("Got field %1.").arg(it->name()));
190-
191-
fields->push_back(it->name());
192-
}
193-
*/
194-
195178
restoreTransfers( sourceLayerComboBox ->currentText(),
196179
destinationLayerComboBox->currentText() );
197180
}

src/app/qgspluginmanager.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -272,23 +272,23 @@ void QgsPluginManager::getPluginDescriptions()
272272
}
273273
else
274274
{
275-
QgsDebugMsg( "Plugin name not returned when queried\n" );
275+
QgsDebugMsg( "Plugin name not returned when queried" );
276276
}
277277
if ( pDesc )
278278
{
279279
QgsDebugMsg( "Plugin description: " + pDesc() );
280280
}
281281
else
282282
{
283-
QgsDebugMsg( "Plugin description not returned when queried\n" );
283+
QgsDebugMsg( "Plugin description not returned when queried" );
284284
}
285285
if ( pVersion )
286286
{
287287
QgsDebugMsg( "Plugin version: " + pVersion() );
288288
}
289289
else
290290
{
291-
QgsDebugMsg( "Plugin version not returned when queried\n" );
291+
QgsDebugMsg( "Plugin version not returned when queried" );
292292
}
293293

294294
if ( !pName || !pDesc || !pVersion )

src/app/qgsrasterlayerproperties.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2561,7 +2561,7 @@ void QgsRasterLayerProperties::on_mClassifyButton_clicked()
25612561
{
25622562
//because the highest value is also an entry, there are (numberOfEntries - 1)
25632563
//intervals
2564-
intervalDiff = ( myRasterBandStats.maxVal - myRasterBandStats.minVal ) / \
2564+
intervalDiff = ( myRasterBandStats.maxVal - myRasterBandStats.minVal ) /
25652565
( numberOfEntries - 1 );
25662566
}
25672567
else

src/app/qgssnappingdialog.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class QgsSnappingDialog: public QDialog, private Ui::QgsSnappingDialogBase
4343
QgsSnappingDialog( QgsMapCanvas* canvas, const QMap<QString, LayerEntry >& settings );
4444
~QgsSnappingDialog();
4545

46-
/**Returns the snapping settings per layer. Key of the map is the layer id and value the \
46+
/**Returns the snapping settings per layer. Key of the map is the layer id and value the
4747
corresponding layer entry*/
4848
void layerSettings( QMap<QString, LayerEntry>& settings ) const;
4949

src/core/composer/qgscomposerlabel.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ void QgsComposerLabel::paint( QPainter* painter, const QStyleOptionGraphicsItem*
5151

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

src/core/composer/qgsnumericscalebarstyle.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ void QgsNumericScaleBarStyle::draw( QPainter* p, double xOffset ) const
5050
p->save();
5151

5252
p->setFont( mScaleBar->font() );
53-
p->drawText( QPointF( mScaleBar->pen().widthF() + mScaleBar->boxContentSpace(), mScaleBar->boxContentSpace() \
53+
p->drawText( QPointF( mScaleBar->pen().widthF() + mScaleBar->boxContentSpace(), mScaleBar->boxContentSpace()
5454
+ mScaleBar->fontHeight() ), scaleText() );
5555

5656
p->restore();
@@ -65,8 +65,8 @@ QRectF QgsNumericScaleBarStyle::calculateBoxSize() const
6565
}
6666

6767
QFontMetricsF fontMetrics( mScaleBar->font() );
68-
return QRectF( mScaleBar->transform().dx(), mScaleBar->transform().dy(), 2 * mScaleBar->boxContentSpace() \
69-
+ 2 * mScaleBar->pen().width() + fontMetrics.width( scaleText() ), \
68+
return QRectF( mScaleBar->transform().dx(), mScaleBar->transform().dy(), 2 * mScaleBar->boxContentSpace()
69+
+ 2 * mScaleBar->pen().width() + fontMetrics.width( scaleText() ),
7070
mScaleBar->fontHeight() + 2 * mScaleBar->boxContentSpace() );
7171
}
7272

src/core/qgscoordinatereferencesystem.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ bool QgsCoordinateReferenceSystem::createFromWkt( QString theWkt )
246246

247247
if ( theWkt.isEmpty() )
248248
{
249-
QgsDebugMsg( "theWkt is uninitialised, operation failed" )
249+
QgsDebugMsg( "theWkt is uninitialised, operation failed" );
250250
QgsLogger::critical( "QgsCoordinateReferenceSystem::createFromWkt -- theWkt is uninitialised, operation failed" );
251251
return mIsValidFlag;
252252
}

src/core/qgsdistancearea.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ bool QgsDistanceArea::setEllipsoid( const QString& ellipsoid )
121121
// row for this ellipsoid wasn't found?
122122
if ( radius.isEmpty() || parameter2.isEmpty() )
123123
{
124-
QgsDebugMsg( QString( "setEllipsoid: no row in tbl_ellipsoid for acronym '" ) + ellipsoid.toLocal8Bit().data() + "'" )
124+
QgsDebugMsg( QString( "setEllipsoid: no row in tbl_ellipsoid for acronym '" ) + ellipsoid.toLocal8Bit().data() + "'" );
125125
return false;
126126
}
127127

@@ -130,7 +130,7 @@ bool QgsDistanceArea::setEllipsoid( const QString& ellipsoid )
130130
mSemiMajor = radius.mid( 2 ).toDouble();
131131
else
132132
{
133-
QgsDebugMsg( QString( "setEllipsoid: wrong format of radius field: '" ) + radius.toLocal8Bit().data() + "'" )
133+
QgsDebugMsg( QString( "setEllipsoid: wrong format of radius field: '" ) + radius.toLocal8Bit().data() + "'" );
134134
return false;
135135
}
136136

@@ -149,11 +149,11 @@ bool QgsDistanceArea::setEllipsoid( const QString& ellipsoid )
149149
}
150150
else
151151
{
152-
QgsDebugMsg( QString( "setEllipsoid: wrong format of parameter2 field: '" ) + parameter2.toLocal8Bit().data() + "'" )
152+
QgsDebugMsg( QString( "setEllipsoid: wrong format of parameter2 field: '" ) + parameter2.toLocal8Bit().data() + "'" );
153153
return false;
154154
}
155155

156-
QgsDebugMsg( QString( "setEllipsoid: a=" ) + mSemiMajor + ", b=" + mSemiMinor + ", 1/f=" + mInvFlattening )
156+
QgsDebugMsg( QString( "setEllipsoid: a=" ) + mSemiMajor + ", b=" + mSemiMinor + ", 1/f=" + mInvFlattening );
157157

158158

159159
// get spatial ref system for ellipsoid

src/core/qgsgeometry.cpp

+2-9
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,6 @@ email : morb at ozemail dot com dot au
3535
return r; \
3636
}
3737

38-
#define RELAY_GEOS() \
39-
catch (GEOSException &e) \
40-
{ \
41-
Q_UNUSED(e); \
42-
throw; \
43-
}
44-
4538
class GEOSException
4639
{
4740
public:
@@ -4479,8 +4472,8 @@ bool QgsGeometry::convertToMultiType()
44794472

44804473
QGis::WKBTYPE geomType = wkbType();
44814474

4482-
if ( geomType == QGis::WKBMultiPoint || geomType == QGis::WKBMultiPoint25D || \
4483-
geomType == QGis::WKBMultiLineString || geomType == QGis::WKBMultiLineString25D || \
4475+
if ( geomType == QGis::WKBMultiPoint || geomType == QGis::WKBMultiPoint25D ||
4476+
geomType == QGis::WKBMultiLineString || geomType == QGis::WKBMultiLineString25D ||
44844477
geomType == QGis::WKBMultiPolygon || geomType == QGis::WKBMultiPolygon25D || geomType == QGis::WKBUnknown )
44854478
{
44864479
return false; //no need to convert

src/core/qgsgeometry.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ class CORE_EXPORT QgsGeometry
132132
double distance( QgsGeometry& geom );
133133

134134
/**
135-
Returns the vertex closest to the given point, the corresponding vertex index, squared distance snap point / target pointand \
135+
Returns the vertex closest to the given point, the corresponding vertex index, squared distance snap point / target point
136136
and the indices of the vertices before/after. The vertices before/after are -1 if not present
137137
*/
138138
QgsPoint closestVertex( const QgsPoint& point, int& atVertex, int& beforeVertex, int& afterVertex, double& sqrDist );
@@ -220,7 +220,7 @@ class CORE_EXPORT QgsGeometry
220220
double closestSegmentWithContext( const QgsPoint& point, QgsPoint& minDistPoint, int& beforeVertex );
221221

222222
/**Adds a new ring to this geometry. This makes only sense for polygon and multipolygons.
223-
@return 0 in case of success (ring added), 1 problem with geometry type, 2 ring not closed, \
223+
@return 0 in case of success (ring added), 1 problem with geometry type, 2 ring not closed,
224224
3 ring is not valid geometry, 4 ring not disjoint with existing rings, 5 no polygon found which contained the ring*/
225225
int addRing( const QList<QgsPoint>& ring );
226226

src/core/qgslogger.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
#include <QString>
2424

2525
#ifdef QGISDEBUG
26-
#define QgsDebugMsg(str) QgsLogger::debug(QString(str), 1, __FILE__, __FUNCTION__, __LINE__);
26+
#define QgsDebugMsg(str) QgsLogger::debug(QString(str), 1, __FILE__, __FUNCTION__, __LINE__)
2727
#define QgsDebugMsgLevel(str, level) QgsLogger::debug(QString(str), level,\
28-
__FILE__, __FUNCTION__, __LINE__);
28+
__FILE__, __FUNCTION__, __LINE__)
2929
#else
3030
#define QgsDebugMsg(str)
3131
#define QgsDebugMsgLevel(str, level)
@@ -100,7 +100,7 @@ class CORE_EXPORT QgsLogger
100100
static void fatal( const QString& msg );
101101

102102
private:
103-
/**Reads the environment variable QGIS_DEBUG and converts it to int. If QGIS_DEBUG is not set,\
103+
/**Reads the environment variable QGIS_DEBUG and converts it to int. If QGIS_DEBUG is not set,
104104
the function returns 1 if QGISDEBUG is defined and 0 if not*/
105105
static int debugLevel();
106106

src/core/qgspoint.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ int QgsPoint::onSegment( const QgsPoint& a, const QgsPoint& b ) const
9898
{
9999
//algorithm from 'graphics GEMS', A. Paeth: 'A Fast 2D Point-on-line test'
100100
if (
101-
fabs(( b.y() - a.y() ) * ( m_x - a.x() ) - ( m_y - a.y() ) * ( b.x() - a.x() ) ) \
101+
fabs(( b.y() - a.y() ) * ( m_x - a.x() ) - ( m_y - a.y() ) * ( b.x() - a.x() ) )
102102
>= qMax( fabs( b.x() - a.x() ), fabs( b.y() - a.y() ) )
103103
)
104104
{

src/core/qgsprojectfiletransform.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ bool QgsProjectFileTransform::updateRevision( QgsProjectVersion newVersion )
6060

6161
void QgsProjectFileTransform::dump()
6262
{
63-
QgsDebugMsg( QString( "Current project file version is %1.%2.%3\n" )
63+
QgsDebugMsg( QString( "Current project file version is %1.%2.%3" )
6464
.arg( mCurrentVersion.majorVersion() )
6565
.arg( mCurrentVersion.minorVersion() )
6666
.arg( mCurrentVersion.subVersion() ) );

src/core/qgsvectorlayer.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -2150,14 +2150,14 @@ bool QgsVectorLayer::readXml( QDomNode & layer_node )
21502150
enableLabels( true );
21512151
}
21522152

2153-
QgsDebugMsg( "Testing if qgsvectorlayer can call label readXML routine" )
2153+
QgsDebugMsg( "Testing if qgsvectorlayer can call label readXML routine" );
21542154

21552155

21562156
QDomNode labelattributesnode = layer_node.namedItem( "labelattributes" );
21572157

21582158
if ( !labelattributesnode.isNull() )
21592159
{
2160-
QgsDebugMsg( "qgsvectorlayer calling label readXML routine" )
2160+
QgsDebugMsg( "qgsvectorlayer calling label readXML routine" );
21612161
mLabel->readXML( labelattributesnode );
21622162
}
21632163

0 commit comments

Comments
 (0)