本文整理汇总了C++中incidence::Ptr::recurs方法的典型用法代码示例。如果您正苦于以下问题:C++ Ptr::recurs方法的具体用法?C++ Ptr::recurs怎么用?C++ Ptr::recurs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类incidence::Ptr
的用法示例。
在下文中一共展示了Ptr::recurs方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: triggerDateForIncidence
/** static */
KDateTime AlarmDialog::triggerDateForIncidence( const Incidence::Ptr &incidence,
const QDateTime &reminderAt,
QString &displayStr )
{
KDateTime result;
if ( incidence->alarms().isEmpty() ) {
return result;
}
Alarm::Ptr alarm = incidence->alarms().first();
if ( incidence->recurs() ) {
result = incidence->recurrence()->getNextDateTime(
KDateTime( reminderAt, KDateTime::Spec::LocalZone( ) ) );
displayStr = KGlobal::locale()->formatDateTime( result.toLocalZone() );
}
if ( !result.isValid() ) {
result = incidence->dateTime( Incidence::RoleAlarm );
displayStr = IncidenceFormatter::dateTimeToString( result, false,
true,
KDateTime::Spec::LocalZone() );
}
return result;
}
示例2: filterIncidence
bool CalFilter::filterIncidence( Incidence::Ptr incidence ) const
{
if ( !d->mEnabled ) {
return true;
}
Todo::Ptr todo = incidence.dynamicCast<Todo>();
if ( todo ) {
if ( ( d->mCriteria & HideCompletedTodos ) && todo->isCompleted() ) {
// Check if completion date is suffently long ago:
if ( todo->completed().addDays( d->mCompletedTimeSpan ) <
KDateTime::currentUtcDateTime() ) {
return false;
}
}
if ( ( d->mCriteria & HideInactiveTodos ) &&
( ( todo->hasStartDate() &&
KDateTime::currentUtcDateTime() < todo->dtStart() ) ||
todo->isCompleted() ) ) {
return false;
}
if ( d->mCriteria & HideNoMatchingAttendeeTodos ) {
bool iAmOneOfTheAttendees = false;
const Attendee::List &attendees = todo->attendees();
if ( !todo->attendees().isEmpty() ) {
Attendee::List::ConstIterator it;
for ( it = attendees.begin(); it != attendees.end(); ++it ) {
if ( d->mEmailList.contains( ( *it )->email() ) ) {
iAmOneOfTheAttendees = true;
break;
}
}
} else {
// no attendees, must be me only
iAmOneOfTheAttendees = true;
}
if ( !iAmOneOfTheAttendees ) {
return false;
}
}
}
if ( d->mCriteria & HideRecurring ) {
if ( incidence->recurs() ) {
return false;
}
}
if ( d->mCriteria & ShowCategories ) {
for ( QStringList::ConstIterator it = d->mCategoryList.constBegin();
it != d->mCategoryList.constEnd(); ++it ) {
QStringList incidenceCategories = incidence->categories();
for ( QStringList::ConstIterator it2 = incidenceCategories.constBegin();
it2 != incidenceCategories.constEnd(); ++it2 ) {
if ( ( *it ) == ( *it2 ) ) {
return true;
}
}
}
return false;
} else {
for ( QStringList::ConstIterator it = d->mCategoryList.constBegin();
it != d->mCategoryList.constEnd(); ++it ) {
QStringList incidenceCategories = incidence->categories();
for ( QStringList::ConstIterator it2 = incidenceCategories.constBegin();
it2 != incidenceCategories.constEnd(); ++it2 ) {
if ( ( *it ) == ( *it2 ) ) {
return false;
}
}
}
return true;
}
return true;
}