Skip to content
Permalink
Browse files

Changed QgsInterval getters to return original duration when original…

… unit matches the requested unit.
  • Loading branch information
Samweli authored and nyalldawson committed Jan 6, 2021
1 parent 1e7ea79 commit 167940fcbc3ecbedfc8f29fe4643ffc049082580
Showing with 0 additions and 57 deletions.
  1. +0 −57 src/core/qgsinterval.cpp
@@ -207,63 +207,6 @@ void QgsInterval::setSeconds( double seconds )
mOriginalUnit = QgsUnitTypes::TemporalSeconds;
}

void QgsInterval::setYears( double years )
{
mSeconds = years * YEARS;
mValid = true;
mOriginalDuration = years;
mOriginalUnit = QgsUnitTypes::TemporalYears;
}

void QgsInterval::setMonths( double months )
{
mSeconds = months * MONTHS;
mValid = true;
mOriginalDuration = months;
mOriginalUnit = QgsUnitTypes::TemporalMonths;
}

void QgsInterval::setWeeks( double weeks )
{
mSeconds = weeks * WEEKS;
mValid = true;
mOriginalDuration = weeks;
mOriginalUnit = QgsUnitTypes::TemporalWeeks;
}

void QgsInterval::setDays( double days )
{
mSeconds = days * DAY;
mValid = true;
mOriginalDuration = days;
mOriginalUnit = QgsUnitTypes::TemporalDays;
}

void QgsInterval::setHours( double hours )
{
mSeconds = hours * HOUR;
mValid = true;
mOriginalDuration = hours;
mOriginalUnit = QgsUnitTypes::TemporalHours;
}


void QgsInterval::setMinutes( double minutes )
{
mSeconds = minutes * MINUTE;
mValid = true;
mOriginalDuration = minutes;
mOriginalUnit = QgsUnitTypes::TemporalMinutes;
}

void QgsInterval::setSeconds( double seconds )
{
mSeconds = seconds;
mValid = true;
mOriginalDuration = seconds;
mOriginalUnit = QgsUnitTypes::TemporalSeconds;
}

bool QgsInterval::operator==( QgsInterval other ) const
{
if ( !mValid && !other.mValid )

0 comments on commit 167940f

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