File tree 4 files changed +9
-7
lines changed
python/server/auto_generated
4 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -43,9 +43,10 @@ Returns the type of the parameter as a string.
43
43
Returns true if the parameter is valid, false otherwise.
44
44
%End
45
45
46
- QString toString() const;
46
+ QString toString( bool defaultValue = false ) const;
47
47
%Docstring
48
- Converts the parameter into a string.
48
+ Converts the parameter into a string. If ``defaultValue`` is true
49
+ and current value is empty, then the default value is returned.
49
50
%End
50
51
51
52
QStringList toStringList( char delimiter = ',' ) const;
Original file line number Diff line number Diff line change @@ -62,11 +62,11 @@ QColor QgsServerParameterDefinition::toColor( bool &ok ) const
62
62
return color;
63
63
}
64
64
65
- QString QgsServerParameterDefinition::toString () const
65
+ QString QgsServerParameterDefinition::toString ( const bool defaultValue ) const
66
66
{
67
67
QString value = mValue .toString ();
68
68
69
- if ( value.isEmpty () )
69
+ if ( value.isEmpty () && defaultValue )
70
70
value = mDefaultValue .toString ();
71
71
72
72
return value;
Original file line number Diff line number Diff line change @@ -59,9 +59,10 @@ class SERVER_EXPORT QgsServerParameterDefinition
59
59
virtual bool isValid () const ;
60
60
61
61
/* *
62
- * Converts the parameter into a string.
62
+ * Converts the parameter into a string. If \a defaultValue is true
63
+ * and current value is empty, then the default value is returned.
63
64
*/
64
- QString toString () const ;
65
+ QString toString ( bool defaultValue = false ) const ;
65
66
66
67
/* *
67
68
* Converts the parameter into a list of strings.
Original file line number Diff line number Diff line change @@ -715,7 +715,7 @@ namespace QgsWms
715
715
716
716
QString QgsWmsParameters::formatAsString () const
717
717
{
718
- return mWmsParameters [ QgsWmsParameter::FORMAT ].toString ();
718
+ return mWmsParameters [ QgsWmsParameter::FORMAT ].toString ( true );
719
719
}
720
720
721
721
QString QgsWmsParameters::formatAsString ( const QgsWmsParameters::Format format )
You can’t perform that action at this time.
0 commit comments