本文整理汇总了C++中incidence::Ptr::addComment方法的典型用法代码示例。如果您正苦于以下问题:C++ Ptr::addComment方法的具体用法?C++ Ptr::addComment怎么用?C++ Ptr::addComment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类incidence::Ptr
的用法示例。
在下文中一共展示了Ptr::addComment方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: acceptReply
CallId Scheduler::acceptReply( const IncidenceBase::Ptr &incidence,
ScheduleMessage::Status status,
iTIPMethod method )
{
Q_UNUSED( status );
if ( incidence->type() == IncidenceBase::TypeFreeBusy ) {
return acceptFreeBusy( incidence, method );
}
const CallId callId = ++d->mLatestCallId;
ResultCode resultCode = ResultCodeIncidenceOrAttendeeNotFound;
QString errorMessage;
Event::Ptr ev = d->mCalendar->event( incidence->uid() );
Todo::Ptr to = d->mCalendar->todo( incidence->uid() );
// try harder to find the correct incidence
if ( !ev && !to ) {
const Incidence::List list = d->mCalendar->incidences();
for ( Incidence::List::ConstIterator it=list.constBegin(), end=list.constEnd();
it != end; ++it ) {
if ( (*it)->schedulingID() == incidence->uid() ) {
ev = ( *it ).dynamicCast<Event>();
to = ( *it ).dynamicCast<Todo>();
break;
}
}
}
if ( ev || to ) {
//get matching attendee in calendar
kDebug() << "match found!";
Attendee::List attendeesIn = incidence->attendees();
Attendee::List attendeesEv;
Attendee::List attendeesNew;
if ( ev ) {
attendeesEv = ev->attendees();
}
if ( to ) {
attendeesEv = to->attendees();
}
Attendee::List::ConstIterator inIt;
Attendee::List::ConstIterator evIt;
for ( inIt = attendeesIn.constBegin(); inIt != attendeesIn.constEnd(); ++inIt ) {
Attendee::Ptr attIn = *inIt;
bool found = false;
for ( evIt = attendeesEv.constBegin(); evIt != attendeesEv.constEnd(); ++evIt ) {
Attendee::Ptr attEv = *evIt;
if ( attIn->email().toLower() == attEv->email().toLower() ) {
//update attendee-info
kDebug() << "update attendee";
attEv->setStatus( attIn->status() );
attEv->setDelegate( attIn->delegate() );
attEv->setDelegator( attIn->delegator() );
resultCode = ResultCodeSuccess;
found = true;
}
}
if ( !found && attIn->status() != Attendee::Declined ) {
attendeesNew.append( attIn );
}
}
bool attendeeAdded = false;
for ( Attendee::List::ConstIterator it = attendeesNew.constBegin();
it != attendeesNew.constEnd(); ++it ) {
Attendee::Ptr attNew = *it;
QString msg =
i18nc( "@info", "%1 wants to attend %2 but was not invited.",
attNew->fullName(),
( ev ? ev->summary() : to->summary() ) );
if ( !attNew->delegator().isEmpty() ) {
msg = i18nc( "@info", "%1 wants to attend %2 on behalf of %3.",
attNew->fullName(),
( ev ? ev->summary() : to->summary() ), attNew->delegator() );
}
if ( KMessageBox::questionYesNo(
0, msg, i18nc( "@title", "Uninvited attendee" ),
KGuiItem( i18nc( "@option", "Accept Attendance" ) ),
KGuiItem( i18nc( "@option", "Reject Attendance" ) ) ) != KMessageBox::Yes ) {
Incidence::Ptr cancel = incidence.dynamicCast<Incidence>();
if ( cancel ) {
cancel->addComment(
i18nc( "@info",
"The organizer rejected your attendance at this meeting." ) );
}
performTransaction( incidence, iTIPCancel, attNew->fullName() );
// ### can't delete cancel here because it is aliased to incidence which
// is accessed in the next loop iteration (CID 4232)
// delete cancel;
continue;
}
Attendee::Ptr a( new Attendee( attNew->name(), attNew->email(), attNew->RSVP(),
attNew->status(), attNew->role(), attNew->uid() ) );
a->setDelegate( attNew->delegate() );
a->setDelegator( attNew->delegator() );
if ( ev ) {
ev->addAttendee( a );
//.........这里部分代码省略.........