Skip to content

Commit

Permalink
fix build error and update sips
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Jun 14, 2014
1 parent 5d70839 commit 03475be
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 6 deletions.
2 changes: 2 additions & 0 deletions python/core/qgsexpression.sip
Expand Up @@ -66,6 +66,8 @@ class QgsExpression
//! @note added in 2.2
static bool hasSpecialColumn( const QString& name );

static bool isValid( const QString& text, const QgsFields& fields, QString &errorMessage );

void setScale( double scale );

double scale();
Expand Down
15 changes: 15 additions & 0 deletions python/gui/qgsfieldexpressionwidget.sip
Expand Up @@ -20,6 +20,8 @@ class QgsFieldExpressionWidget : QWidget
//! setFilters allows fitering according to the type of field
void setFilters( QgsFieldProxyModel::Filters filters );

void setLeftHandButtonStyle( bool isLeft );

//! currently used filter on list of fields
QgsFieldProxyModel::Filters filters();

Expand All @@ -33,6 +35,17 @@ class QgsFieldExpressionWidget : QWidget
*/
QString currentField( bool *isExpression = 0, bool *isValid = 0 );

/**
* Return true if the current expression is valid
*/
bool isValidExpression( QString *expressionError = 0 );

bool isExpression();
/**
* Return the current text that is set in the expression area
*/
QString currentText();

//! Returns the currently used layer
QgsVectorLayer* layer();

Expand All @@ -43,6 +56,8 @@ class QgsFieldExpressionWidget : QWidget
//! fieldChanged signal with indication of the validity of the expression
void fieldChanged( QString fieldName, bool isValid );

void returnPressed();

public slots:
//! set the layer used to display the fields and expression
void setLayer( QgsVectorLayer* layer );
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsexpression.cpp
Expand Up @@ -1729,7 +1729,7 @@ bool QgsExpression::hasSpecialColumn( const QString& name )
return gmSpecialColumns.contains( name );
}

bool QgsExpression::isValid( const QString &text, const QgsFields &fields, QString errorMessage )
bool QgsExpression::isValid( const QString &text, const QgsFields &fields, QString &errorMessage )
{
QgsExpression exp( text );
exp.prepare( fields );
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsexpression.h
Expand Up @@ -152,7 +152,7 @@ class CORE_EXPORT QgsExpression
//! @note added in 2.2
static bool hasSpecialColumn( const QString& name );

static bool isValid( const QString& text, const QgsFields& fields, QString errorMessage );
static bool isValid( const QString& text, const QgsFields& fields, QString &errorMessage );

void setScale( double scale ) { mScale = scale; }

Expand Down
5 changes: 3 additions & 2 deletions src/gui/qgsfieldexpressionwidget.cpp
Expand Up @@ -87,9 +87,10 @@ QString QgsFieldExpressionWidget::currentText()
return mCombo->currentText();
}

bool QgsFieldExpressionWidget::isValidExpression( QString& expressionError )
bool QgsFieldExpressionWidget::isValidExpression( QString *expressionError )
{
return QgsExpression::isValid( currentText(), layer()->pendingFields(), expressionError );
QString temp;
return QgsExpression::isValid( currentText(), layer()->pendingFields(), expressionError ? *expressionError : temp );
}

bool QgsFieldExpressionWidget::isExpression()
Expand Down
4 changes: 2 additions & 2 deletions src/gui/qgsfieldexpressionwidget.h
Expand Up @@ -77,11 +77,11 @@ class GUI_EXPORT QgsFieldExpressionWidget : public QWidget
/**
* Return true if the current expression is valid
*/
bool isValidExpression( QString& expressionError = QString() );
bool isValidExpression( QString *expressionError = 0 );

bool isExpression();
/**
* Retun the current text that is set in the expression area
* Return the current text that is set in the expression area
*/
QString currentText();

Expand Down

0 comments on commit 03475be

Please sign in to comment.