本文整理汇总了C++中incidence::Ptr::setSummary方法的典型用法代码示例。如果您正苦于以下问题:C++ Ptr::setSummary方法的具体用法?C++ Ptr::setSummary怎么用?C++ Ptr::setSummary使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类incidence::Ptr
的用法示例。
在下文中一共展示了Ptr::setSummary方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createInitialIncidences
void CalendarBaseTest::createInitialIncidences()
{
mExpectedSlotResult = true;
for (int i=0; i<5; ++i) {
Event::Ptr event = Event::Ptr(new Event());
event->setUid(QStringLiteral("event") + QString::number(i));
event->setSummary(QStringLiteral("summary") + QString::number(i));
event->setDtStart(KDateTime::currentDateTime(KDateTime::UTC));
mUids.append(event->uid());
QVERIFY(mCalendar->addEvent(event));
QTestEventLoop::instance().enterLoop(5);
QVERIFY(!QTestEventLoop::instance().timeout());
}
mOneEventUid = mUids.last();
for (int i=0; i<5; ++i) {
Todo::Ptr todo = Todo::Ptr(new Todo());
todo->setUid(QStringLiteral("todo") + QString::number(i));
todo->setDtStart(KDateTime::currentDateTime(KDateTime::UTC));
todo->setSummary(QStringLiteral("summary") + QString::number(i));
mUids.append(todo->uid());
QVERIFY(mCalendar->addTodo(todo));
QTestEventLoop::instance().enterLoop(5);
QVERIFY(!QTestEventLoop::instance().timeout());
}
mOneTodoUid = mUids.last();
for (int i=0; i<5; ++i) {
Journal::Ptr journal = Journal::Ptr(new Journal());
journal->setUid(QStringLiteral("journal") + QString::number(i));
journal->setSummary(QStringLiteral("summary") + QString::number(i));
journal->setDtStart(KDateTime::currentDateTime(KDateTime::UTC));
mUids.append(journal->uid());
QVERIFY(mCalendar->addJournal(journal));
QTestEventLoop::instance().enterLoop(5);
QVERIFY(!QTestEventLoop::instance().timeout());
}
mOneJournalUid = mUids.last();
for (int i=0; i<5; ++i) {
Incidence::Ptr incidence = Incidence::Ptr(new Event());
incidence->setUid(QStringLiteral("incidence") + QString::number(i));
incidence->setSummary(QStringLiteral("summary") + QString::number(i));
incidence->setDtStart(KDateTime::currentDateTime(KDateTime::UTC));
mUids.append(incidence->uid());
QVERIFY(mCalendar->addIncidence(incidence));
QTestEventLoop::instance().enterLoop(5);
QVERIFY(!QTestEventLoop::instance().timeout());
}
mOneIncidenceUid = mUids.last();
}
示例2: fixEmptySummary
void Compat::fixEmptySummary( const Incidence::Ptr &incidence )
{
// some stupid vCal exporters ignore the standard and use Description
// instead of Summary for the default field. Correct for this: Copy the
// first line of the description to the summary (if summary is just one
// line, move it)
if ( incidence->summary().isEmpty() && !( incidence->description().isEmpty() ) ) {
QString oldDescription = incidence->description().trimmed();
QString newSummary( oldDescription );
newSummary.remove( QRegExp( "\n.*" ) );
incidence->setSummary( newSummary );
if ( oldDescription == newSummary ) {
incidence->setDescription( "" );
}
}
}