Skip to content

Instantly share code, notes, and snippets.

@NathanW2
Created June 30, 2012 10:11
Show Gist options
  • Save NathanW2/3023278 to your computer and use it in GitHub Desktop.
Save NathanW2/3023278 to your computer and use it in GitHub Desktop.
days
if ( match.contains( "day", Qt::CaseInsensitive ) ||
match.contains( QObject::tr("day", "Note: Word is part matched in code"), Qt::CaseInsensitive )||
match.contains( QObject::tr("days", "Note: Word is part matched in code"), Qt::CaseInsensitive) )
seconds += value * QgsExpression::Interval::DAY;
if ( match.contains( "week", Qt::CaseInsensitive ) ||
match.contains( QObject::tr("week", "Note: Word is part matched in code"), Qt::CaseInsensitive ) ||
match.contains( QObject::tr("weeks", "Note: Word is part matched in code"), Qt::CaseInsensitive ) )
seconds += value * QgsExpression::Interval::WEEKS;
if ( match.contains( "month", Qt::CaseInsensitive ) ||
match.contains( QObject::tr("month", "Note: Word is part matched in code"), Qt::CaseInsensitive ) ||
match.contains( QObject::tr("month", "Note: Word is part matched in code"), Qt::CaseInsensitive ) )
seconds += value * QgsExpression::Interval::MONTHS;
if ( match.contains( "year", Qt::CaseInsensitive ) ||
match.contains( QObject::tr("year", "Note: Word is part matched in code"), Qt::CaseInsensitive ) ||
match.contains( QObject::tr("year", "Note: Word is part matched in code"), Qt::CaseInsensitive ) )
seconds += value * QgsExpression::Interval::YEARS;
if ( match.contains( "second", Qt::CaseInsensitive ) ||
match.contains( QObject::tr("second", "Note: Word is part matched in code"), Qt::CaseInsensitive ) ||
match.contains( QObject::tr("seconds", "Note: Word is part matched in code"), Qt::CaseInsensitive ) )
seconds += value;
if ( match.contains( "minute", Qt::CaseInsensitive ) ||
match.contains( QObject::tr("minute", "Note: Word is part matched in code"), Qt::CaseInsensitive ) ||
match.contains( QObject::tr("minute", "Note: Word is part matched in code"), Qt::CaseInsensitive ) )
seconds += value * QgsExpression::Interval::MINUTE;
if ( match.contains( "hour", Qt::CaseInsensitive ) ||
match.contains( QObject::tr("hour", "Note: Word is part matched in code"), Qt::CaseInsensitive ) ||
match.contains( QObject::tr("hour", "Note: Word is part matched in code"), Qt::CaseInsensitive ) )
seconds += value * QgsExpression::Interval::HOUR;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment