Skip to content
Permalink
Browse files

indentation update

  • Loading branch information
jef-n committed Nov 19, 2015
1 parent 2fcdef4 commit c40a764f5ce5f2d5fc09ad3ead175b6d0b752e5d
@@ -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'
@@ -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 );
}

@@ -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;
}
}

@@ -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();
}
@@ -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();
}

@@ -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() ) );
}
}

@@ -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 ) );
@@ -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;
@@ -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 */
@@ -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 */
@@ -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;
}
@@ -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;
}
@@ -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;
}
@@ -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;
}
@@ -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;
}
}
@@ -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;
}
@@ -54,7 +54,8 @@ class SERVER_EXPORT QgsAccessControlFilter
virtual ~QgsAccessControlFilter();

/** Describe the layer permission */
struct LayerPermissions {
struct LayerPermissions
{
bool canRead;
bool canUpdate;
bool canInsert;
@@ -142,9 +142,9 @@ QgsWMSConfigParser *QgsConfigCache::wmsConfiguration(
else
{
p = new QgsWMSProjectParser(
filePath
filePath
#ifdef HAVE_SERVER_PYTHON_PLUGINS
, accessControl
, accessControl
#endif
);
}
@@ -36,7 +36,7 @@
QgsHttpRequestHandler::QgsHttpRequestHandler( const bool captureOutput /*= FALSE*/ )
: QgsRequestHandler( )
{
mException = NULL;
mException = 0;
mHeadersSent = FALSE;
mCaptureOutput = captureOutput;
}
@@ -69,7 +69,7 @@ bool QgsHttpRequestHandler::responseReady() const

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

void QgsHttpRequestHandler::setDefaultHeaders()
@@ -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 );
@@ -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 );
}
@@ -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;
}
@@ -40,7 +40,7 @@ class QgsOWSServer
#ifdef HAVE_SERVER_PYTHON_PLUGINS
, mAccessControl( ac )
#endif
{}
{}
virtual ~QgsOWSServer() {}

virtual void executeRequest() = 0;
@@ -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 );

0 comments on commit c40a764

Please sign in to comment.
You can’t perform that action at this time.