Skip to content

Commit

Permalink
indentation update
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Nov 19, 2015
1 parent 2fcdef4 commit c40a764
Show file tree
Hide file tree
Showing 21 changed files with 135 additions and 119 deletions.
Expand Up @@ -204,7 +204,7 @@ def __init__(self):
Catalog(), CloudMetrics(), CanopyMaxima(), CanopyModel(), ClipData(),
Csv2Grid(), Cover(), FilterData(), GridMetrics(), GroundFilter(),
GridSurfaceCreate(), MergeData(), TinSurfaceCreate(), PolyClipData(),
DTM2TIF(), FirstLastReturn(), ASCII2DTM()
DTM2TIF(), FirstLastReturn(), ASCII2DTM()
]
for alg in fusiontools:
alg.group = 'Fusion'
Expand Down
3 changes: 2 additions & 1 deletion src/core/qgsmaprenderer.h
Expand Up @@ -338,7 +338,8 @@ class CORE_EXPORT QgsMapRenderer : public QObject
/** Set a feature filter provider to filter the features
* @param ffp the feature filter provider
*/
void setFeatureFilterProvider( const QgsFeatureFilterProvider* ffp ) {
void setFeatureFilterProvider( const QgsFeatureFilterProvider* ffp )
{
mRenderContext.setFeatureFilterProvider( ffp );
}

Expand Down
16 changes: 9 additions & 7 deletions src/core/qgsrendercontext.cpp
Expand Up @@ -30,19 +30,20 @@ QgsRenderContext::QgsRenderContext()
, mScaleFactor( 1.0 )
, mRasterScaleFactor( 1.0 )
, mRendererScale( 1.0 )
, mLabelingEngine( NULL )
, mLabelingEngine( 0 )
, mLabelingEngine2( 0 )
, mGeometry( 0 )
, mFeatureFilterProvider( NULL )
, mFeatureFilterProvider( 0 )
{
mVectorSimplifyMethod.setSimplifyHints( QgsVectorSimplifyMethod::NoSimplification );
}

QgsRenderContext::~QgsRenderContext()
{
if ( mFeatureFilterProvider != NULL ) {
if ( mFeatureFilterProvider )
{
delete mFeatureFilterProvider;
mFeatureFilterProvider = NULL;
mFeatureFilterProvider = 0;
}
}

Expand Down Expand Up @@ -150,11 +151,12 @@ void QgsRenderContext::setUseRenderingOptimization( bool enabled )

void QgsRenderContext::setFeatureFilterProvider( const QgsFeatureFilterProvider* ffp )
{
if ( mFeatureFilterProvider != NULL ) {
if ( mFeatureFilterProvider )
{
delete mFeatureFilterProvider;
mFeatureFilterProvider = NULL;
mFeatureFilterProvider = 0;
}
if ( ffp != NULL )
if ( ffp )
{
mFeatureFilterProvider = ffp->clone();
}
Expand Down
3 changes: 2 additions & 1 deletion src/core/qgsvectordataprovider.h
Expand Up @@ -378,7 +378,8 @@ class CORE_EXPORT QgsVectorDataProvider : public QgsDataProvider
* This forces QGIS to reopen a file or connection.
* This can be required if the underlying file is replaced.
*/
virtual void forceReload() {
virtual void forceReload()
{
emit dataChanged();
}

Expand Down
10 changes: 5 additions & 5 deletions src/core/qgsvectorlayerrenderer.cpp
Expand Up @@ -154,21 +154,21 @@ bool QgsVectorLayerRenderer::render()
.setSubsetOfAttributes( mAttrNames, mFields );

const QgsFeatureFilterProvider* featureFilterProvider = mContext.featureFilterProvider();
if ( featureFilterProvider != NULL)
if ( featureFilterProvider )
{
featureFilterProvider->filterFeatures( mLayer, featureRequest );
}
if ( !rendererFilter.isNull() )
{
featureRequest.setExpressionContext( mContext.expressionContext() );
if ( featureRequest.filterExpression() == NULL )
if ( !featureRequest.filterExpression() )
{
featureRequest.setFilterExpression( rendererFilter );
}
else
{
featureRequest.setFilterExpression( QString( "(%s) AND (%s)" )
.arg( rendererFilter, featureRequest.filterExpression()->expression() ) );
.arg( rendererFilter, featureRequest.filterExpression()->expression() ) );
}
}

Expand Down Expand Up @@ -352,14 +352,14 @@ void QgsVectorLayerRenderer::drawRendererV2( QgsFeatureIterator& fit )
}
}

stopRendererV2( NULL );
stopRendererV2( 0 );
}

void QgsVectorLayerRenderer::drawRendererV2Levels( QgsFeatureIterator& fit )
{
QHash< QgsSymbolV2*, QList<QgsFeature> > features; // key = symbol, value = array of features

QgsSingleSymbolRendererV2* selRenderer = NULL;
QgsSingleSymbolRendererV2* selRenderer = 0;
if ( !mSelectedFeatureIds.isEmpty() )
{
selRenderer = new QgsSingleSymbolRendererV2( QgsSymbolV2::defaultSymbol( mGeometryType ) );
Expand Down
2 changes: 1 addition & 1 deletion src/core/symbology-ng/qgssymbollayerv2utils.cpp
Expand Up @@ -784,7 +784,7 @@ QList<QPolygonF> offsetLine( QPolygonF polyline, double dist, QGis::GeometryType
QgsPolyline line = tempGeometry->asPolyline();
// Reverse the line if offset was negative, see
// http://hub.qgis.org/issues/13811
if ( dist < 0 ) std::reverse(line.begin(), line.end() );
if ( dist < 0 ) std::reverse( line.begin(), line.end() );
resultLine.append( makeOffsetGeometry( line ) );
delete tempGeometry;
return resultLine;
Expand Down
29 changes: 17 additions & 12 deletions src/server/qgsaccesscontrol.cpp
Expand Up @@ -31,19 +31,21 @@ void QgsAccessControl::filterFeatures( const QgsVectorLayer* layer, QgsFeatureRe
for ( acIterator = mPluginsAccessControls->constBegin(); acIterator != mPluginsAccessControls->constEnd(); ++acIterator )
{
const QString expression = acIterator.value()->layerFilterExpression( layer );
if ( expression != NULL ) {
if ( expression )
{
expressions.append( expression );
}
}
if ( !expressions.isEmpty() ) {
featureRequest.setFilterExpression( expressions.join(" AND ") );
if ( !expressions.isEmpty() )
{
featureRequest.setFilterExpression( expressions.join( " AND " ) );
}
}

/** Clone the object */
QgsFeatureFilterProvider* QgsAccessControl::clone() const
{
return new QgsAccessControl(*this);
return new QgsAccessControl( *this );
}

/** Return an additional subset string (typically SQL) filter */
Expand All @@ -54,11 +56,12 @@ const QString QgsAccessControl::extraSubsetString( const QgsVectorLayer* layer )
for ( acIterator = mPluginsAccessControls->constBegin(); acIterator != mPluginsAccessControls->constEnd(); ++acIterator )
{
const QString sql = acIterator.value()->layerFilterSubsetString( layer );
if ( sql != NULL ) {
if ( sql )
{
sqls.append( sql );
}
}
return sqls.isEmpty() ? NULL : sqls.join(" AND ");
return sqls.isEmpty() ? QString::null : sqls.join( " AND " );
}

/** Return the layer read right */
Expand All @@ -67,7 +70,7 @@ bool QgsAccessControl::layerReadPermission( const QgsMapLayer* layer ) const
QgsAccessControlFilterMap::const_iterator acIterator;
for ( acIterator = mPluginsAccessControls->constBegin(); acIterator != mPluginsAccessControls->constEnd(); ++acIterator )
{
if ( !acIterator.value()->layerPermissions( layer ).canRead)
if ( !acIterator.value()->layerPermissions( layer ).canRead )
{
return false;
}
Expand All @@ -81,7 +84,7 @@ bool QgsAccessControl::layerInsertPermission( const QgsVectorLayer* layer ) cons
QgsAccessControlFilterMap::const_iterator acIterator;
for ( acIterator = mPluginsAccessControls->constBegin(); acIterator != mPluginsAccessControls->constEnd(); ++acIterator )
{
if ( !acIterator.value()->layerPermissions( layer ).canInsert)
if ( !acIterator.value()->layerPermissions( layer ).canInsert )
{
return false;
}
Expand All @@ -95,7 +98,7 @@ bool QgsAccessControl::layerUpdatePermission( const QgsVectorLayer* layer ) cons
QgsAccessControlFilterMap::const_iterator acIterator;
for ( acIterator = mPluginsAccessControls->constBegin(); acIterator != mPluginsAccessControls->constEnd(); ++acIterator )
{
if ( !acIterator.value()->layerPermissions( layer ).canUpdate)
if ( !acIterator.value()->layerPermissions( layer ).canUpdate )
{
return false;
}
Expand All @@ -109,7 +112,7 @@ bool QgsAccessControl::layerDeletePermission( const QgsVectorLayer* layer ) cons
QgsAccessControlFilterMap::const_iterator acIterator;
for ( acIterator = mPluginsAccessControls->constBegin(); acIterator != mPluginsAccessControls->constEnd(); ++acIterator )
{
if ( !acIterator.value()->layerPermissions( layer ).canDelete)
if ( !acIterator.value()->layerPermissions( layer ).canDelete )
{
return false;
}
Expand All @@ -125,7 +128,8 @@ const QStringList QgsAccessControl::layerAttributes( const QgsVectorLayer* layer
for ( acIterator = mPluginsAccessControls->constBegin(); acIterator != mPluginsAccessControls->constEnd(); ++acIterator )
{
const QStringList* newAttributes = acIterator.value()->authorizedLayerAttributes( layer, currentAttributes );
if (newAttributes != NULL) {
if ( newAttributes )
{
currentAttributes = *newAttributes;
}
}
Expand Down Expand Up @@ -153,7 +157,8 @@ bool QgsAccessControl::fillCacheKey( QStringList& cacheKey ) const
for ( acIterator = mPluginsAccessControls->constBegin(); acIterator != mPluginsAccessControls->constEnd(); ++acIterator )
{
QString newKey = acIterator.value()->cacheKey();
if ( newKey.length() == 0 ) {
if ( newKey.length() == 0 )
{
cacheKey.clear();
return false;
}
Expand Down
3 changes: 2 additions & 1 deletion src/server/qgsaccesscontrolfilter.h
Expand Up @@ -54,7 +54,8 @@ class SERVER_EXPORT QgsAccessControlFilter
virtual ~QgsAccessControlFilter();

/** Describe the layer permission */
struct LayerPermissions {
struct LayerPermissions
{
bool canRead;
bool canUpdate;
bool canInsert;
Expand Down
4 changes: 2 additions & 2 deletions src/server/qgsconfigcache.cpp
Expand Up @@ -142,9 +142,9 @@ QgsWMSConfigParser *QgsConfigCache::wmsConfiguration(
else
{
p = new QgsWMSProjectParser(
filePath
filePath
#ifdef HAVE_SERVER_PYTHON_PLUGINS
, accessControl
, accessControl
#endif
);
}
Expand Down
17 changes: 9 additions & 8 deletions src/server/qgshttprequesthandler.cpp
Expand Up @@ -36,7 +36,7 @@
QgsHttpRequestHandler::QgsHttpRequestHandler( const bool captureOutput /*= FALSE*/ )
: QgsRequestHandler( )
{
mException = NULL;
mException = 0;
mHeadersSent = FALSE;
mCaptureOutput = captureOutput;
}
Expand Down Expand Up @@ -69,7 +69,7 @@ bool QgsHttpRequestHandler::responseReady() const

bool QgsHttpRequestHandler::exceptionRaised() const
{
return mException != NULL;
return mException;
}

void QgsHttpRequestHandler::setDefaultHeaders()
Expand Down Expand Up @@ -641,14 +641,14 @@ void QgsHttpRequestHandler::requestStringToParameterMap( const QString& request,
QString QgsHttpRequestHandler::readPostBody() const
{
QgsMessageLog::logMessage( "QgsHttpRequestHandler::readPostBody" );
char* lengthString = NULL;
char* lengthString = 0;
int length = 0;
char* input = NULL;
char* input = 0;
QString inputString;
QString lengthQString;

lengthString = getenv( "CONTENT_LENGTH" );
if ( lengthString != NULL )
if ( lengthString )
{
bool conversionSuccess = false;
lengthQString = QString( lengthString );
Expand All @@ -663,7 +663,7 @@ QString QgsHttpRequestHandler::readPostBody() const
input[i] = getchar();
}
//fgets(input, length+1, stdin);
if ( input != NULL )
if ( input )
{
inputString = QString::fromLocal8Bit( input );
}
Expand All @@ -679,8 +679,9 @@ QString QgsHttpRequestHandler::readPostBody() const
}
}
// Used by the tests
else if ( getenv( "REQUEST_BODY" ) != NULL ) {
inputString = getenv( "REQUEST_BODY" );
else if ( getenv( "REQUEST_BODY" ) )
{
inputString = getenv( "REQUEST_BODY" );
}
return inputString;
}
Expand Down
2 changes: 1 addition & 1 deletion src/server/qgsowsserver.h
Expand Up @@ -40,7 +40,7 @@ class QgsOWSServer
#ifdef HAVE_SERVER_PYTHON_PLUGINS
, mAccessControl( ac )
#endif
{}
{}
virtual ~QgsOWSServer() {}

virtual void executeRequest() = 0;
Expand Down
3 changes: 2 additions & 1 deletion src/server/qgspostrequesthandler.cpp
Expand Up @@ -54,7 +54,8 @@ void QgsPostRequestHandler::parseInput()
if ( !doc.setContent( inputString, true, &errorMsg, &line, &column ) )
{
char* requestMethod = getenv( "REQUEST_METHOD" );
if ( requestMethod != NULL && strcmp( requestMethod, "POST" ) == 0 ) {
if ( requestMethod && strcmp( requestMethod, "POST" ) == 0 )
{
QgsMessageLog::logMessage( QString( "Error at line %1, column %2: %3." ).arg( line ).arg( column ).arg( errorMsg ) );
}
requestStringToParameterMap( inputString, mParameterMap );
Expand Down

0 comments on commit c40a764

Please sign in to comment.