Skip to content
Permalink
Browse files

Make expression compilation optional, but enabled by default

Remove the previous postgres specific option and replace with an
enabled-by-default option which applies to all expression
compilation.
  • Loading branch information
nyalldawson committed Nov 18, 2015
1 parent 982490f commit 91571736a87579993299c5e175df8c93d2b1fcbe
@@ -575,7 +575,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl ) :
cbxSnappingOptionsDocked->setChecked( settings.value( "/qgis/dockSnapping", false ).toBool() );
cbxAddPostgisDC->setChecked( settings.value( "/qgis/addPostgisDC", false ).toBool() );
cbxAddOracleDC->setChecked( settings.value( "/qgis/addOracleDC", false ).toBool() );
cbxCompileExpressions->setChecked( settings.value( "/qgis/postgres/compileExpressions", false ).toBool() );
cbxCompileExpressions->setChecked( settings.value( "/qgis/compileExpressions", true ).toBool() );
cbxCreateRasterLegendIcons->setChecked( settings.value( "/qgis/createRasterLegendIcons", false ).toBool() );
cbxCopyWKTGeomFromTable->setChecked( settings.value( "/qgis/copyGeometryAsWKT", true ).toBool() );
leNullValue->setText( settings.value( "qgis/nullValue", "NULL" ).toString() );
@@ -1102,7 +1102,7 @@ void QgsOptions::saveOptions()
settings.setValue( "/qgis/dockSnapping", cbxSnappingOptionsDocked->isChecked() );
settings.setValue( "/qgis/addPostgisDC", cbxAddPostgisDC->isChecked() );
settings.setValue( "/qgis/addOracleDC", cbxAddOracleDC->isChecked() );
settings.setValue( "/qgis/postgres/compileExpressions", cbxCompileExpressions->isChecked() );
settings.setValue( "/qgis/compileExpressions", cbxCompileExpressions->isChecked() );
settings.setValue( "/qgis/defaultLegendGraphicResolution", mLegendGraphicResolutionSpinBox->value() );
bool createRasterLegendIcons = settings.value( "/qgis/createRasterLegendIcons", false ).toBool();
settings.setValue( "/qgis/createRasterLegendIcons", cbxCreateRasterLegendIcons->isChecked() );
@@ -84,7 +84,8 @@ QgsOgrFeatureIterator::QgsOgrFeatureIterator( QgsOgrFeatureSource* source, bool
OGR_L_SetSpatialFilter( ogrLayer, 0 );
}

if ( request.filterType() == QgsFeatureRequest::FilterExpression )
if ( request.filterType() == QgsFeatureRequest::FilterExpression
&& QSettings().value( "/qgis/compileExpressions", true ).toBool() )
{
QgsOgrExpressionCompiler compiler = QgsOgrExpressionCompiler( source );

@@ -2577,7 +2577,8 @@ QString QgsOgrUtils::quotedValue( const QVariant& value )
return value.toString();

case QVariant::Bool:
return value.toBool() ? "TRUE" : "FALSE";
//OGR does not support boolean literals
return value.toBool() ? "1" : "0";

default:
case QVariant::String:
@@ -77,7 +77,7 @@ QgsPostgresFeatureIterator::QgsPostgresFeatureIterator( QgsPostgresFeatureSource
whereClause = QgsPostgresUtils::andWhereClauses( whereClause, fidsWhereClause );
}
else if ( request.filterType() == QgsFeatureRequest::FilterExpression
&& QSettings().value( "/qgis/postgres/compileExpressions", false ).toBool() )
&& QSettings().value( "/qgis/compileExpressions", true ).toBool() )
{
QgsPostgresExpressionCompiler compiler = QgsPostgresExpressionCompiler( source );

@@ -21,8 +21,7 @@

#include "qgslogger.h"
#include "qgsmessagelog.h"


#include <QSettings>

QgsSpatiaLiteFeatureIterator::QgsSpatiaLiteFeatureIterator( QgsSpatiaLiteFeatureSource* source, bool ownSource, const QgsFeatureRequest& request )
: QgsAbstractFeatureIteratorFromSource<QgsSpatiaLiteFeatureSource>( source, ownSource, request )
@@ -64,7 +63,8 @@ QgsSpatiaLiteFeatureIterator::QgsSpatiaLiteFeatureIterator( QgsSpatiaLiteFeature
whereClauses.append( whereClause );
}
}
else if ( request.filterType() == QgsFeatureRequest::FilterExpression )
else if ( request.filterType() == QgsFeatureRequest::FilterExpression
&& QSettings().value( "/qgis/compileExpressions", true ).toBool() )
{
QgsSpatiaLiteExpressionCompiler compiler = QgsSpatiaLiteExpressionCompiler( source );

0 comments on commit 9157173

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