Skip to content

Commit

Permalink
Sipify and indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
rduivenvoorde authored and nyalldawson committed Sep 8, 2021
1 parent 47bf9e3 commit 9b1894c
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 5 deletions.
Expand Up @@ -74,6 +74,12 @@ The ``enabled`` argument specifies whether the temporal properties are initially
ModeRedrawLayerOnly,
};

enum LimitMode
{
ModeIncludeBeginExcludeEnd,
ModeIncludeBeginIncludeEnd,
};

TemporalMode mode() const;
%Docstring
Returns the temporal properties mode.
Expand All @@ -86,6 +92,20 @@ Returns the temporal properties mode.
Sets the temporal properties ``mode``.

.. seealso:: :py:func:`mode`
%End

LimitMode limitMode() const;
%Docstring
Returns the temporal limit mode (to include or exclude begin/end limits).

.. seealso:: :py:func:`setLimitMode`
%End

void setLimitMode( LimitMode mode );
%Docstring
Sets the temporal ``limit`` mode (to include or exclude begin/end limits).

.. seealso:: :py:func:`limitMode`
%End

virtual QgsTemporalProperty::Flags flags() const;
Expand Down
4 changes: 2 additions & 2 deletions src/core/vector/qgsvectorlayertemporalproperties.cpp
Expand Up @@ -450,11 +450,11 @@ QString QgsVectorLayerTemporalProperties::createFilterString( QgsVectorLayerTemp
QgsDateTimeRange filter;
if ( limitMode() == QgsVectorLayerTemporalProperties::ModeIncludeBeginIncludeEnd )
{
filter = QgsDateTimeRange(filterRange.begin(), filterRange.end(), true, true);
filter = QgsDateTimeRange( filterRange.begin(), filterRange.end(), true, true );
}
else
{
filter = QgsDateTimeRange(filterRange.begin(), filterRange.end(), true, false); // default is include begin, exclude end of filter
filter = QgsDateTimeRange( filterRange.begin(), filterRange.end(), true, false ); // default is include begin, exclude end of filter
}

switch ( mMode )
Expand Down
4 changes: 2 additions & 2 deletions src/core/vector/qgsvectorlayertemporalproperties.h
Expand Up @@ -101,8 +101,8 @@ class CORE_EXPORT QgsVectorLayerTemporalProperties : public QgsMapLayerTemporalP
*/
enum LimitMode
{
ModeIncludeBeginExcludeEnd = 0, //!< Default mode: include the Begin limit, but exclude the End limit
ModeIncludeBeginIncludeEnd, //!< Mode to include both limits of the filtering timeframe
ModeIncludeBeginExcludeEnd = 0, //!< Default mode: include the Begin limit, but exclude the End limit
ModeIncludeBeginIncludeEnd, //!< Mode to include both limits of the filtering timeframe
};

/**
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsvectorlayertemporalpropertieswidget.cpp
Expand Up @@ -107,7 +107,7 @@ void QgsVectorLayerTemporalPropertiesWidget::saveTemporalProperties()

properties->setIsActive( mTemporalGroupBox->isChecked() );
properties->setMode( static_cast< QgsVectorLayerTemporalProperties::TemporalMode >( mModeComboBox->currentData().toInt() ) );
properties->setLimitMode(static_cast< QgsVectorLayerTemporalProperties::LimitMode >( mLimitsComboBox->currentData().toInt() ));
properties->setLimitMode( static_cast< QgsVectorLayerTemporalProperties::LimitMode >( mLimitsComboBox->currentData().toInt() ) );

const QgsDateTimeRange normalRange = QgsDateTimeRange( mStartTemporalDateTimeEdit->dateTime(),
mEndTemporalDateTimeEdit->dateTime() );
Expand Down

0 comments on commit 9b1894c

Please sign in to comment.