Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server empty values in highlight labels parameters #60180

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions python/PyQt6/server/auto_generated/qgsserverparameters.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -70,42 +70,46 @@ Converts the parameter into a list of strings
:return: A list of strings
%End

QList<int> toIntList( bool &ok, char delimiter = ',' ) const;
QList<int> toIntList( bool &ok, char delimiter = ',', bool skipEmptyParts = true ) const;
%Docstring
Converts the parameter into a list of integers.

:param ok: ``True`` if there's no error during the conversion, ``False`` otherwise
:param delimiter: The character used for delimiting
:param skipEmptyParts: for splitting

:return: A list of integers
%End

QList<double> toDoubleList( bool &ok, char delimiter = ',' ) const;
QList<double> toDoubleList( bool &ok, char delimiter = ',', bool skipEmptyParts = true ) const;
%Docstring
Converts the parameter into a list of doubles.

:param ok: ``True`` if there's no error during the conversion, ``False`` otherwise
:param delimiter: The character used for delimiting
:param skipEmptyParts: for splitting

:return: A list of doubles
%End

QList<QColor> toColorList( bool &ok, char delimiter = ',' ) const;
QList<QColor> toColorList( bool &ok, char delimiter = ',', bool skipEmptyParts = true ) const;
%Docstring
Converts the parameter into a list of colors.

:param ok: ``True`` if there's no error during the conversion, ``False`` otherwise
:param delimiter: The character used for delimiting
:param skipEmptyParts: for splitting

:return: A list of colors
%End

QList<QgsGeometry> toGeomList( bool &ok, char delimiter = ',' ) const;
QList<QgsGeometry> toGeomList( bool &ok, char delimiter = ',', bool skipEmptyParts = true ) const;
%Docstring
Converts the parameter into a list of geometries.

:param ok: ``True`` if there's no error during the conversion, ``False`` otherwise
:param delimiter: The character used for delimiting
:param skipEmptyParts: for splitting

:return: A list of geometries
%End
Expand Down
12 changes: 8 additions & 4 deletions python/server/auto_generated/qgsserverparameters.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -70,42 +70,46 @@ Converts the parameter into a list of strings
:return: A list of strings
%End

QList<int> toIntList( bool &ok, char delimiter = ',' ) const;
QList<int> toIntList( bool &ok, char delimiter = ',', bool skipEmptyParts = true ) const;
%Docstring
Converts the parameter into a list of integers.

:param ok: ``True`` if there's no error during the conversion, ``False`` otherwise
:param delimiter: The character used for delimiting
:param skipEmptyParts: for splitting

:return: A list of integers
%End

QList<double> toDoubleList( bool &ok, char delimiter = ',' ) const;
QList<double> toDoubleList( bool &ok, char delimiter = ',', bool skipEmptyParts = true ) const;
%Docstring
Converts the parameter into a list of doubles.

:param ok: ``True`` if there's no error during the conversion, ``False`` otherwise
:param delimiter: The character used for delimiting
:param skipEmptyParts: for splitting

:return: A list of doubles
%End

QList<QColor> toColorList( bool &ok, char delimiter = ',' ) const;
QList<QColor> toColorList( bool &ok, char delimiter = ',', bool skipEmptyParts = true ) const;
%Docstring
Converts the parameter into a list of colors.

:param ok: ``True`` if there's no error during the conversion, ``False`` otherwise
:param delimiter: The character used for delimiting
:param skipEmptyParts: for splitting

:return: A list of colors
%End

QList<QgsGeometry> toGeomList( bool &ok, char delimiter = ',' ) const;
QList<QgsGeometry> toGeomList( bool &ok, char delimiter = ',', bool skipEmptyParts = true ) const;
%Docstring
Converts the parameter into a list of geometries.

:param ok: ``True`` if there's no error during the conversion, ``False`` otherwise
:param delimiter: The character used for delimiting
:param skipEmptyParts: for splitting

:return: A list of geometries
%End
Expand Down
16 changes: 8 additions & 8 deletions src/server/qgsserverparameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@ QStringList QgsServerParameterDefinition::toStringList( const char delimiter, co
}
}

QList<QgsGeometry> QgsServerParameterDefinition::toGeomList( bool &ok, const char delimiter ) const
QList<QgsGeometry> QgsServerParameterDefinition::toGeomList( bool &ok, const char delimiter, const bool skipEmptyParts ) const
{
ok = true;
QList<QgsGeometry> geoms;

const auto constStringList( toStringList( delimiter ) );
const auto constStringList( toStringList( delimiter, skipEmptyParts ) );
for ( const auto &wkt : constStringList )
{
const QgsGeometry g( QgsGeometry::fromWkt( wkt ) );
Expand Down Expand Up @@ -202,12 +202,12 @@ QStringList QgsServerParameterDefinition::toExpressionList() const
return filters;
}

QList<QColor> QgsServerParameterDefinition::toColorList( bool &ok, const char delimiter ) const
QList<QColor> QgsServerParameterDefinition::toColorList( bool &ok, const char delimiter, bool skipEmptyParts ) const
{
ok = true;
QList<QColor> colors;

const auto constStringList( toStringList( delimiter ) );
const auto constStringList( toStringList( delimiter, skipEmptyParts ) );
for ( const auto &part : constStringList )
{
QString cStr( part );
Expand All @@ -234,12 +234,12 @@ QList<QColor> QgsServerParameterDefinition::toColorList( bool &ok, const char de
return colors;
}

QList<int> QgsServerParameterDefinition::toIntList( bool &ok, const char delimiter ) const
QList<int> QgsServerParameterDefinition::toIntList( bool &ok, const char delimiter, bool skipEmptyParts ) const
{
ok = true;
QList<int> ints;

const auto constStringList( toStringList( delimiter ) );
const auto constStringList( toStringList( delimiter, skipEmptyParts ) );
for ( const auto &part : constStringList )
{
const int val = part.toInt( &ok );
Expand All @@ -255,12 +255,12 @@ QList<int> QgsServerParameterDefinition::toIntList( bool &ok, const char delimit
return ints;
}

QList<double> QgsServerParameterDefinition::toDoubleList( bool &ok, const char delimiter ) const
QList<double> QgsServerParameterDefinition::toDoubleList( bool &ok, const char delimiter, bool skipEmptyParts ) const
{
ok = true;
QList<double> vals;

const auto constStringList( toStringList( delimiter ) );
const auto constStringList( toStringList( delimiter, skipEmptyParts ) );
for ( const auto &part : constStringList )
{
const double val = part.toDouble( &ok );
Expand Down
12 changes: 8 additions & 4 deletions src/server/qgsserverparameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,33 +80,37 @@ class SERVER_EXPORT QgsServerParameterDefinition
* Converts the parameter into a list of integers.
* \param ok TRUE if there's no error during the conversion, FALSE otherwise
* \param delimiter The character used for delimiting
* \param skipEmptyParts for splitting
* \returns A list of integers
*/
QList<int> toIntList( bool &ok, char delimiter = ',' ) const;
QList<int> toIntList( bool &ok, char delimiter = ',', bool skipEmptyParts = true ) const;

/**
* Converts the parameter into a list of doubles.
* \param ok TRUE if there's no error during the conversion, FALSE otherwise
* \param delimiter The character used for delimiting
* \param skipEmptyParts for splitting
* \returns A list of doubles
*/
QList<double> toDoubleList( bool &ok, char delimiter = ',' ) const;
QList<double> toDoubleList( bool &ok, char delimiter = ',', bool skipEmptyParts = true ) const;

/**
* Converts the parameter into a list of colors.
* \param ok TRUE if there's no error during the conversion, FALSE otherwise
* \param delimiter The character used for delimiting
* \param skipEmptyParts for splitting
* \returns A list of colors
*/
QList<QColor> toColorList( bool &ok, char delimiter = ',' ) const;
QList<QColor> toColorList( bool &ok, char delimiter = ',', bool skipEmptyParts = true ) const;

/**
* Converts the parameter into a list of geometries.
* \param ok TRUE if there's no error during the conversion, FALSE otherwise
* \param delimiter The character used for delimiting
* \param skipEmptyParts for splitting
* \returns A list of geometries
*/
QList<QgsGeometry> toGeomList( bool &ok, char delimiter = ',' ) const;
QList<QgsGeometry> toGeomList( bool &ok, char delimiter = ',', bool skipEmptyParts = true ) const;

/**
* Converts the parameter into a list of OGC filters.
Expand Down
Loading
Loading