mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
Fixes unit tests
This commit is contained in:
parent
58c38f2fb2
commit
0a76d7c108
@ -43,9 +43,10 @@ Returns the type of the parameter as a string.
|
||||
Returns true if the parameter is valid, false otherwise.
|
||||
%End
|
||||
|
||||
QString toString() const;
|
||||
QString toString( bool defaultValue = false ) const;
|
||||
%Docstring
|
||||
Converts the parameter into a string.
|
||||
Converts the parameter into a string. If ``defaultValue`` is true
|
||||
and current value is empty, then the default value is returned.
|
||||
%End
|
||||
|
||||
QStringList toStringList( char delimiter = ',' ) const;
|
||||
|
@ -62,11 +62,11 @@ QColor QgsServerParameterDefinition::toColor( bool &ok ) const
|
||||
return color;
|
||||
}
|
||||
|
||||
QString QgsServerParameterDefinition::toString() const
|
||||
QString QgsServerParameterDefinition::toString( const bool defaultValue ) const
|
||||
{
|
||||
QString value = mValue.toString();
|
||||
|
||||
if ( value.isEmpty() )
|
||||
if ( value.isEmpty() && defaultValue )
|
||||
value = mDefaultValue.toString();
|
||||
|
||||
return value;
|
||||
|
@ -59,9 +59,10 @@ class SERVER_EXPORT QgsServerParameterDefinition
|
||||
virtual bool isValid() const;
|
||||
|
||||
/**
|
||||
* Converts the parameter into a string.
|
||||
* Converts the parameter into a string. If \a defaultValue is true
|
||||
* and current value is empty, then the default value is returned.
|
||||
*/
|
||||
QString toString() const;
|
||||
QString toString( bool defaultValue = false ) const;
|
||||
|
||||
/**
|
||||
* Converts the parameter into a list of strings.
|
||||
|
@ -715,7 +715,7 @@ namespace QgsWms
|
||||
|
||||
QString QgsWmsParameters::formatAsString() const
|
||||
{
|
||||
return mWmsParameters[ QgsWmsParameter::FORMAT ].toString();
|
||||
return mWmsParameters[ QgsWmsParameter::FORMAT ].toString( true );
|
||||
}
|
||||
|
||||
QString QgsWmsParameters::formatAsString( const QgsWmsParameters::Format format )
|
||||
|
Loading…
x
Reference in New Issue
Block a user