void tst_QOrganizerItemDetails::parent() { QOrganizerItemParent p; QOrganizerItem oi; // hrm, how to test parent local id? QVERIFY(p.isEmpty()); p.setOriginalDate(QDate(2010, 10, 13)); QVERIFY(p.originalDate() == QDate(2010, 10, 13)); QVERIFY(!p.isEmpty()); QVERIFY(oi.saveDetail(&p)); QVERIFY(oi.details(QOrganizerItemDetail::TypeParent).size() == 1); QVERIFY(oi.detail(QOrganizerItemDetail::TypeParent) == p); p.setOriginalDate(QDate(2010, 10, 14)); QVERIFY(oi.detail(QOrganizerItemDetail::TypeParent) != p); QVERIFY(oi.saveDetail(&p)); // update QVERIFY(oi.detail(QOrganizerItemDetail::TypeParent) == p); QVERIFY(oi.removeDetail(&p)); QVERIFY(oi.details(QOrganizerItemDetail::TypeParent).size() == 0); }
/*! Returns the date at which the occurrence was originally going to occur. */ QDate QOrganizerTodoOccurrence::originalDate() const { QOrganizerItemParent origin = detail(QOrganizerItemDetail::TypeParent); return origin.originalDate(); }
/*! Returns the date at which the occurrence was originally going to occur. \since 1.1 */ QDate QOrganizerEventOccurrence::originalDate() const { QOrganizerItemParent origin = detail<QOrganizerItemParent>(); return origin.originalDate(); }