Skip to content
Permalink
Browse files
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
  • Loading branch information
jef committed Aug 30, 2008
1 parent f6e43c7 commit 1e4e5fab04ce4eec01f479a56a4b57927e1e69a6
Showing with 107 additions and 179 deletions.
  1. +2 −2 src/app/legend/qgslegend.cpp
  2. +1 −1 src/app/qgisapp.cpp
  3. +1 −1 src/app/qgisappinterface.cpp
  4. +1 −1 src/app/qgisappinterface.h
  5. +3 −3 src/app/qgsmaptooladdfeature.cpp
  6. +2 −2 src/app/qgsmaptooladdisland.cpp
  7. +2 −2 src/app/qgsmaptooladdring.cpp
  8. +2 −2 src/app/qgsmaptoolsplitfeatures.cpp
  9. +0 −17 src/app/qgspastetransformations.cpp
  10. +3 −3 src/app/qgspluginmanager.cpp
  11. +1 −1 src/app/qgsrasterlayerproperties.cpp
  12. +1 −1 src/app/qgssnappingdialog.h
  13. +1 −1 src/core/composer/qgscomposerlabel.cpp
  14. +3 −3 src/core/composer/qgsnumericscalebarstyle.cpp
  15. +1 −1 src/core/qgscoordinatereferencesystem.cpp
  16. +4 −4 src/core/qgsdistancearea.cpp
  17. +2 −9 src/core/qgsgeometry.cpp
  18. +2 −2 src/core/qgsgeometry.h
  19. +3 −3 src/core/qgslogger.h
  20. +1 −1 src/core/qgspoint.cpp
  21. +1 −1 src/core/qgsprojectfiletransform.cpp
  22. +2 −2 src/core/qgsvectorlayer.cpp
  23. +15 −15 src/core/raster/qgsrasterlayer.cpp
  24. +1 −1 src/core/renderer/qgscontinuouscolorrenderer.cpp
  25. +1 −1 src/core/symbology/qgssymbol.cpp
  26. +1 −1 src/gui/qgisinterface.h
  27. +5 −3 src/gui/qgsmapcanvas.cpp
  28. +4 −2 src/gui/qgsmapoverviewcanvas.cpp
  29. +1 −1 src/gui/qgsrubberband.cpp
  30. +2 −2 src/plugins/grass/qgsgrassnewmapset.cpp
  31. +5 −3 src/plugins/grass/qgsgrassselect.cpp
  32. +8 −4 src/plugins/interpolation/MathUtils.cc
  33. +5 −5 src/plugins/interpolation/qgsinterpolationdialog.cpp
  34. +0 −14 src/plugins/ogr_converter/dialog.cpp
  35. +0 −4 src/plugins/ogr_converter/dialog.h
  36. +0 −5 src/plugins/ogr_converter/format.cpp
  37. +0 −5 src/plugins/ogr_converter/format.h
  38. +0 −6 src/plugins/ogr_converter/plugin.cpp
  39. +0 −4 src/plugins/ogr_converter/plugin.h
  40. +0 −13 src/plugins/ogr_converter/translator.cpp
  41. +0 −5 src/plugins/ogr_converter/translator.h
  42. +1 −1 src/plugins/wfs/qgswfssourceselect.h
  43. +4 −4 src/providers/ogr/qgsogrprovider.cpp
  44. +3 −3 src/providers/wfs/qgswfsprovider.cpp
  45. +2 −2 src/providers/wfs/qgswfsprovider.h
  46. +10 −12 src/providers/wms/qgswmsprovider.cpp
@@ -155,7 +155,7 @@ void QgsLegend::removeLayer( QString layer_key )
}

QTreeWidgetItem* theItem = firstItem();
QgsDebugMsg( "called." )
QgsDebugMsg( "called." );

while ( theItem )
{
@@ -1255,7 +1255,7 @@ QTreeWidgetItem* QgsLegend::nextItem( QTreeWidgetItem* item )
{
return ( dynamic_cast<QgsLegendItem*>( litem->parent()->parent() )->nextSibling() );
}
else if ( litem->parent() && litem->parent()->parent() && litem->parent()->parent()->parent() && \
else if ( litem->parent() && litem->parent()->parent() && litem->parent()->parent()->parent() &&
(( QgsLegendItem* )( litem->parent()->parent()->parent() ) )->nextSibling() )//maximum four nesting states in the current legend
{
return ( dynamic_cast<QgsLegendItem*>( litem->parent()->parent()->parent() )->nextSibling() );
@@ -2859,7 +2859,7 @@ void QgisApp::newVectorLayer()
{
QgsDebugMsg( "ogr provider loaded" );

typedef bool ( *createEmptyDataSourceProc )( const QString&, const QString&, const QString&, QGis::WKBTYPE, \
typedef bool ( *createEmptyDataSourceProc )( const QString&, const QString&, const QString&, QGis::WKBTYPE,
const std::list<std::pair<QString, QString> >& );
createEmptyDataSourceProc createEmptyDataSource = ( createEmptyDataSourceProc ) cast_to_fptr( myLib->resolve( "createEmptyDataSource" ) );
if ( createEmptyDataSource )
@@ -77,7 +77,7 @@ QgsRasterLayer* QgisAppInterface::addRasterLayer( QString rasterLayerPath, QStri
return qgis->addRasterLayer( rasterLayerPath, baseName );
}

QgsRasterLayer* QgisAppInterface::addRasterLayer( const QString& url, const QString& baseName, const QString& providerKey, \
QgsRasterLayer* QgisAppInterface::addRasterLayer( const QString& url, const QString& baseName, const QString& providerKey,
const QStringList& layers, const QStringList& styles, const QString& format, const QString& crs )
{
return qgis->addRasterLayer( url, baseName, providerKey, layers, styles, format, crs );
@@ -55,7 +55,7 @@ class QgisAppInterface : public QgisInterface
//! Add a raster layer given its file name
QgsRasterLayer* addRasterLayer( QString rasterLayerPath, QString baseName );
//! Add a WMS layer
QgsRasterLayer* addRasterLayer( const QString& url, const QString& baseName, const QString& providerKey, \
QgsRasterLayer* addRasterLayer( const QString& url, const QString& baseName, const QString& providerKey,
const QStringList& layers, const QStringList& styles, const QString& format, const QString& crs );

//! Add a project
@@ -53,7 +53,7 @@ void QgsMapToolAddFeature::canvasReleaseEvent( QMouseEvent * e )
QGis::WKBTYPE layerWKBType = vlayer->geometryType();

//no support for adding features to 2.5D types yet
if ( layerWKBType == QGis::WKBLineString25D || layerWKBType == QGis::WKBPolygon25D || \
if ( layerWKBType == QGis::WKBLineString25D || layerWKBType == QGis::WKBPolygon25D ||
layerWKBType == QGis::WKBMultiLineString25D || layerWKBType == QGis::WKBPoint25D || layerWKBType == QGis::WKBMultiPoint25D )
{
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 )
catch ( QgsCsException &cse )
{
Q_UNUSED( cse );
QMessageBox::information( 0, QObject::tr( "Coordinate transform error" ), \
QMessageBox::information( 0, QObject::tr( "Coordinate transform error" ),
QObject::tr( "Cannot transform the point to the layers coordinate system" ) );
return;
}
@@ -219,7 +219,7 @@ void QgsMapToolAddFeature::canvasReleaseEvent( QMouseEvent * e )
else if ( error == 2 )
{
//problem with coordinate transformation
QMessageBox::information( 0, QObject::tr( "Coordinate transform error" ), \
QMessageBox::information( 0, QObject::tr( "Coordinate transform error" ),
QObject::tr( "Cannot transform the point to the layers coordinate system" ) );
return;
}
@@ -40,7 +40,7 @@ void QgsMapToolAddIsland::canvasReleaseEvent( QMouseEvent * e )

if ( !vlayer )
{
QMessageBox::information( 0, QObject::tr( "Not a vector layer" ), \
QMessageBox::information( 0, QObject::tr( "Not a vector layer" ),
QObject::tr( "The current layer is not a vector layer" ) );
return;
}
@@ -63,7 +63,7 @@ void QgsMapToolAddIsland::canvasReleaseEvent( QMouseEvent * e )
else if ( error == 2 )
{
//problem with coordinate transformation
QMessageBox::information( 0, QObject::tr( "Coordinate transform error" ), \
QMessageBox::information( 0, QObject::tr( "Coordinate transform error" ),
QObject::tr( "Cannot transform the point to the layers coordinate system" ) );
return;
}
@@ -40,7 +40,7 @@ void QgsMapToolAddRing::canvasReleaseEvent( QMouseEvent * e )

if ( !vlayer )
{
QMessageBox::information( 0, QObject::tr( "Not a vector layer" ), \
QMessageBox::information( 0, QObject::tr( "Not a vector layer" ),
QObject::tr( "The current layer is not a vector layer" ) );
return;
}
@@ -63,7 +63,7 @@ void QgsMapToolAddRing::canvasReleaseEvent( QMouseEvent * e )
else if ( error == 2 )
{
//problem with coordinate transformation
QMessageBox::information( 0, QObject::tr( "Coordinate transform error" ), \
QMessageBox::information( 0, QObject::tr( "Coordinate transform error" ),
QObject::tr( "Cannot transform the point to the layers coordinate system" ) );
return;
}
@@ -39,7 +39,7 @@ void QgsMapToolSplitFeatures::canvasReleaseEvent( QMouseEvent * e )

if ( !vlayer )
{
QMessageBox::information( 0, QObject::tr( "Not a vector layer" ), \
QMessageBox::information( 0, QObject::tr( "Not a vector layer" ),
QObject::tr( "The current layer is not a vector layer" ) );
return;
}
@@ -62,7 +62,7 @@ void QgsMapToolSplitFeatures::canvasReleaseEvent( QMouseEvent * e )
else if ( error == 2 )
{
//problem with coordinate transformation
QMessageBox::information( 0, QObject::tr( "Coordinate transform error" ), \
QMessageBox::information( 0, QObject::tr( "Coordinate transform error" ),
QObject::tr( "Cannot transform the point to the layers coordinate system" ) );
return;
}
@@ -175,23 +175,6 @@ void QgsPasteTransformations::layerChanged( const QString& layerName, std::vecto
// Fetch the fields that will be populated into the Transfer rows.
QgsDebugMsg( QString( "Layer changed to %1." ).arg( layerName ) );

/*
// XXX What does this code do??? [MD]
std::vector<QgsField> layerFields =
(mMapNameLookup[ layerName ])->fields();
fields->clear();
for (std::vector<QgsField>::iterator it = layerFields.begin();
it != layerFields.end();
++it )
{
QgsDebugMsg(QString("Got field %1.").arg(it->name()));
fields->push_back(it->name());
}
*/

restoreTransfers( sourceLayerComboBox ->currentText(),
destinationLayerComboBox->currentText() );
}
@@ -272,23 +272,23 @@ void QgsPluginManager::getPluginDescriptions()
}
else
{
QgsDebugMsg( "Plugin name not returned when queried\n" );
QgsDebugMsg( "Plugin name not returned when queried" );
}
if ( pDesc )
{
QgsDebugMsg( "Plugin description: " + pDesc() );
}
else
{
QgsDebugMsg( "Plugin description not returned when queried\n" );
QgsDebugMsg( "Plugin description not returned when queried" );
}
if ( pVersion )
{
QgsDebugMsg( "Plugin version: " + pVersion() );
}
else
{
QgsDebugMsg( "Plugin version not returned when queried\n" );
QgsDebugMsg( "Plugin version not returned when queried" );
}

if ( !pName || !pDesc || !pVersion )
@@ -2561,7 +2561,7 @@ void QgsRasterLayerProperties::on_mClassifyButton_clicked()
{
//because the highest value is also an entry, there are (numberOfEntries - 1)
//intervals
intervalDiff = ( myRasterBandStats.maxVal - myRasterBandStats.minVal ) / \
intervalDiff = ( myRasterBandStats.maxVal - myRasterBandStats.minVal ) /
( numberOfEntries - 1 );
}
else
@@ -43,7 +43,7 @@ class QgsSnappingDialog: public QDialog, private Ui::QgsSnappingDialogBase
QgsSnappingDialog( QgsMapCanvas* canvas, const QMap<QString, LayerEntry >& settings );
~QgsSnappingDialog();

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

@@ -51,7 +51,7 @@ void QgsComposerLabel::paint( QPainter* painter, const QStyleOptionGraphicsItem*

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

@@ -50,7 +50,7 @@ void QgsNumericScaleBarStyle::draw( QPainter* p, double xOffset ) const
p->save();

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

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

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

@@ -246,7 +246,7 @@ bool QgsCoordinateReferenceSystem::createFromWkt( QString theWkt )

if ( theWkt.isEmpty() )
{
QgsDebugMsg( "theWkt is uninitialised, operation failed" )
QgsDebugMsg( "theWkt is uninitialised, operation failed" );
QgsLogger::critical( "QgsCoordinateReferenceSystem::createFromWkt -- theWkt is uninitialised, operation failed" );
return mIsValidFlag;
}
@@ -121,7 +121,7 @@ bool QgsDistanceArea::setEllipsoid( const QString& ellipsoid )
// row for this ellipsoid wasn't found?
if ( radius.isEmpty() || parameter2.isEmpty() )
{
QgsDebugMsg( QString( "setEllipsoid: no row in tbl_ellipsoid for acronym '" ) + ellipsoid.toLocal8Bit().data() + "'" )
QgsDebugMsg( QString( "setEllipsoid: no row in tbl_ellipsoid for acronym '" ) + ellipsoid.toLocal8Bit().data() + "'" );
return false;
}

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

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

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


// get spatial ref system for ellipsoid
@@ -35,13 +35,6 @@ email : morb at ozemail dot com dot au
return r; \
}

#define RELAY_GEOS() \
catch (GEOSException &e) \
{ \
Q_UNUSED(e); \
throw; \
}

class GEOSException
{
public:
@@ -4479,8 +4472,8 @@ bool QgsGeometry::convertToMultiType()

QGis::WKBTYPE geomType = wkbType();

if ( geomType == QGis::WKBMultiPoint || geomType == QGis::WKBMultiPoint25D || \
geomType == QGis::WKBMultiLineString || geomType == QGis::WKBMultiLineString25D || \
if ( geomType == QGis::WKBMultiPoint || geomType == QGis::WKBMultiPoint25D ||
geomType == QGis::WKBMultiLineString || geomType == QGis::WKBMultiLineString25D ||
geomType == QGis::WKBMultiPolygon || geomType == QGis::WKBMultiPolygon25D || geomType == QGis::WKBUnknown )
{
return false; //no need to convert
@@ -132,7 +132,7 @@ class CORE_EXPORT QgsGeometry
double distance( QgsGeometry& geom );

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

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

@@ -23,9 +23,9 @@
#include <QString>

#ifdef QGISDEBUG
#define QgsDebugMsg(str) QgsLogger::debug(QString(str), 1, __FILE__, __FUNCTION__, __LINE__);
#define QgsDebugMsg(str) QgsLogger::debug(QString(str), 1, __FILE__, __FUNCTION__, __LINE__)
#define QgsDebugMsgLevel(str, level) QgsLogger::debug(QString(str), level,\
__FILE__, __FUNCTION__, __LINE__);
__FILE__, __FUNCTION__, __LINE__)
#else
#define QgsDebugMsg(str)
#define QgsDebugMsgLevel(str, level)
@@ -100,7 +100,7 @@ class CORE_EXPORT QgsLogger
static void fatal( const QString& msg );

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

@@ -98,7 +98,7 @@ int QgsPoint::onSegment( const QgsPoint& a, const QgsPoint& b ) const
{
//algorithm from 'graphics GEMS', A. Paeth: 'A Fast 2D Point-on-line test'
if (
fabs(( b.y() - a.y() ) * ( m_x - a.x() ) - ( m_y - a.y() ) * ( b.x() - a.x() ) ) \
fabs(( b.y() - a.y() ) * ( m_x - a.x() ) - ( m_y - a.y() ) * ( b.x() - a.x() ) )
>= qMax( fabs( b.x() - a.x() ), fabs( b.y() - a.y() ) )
)
{
@@ -60,7 +60,7 @@ bool QgsProjectFileTransform::updateRevision( QgsProjectVersion newVersion )

void QgsProjectFileTransform::dump()
{
QgsDebugMsg( QString( "Current project file version is %1.%2.%3\n" )
QgsDebugMsg( QString( "Current project file version is %1.%2.%3" )
.arg( mCurrentVersion.majorVersion() )
.arg( mCurrentVersion.minorVersion() )
.arg( mCurrentVersion.subVersion() ) );
@@ -2150,14 +2150,14 @@ bool QgsVectorLayer::readXml( QDomNode & layer_node )
enableLabels( true );
}

QgsDebugMsg( "Testing if qgsvectorlayer can call label readXML routine" )
QgsDebugMsg( "Testing if qgsvectorlayer can call label readXML routine" );


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

if ( !labelattributesnode.isNull() )
{
QgsDebugMsg( "qgsvectorlayer calling label readXML routine" )
QgsDebugMsg( "qgsvectorlayer calling label readXML routine" );
mLabel->readXML( labelattributesnode );
}

0 comments on commit 1e4e5fa

Please sign in to comment.