Skip to content

Commit

Permalink
[Expression] redirect duplicate QString expression() to QString dump()
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Oct 31, 2013
1 parent 5cd7566 commit ad27dfe
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 9 deletions.
5 changes: 2 additions & 3 deletions src/core/qgsexpression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1616,12 +1616,11 @@ int QgsExpression::functionCount()


QgsExpression::QgsExpression( const QString& expr )
: mExpression( expr )
, mRowNumber( 0 )
: mRowNumber( 0 )
, mScale( 0 )
, mCalc( 0 )
{
mRootNode = ::parseExpression( mExpression, mParserErrorString );
mRootNode = ::parseExpression( expr, mParserErrorString );

if ( mParserErrorString.isNull() )
Q_ASSERT( mRootNode );
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsexpression.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ class CORE_EXPORT QgsExpression

int scale() {return mScale; }

const QString& expression() const { return mExpression; }
//! Alias for {@link dump()}
const QString expression() const { return dump(); }

//! Return the parsed expression as a string - useful for debugging
QString dump() const;
Expand Down Expand Up @@ -600,7 +601,6 @@ class CORE_EXPORT QgsExpression

void initGeomCalculator();

QString mExpression;
Node* mRootNode;

QString mParserErrorString;
Expand Down
2 changes: 1 addition & 1 deletion src/gui/attributetable/qgsfeaturelistmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ QString QgsFeatureListModel::parserErrorString()
return mParserErrorString;
}

const QString& QgsFeatureListModel::displayExpression() const
const QString QgsFeatureListModel::displayExpression() const
{
return mExpression->expression();
}
Expand Down
2 changes: 1 addition & 1 deletion src/gui/attributetable/qgsfeaturelistmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class GUI_EXPORT QgsFeatureListModel : public QAbstractProxyModel, public QgsFea
*/
QString parserErrorString();

const QString& displayExpression() const;
const QString displayExpression() const;
bool featureByIndex( const QModelIndex& index, QgsFeature& feat );
QgsFeatureId idxToFid( const QModelIndex& index ) const;
QModelIndex fidToIdx( const QgsFeatureId fid ) const;
Expand Down
2 changes: 1 addition & 1 deletion src/gui/attributetable/qgsfeaturelistview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ bool QgsFeatureListView::setDisplayExpression( const QString expression )
}
}

const QString& QgsFeatureListView::displayExpression() const
const QString QgsFeatureListView::displayExpression() const
{
return mModel->displayExpression();
}
Expand Down
2 changes: 1 addition & 1 deletion src/gui/attributetable/qgsfeaturelistview.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class GUI_EXPORT QgsFeatureListView : public QListView
*
* @see QgsExpression
*/
const QString& displayExpression() const;
const QString displayExpression() const;

/**
* Returns a detailed message about errors while parsing a QgsExpression.
Expand Down

0 comments on commit ad27dfe

Please sign in to comment.