Skip to content
Permalink
Browse files

Standardise capitalisation in some QgsExpression methods

  • Loading branch information
nyalldawson committed Aug 10, 2016
1 parent a0360a6 commit cd5f81311288ab8616961718419c6a924aa0ae57
@@ -329,9 +329,12 @@ removed. Use QgsExpressionContext variables instead.</li>
<li>The replaceExpressionText version which accepts a QgsFeature argument has been removed. Use the QgsExpressionContext
version instead.</li>
<li>QgsExpression::Function::func has been modified to use a QgsExpressionContext argument rather than a QgsFeature.</li>
<li>QgsExpression::Function::usesgeometry() has been renamed to usesGeometry()</li>
<li>QgsExpression::Function::helptext() has been renamed to helpText()</li>
<li>The QgsExpression::Node::eval and prepare versions which take a QgsFeature has been removed, use the QgsExpressionContext versions instead.</li>
<li>QgsExpression::Interval has been removed. Use QgsInterval instead.</li>
<li>replaceExpressionText() no longer accepts a substitution map parameter. Use expression context variables instead.</li>
<li>helptext() has been renamed to helpText()</li>
</ul>

\subsection qgis_api_break_3_0_QgsFeature QgsFeature
@@ -305,7 +305,7 @@ class QgsExpression
const QgsExpression::ParameterList& parameters() const;

/** Does this function use a geometry object. */
bool usesgeometry() const;
bool usesGeometry() const;

/** Returns a list of possible aliases for the function. These include
* other permissible names for the function, eg deprecated names.
@@ -330,7 +330,7 @@ class QgsExpression
/** The group the function belongs to. */
QString group() const;
/** The help text for the function. */
const QString helptext() const;
const QString helpText() const;

/** Returns result of evaluating the function.
* @param values list of values passed to the function
@@ -764,13 +764,13 @@ class QgsExpression
* @param name function name
* @see variableHelpText()
*/
static QString helptext( QString name );
static QString helpText( QString name );

/** Returns the help text for a specified variable.
* @param variableName name of variable
* @param showValue set to true to include current value of variable in help text
* @param value current value of variable to show in help text
* @see helptext()
* @see helpText()
* @note added in QGIS 2.12
*/
static QString variableHelpText( const QString& variableName, bool showValue = true, const QVariant& value = QVariant() );
@@ -4566,7 +4566,7 @@ QgsExpression::Node* QgsExpression::NodeCondition::clone() const
}


QString QgsExpression::helptext( QString name )
QString QgsExpression::helpText( QString name )
{
QgsExpression::initFunctionHelp();

@@ -477,8 +477,7 @@ class CORE_EXPORT QgsExpression
const ParameterList& parameters() const { return mParameterList; }

/** Does this function use a geometry object. */
//TODO QGIS 3.0 - rename to usesGeometry()
bool usesgeometry() const { return mUsesGeometry; }
bool usesGeometry() const { return mUsesGeometry; }

/** Returns a list of possible aliases for the function. These include
* other permissible names for the function, eg deprecated names.
@@ -501,9 +500,9 @@ class CORE_EXPORT QgsExpression

/** The group the function belongs to. */
QString group() const { return mGroup; }

/** The help text for the function. */
//TODO QGIS 3.0 - rename to helpText()
const QString helptext() const { return mHelpText.isEmpty() ? QgsExpression::helptext( mName ) : mHelpText; }
const QString helpText() const { return mHelpText.isEmpty() ? QgsExpression::helpText( mName ) : mHelpText; }

/** Returns result of evaluating the function.
* @param values list of values passed to the function
@@ -998,7 +997,7 @@ class CORE_EXPORT QgsExpression
virtual QString dump() const override;

virtual QStringList referencedColumns() const override;
virtual bool needsGeometry() const override { bool needs = Functions()[mFnIndex]->usesgeometry(); if ( mArgs ) { Q_FOREACH ( Node* n, mArgs->list() ) needs |= n->needsGeometry(); } return needs; }
virtual bool needsGeometry() const override { bool needs = Functions()[mFnIndex]->usesGeometry(); if ( mArgs ) { Q_FOREACH ( Node* n, mArgs->list() ) needs |= n->needsGeometry(); } return needs; }
virtual void accept( Visitor& v ) const override { v.visit( *this ); }
virtual Node* clone() const override;

@@ -1213,13 +1212,13 @@ class CORE_EXPORT QgsExpression
* @param name function name
* @see variableHelpText()
*/
static QString helptext( QString name );
static QString helpText( QString name );

/** Returns the help text for a specified variable.
* @param variableName name of variable
* @param showValue set to true to include current value of variable in help text
* @param value current value of variable to show in help text
* @see helptext()
* @see helpText()
* @note added in QGIS 2.12
*/
static QString variableHelpText( const QString& variableName, bool showValue = true, const QVariant& value = QVariant() );
@@ -491,7 +491,7 @@ void QgsExpressionBuilderWidget::updateFunctionTree()
name += '(';
else if ( !name.startsWith( '$' ) )
name += "()";
registerItem( func->group(), func->name(), ' ' + name + ' ', func->helptext() );
registerItem( func->group(), func->name(), ' ' + name + ' ', func->helpText() );
}

loadExpressionContext();
@@ -614,7 +614,7 @@ void QgsExpressionBuilderWidget::loadExpressionContext()
continue;
if ( func->params() != 0 )
name += '(';
registerItem( func->group(), func->name(), ' ' + name + ' ', func->helptext() );
registerItem( func->group(), func->name(), ' ' + name + ' ', func->helpText() );
}
}

@@ -780,9 +780,9 @@ QString QgsExpressionBuilderWidget::loadFunctionHelp( QgsExpressionItem* express
QString name = expressionItem->data( Qt::UserRole ).toString();

if ( expressionItem->getItemType() == QgsExpressionItem::Field )
helpContents = QgsExpression::helptext( "Field" );
helpContents = QgsExpression::helpText( "Field" );
else
helpContents = QgsExpression::helptext( name );
helpContents = QgsExpression::helpText( name );
}

return "<head><style>" + helpStylesheet() + "</style></head><body>" + helpContents + "</body>";
@@ -848,7 +848,7 @@ void registerQgisFunctions( sqlite3* db )
// register QGIS expression functions
Q_FOREACH ( QgsExpression::Function* foo, QgsExpression::Functions() )
{
if ( foo->usesgeometry() || foo->lazyEval() )
if ( foo->usesGeometry() || foo->lazyEval() )
{
// there is no "current" feature here, so calling functions that access "the" geometry does not make sense
// also, we can't pass Node values for lazy evaluations

0 comments on commit cd5f813

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