diff options
| author | Chris Adams <christopher.adams@nokia.com> | 2010-05-13 11:13:47 +1000 |
|---|---|---|
| committer | Chris Adams <christopher.adams@nokia.com> | 2010-05-13 11:13:47 +1000 |
| commit | c9c44a28ed4ee57ef1f91cb077316f7d03a92fc1 (patch) | |
| tree | 71c4b3e6e8aeb4e3c6e5b4e6821343ea60891f58 /doc/src/snippets/qtorganizerdocsample/qtorganizerdocsample.cpp | |
| parent | ceeb3579207b7ff9df6010a2d810fbe457b94cdf (diff) | |
Provide macro to allow easy generation of custom organizer item types
Based on the ItemDetail macro.
Also added some constant string types to QOrganizerItemType class
for occurrences, and made the doc snippet example compile.
Diffstat (limited to 'doc/src/snippets/qtorganizerdocsample/qtorganizerdocsample.cpp')
| -rw-r--r-- | doc/src/snippets/qtorganizerdocsample/qtorganizerdocsample.cpp | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/doc/src/snippets/qtorganizerdocsample/qtorganizerdocsample.cpp b/doc/src/snippets/qtorganizerdocsample/qtorganizerdocsample.cpp index 23ed01eb51..d33913831d 100644 --- a/doc/src/snippets/qtorganizerdocsample/qtorganizerdocsample.cpp +++ b/doc/src/snippets/qtorganizerdocsample/qtorganizerdocsample.cpp @@ -81,17 +81,20 @@ void snippets() // XXX TODO: make this more convenient. // QOIM::itemInstances(item, startDateTime, endDateTime, count) ? // QOI::instanceFilter(start, end) ? - QOrganizerItemDetailFilter dfil; - dfil.setDetailDefinitionName(QOrganizerItemParentInfo::DefinitionName, QOrganizerItemParentInfo::FieldParentId); - dfil.setValue(recEvent.id()); +// QOrganizerItemDetailFilter dfil; +// dfil.setDetailDefinitionName(QOrganizerItemParentInfo::DefinitionName, QOrganizerItemParentInfo::FieldParentId); +// dfil.setValue(recEvent.id()); - QOrganizerItemPeriodFilter pfil; - pfil.setStartDate(QDateTime::current(), endOfThisMonth()); - QOrganizerItemIntersectionFilter ifil; - ifil << dfil << pfil; + // alternative to pfil: give me the instance view from this date to that date, with this filter ^^ +// QOrganizerItemPeriodFilter pfil; +// pfil.setStartDate(QDateTime::current()); +// pfil.setEndDate(endOfThisMonth()); - QList<QOrganizerItem> instances = defaultManager.itemInstances(ifil); +// QOrganizerItemIntersectionFilter ifil; +// ifil << dfil << pfil; + +// QList<QOrganizerItem> instances = defaultManager.itemInstances(ifil); //! [Retrieving occurrences of a particular recurrent event within a time period] //! [Retrieving the next 5 occurrences of a particular recurrent event] @@ -127,15 +130,15 @@ void snippets() // XXX TODO: make this more convenient. // QOrganizerItemLocation::matchLocationName("Meeting Room 8") ? QOrganizerItemDetailFilter locationFilter; - locationFilter.setDetailDefinition(QOrganizerItemLocation::DefinitionName, QOrganizerItemLocation::FieldLocationName); + locationFilter.setDetailDefinitionName(QOrganizerItemLocation::DefinitionName, QOrganizerItemLocation::FieldLocationName); locationFilter.setValue("Meeting Room 8"); QList<QOrganizerItem> entries = defaultManager.items(locationFilter); //! [Retrieving any entry (not occurrence) which matches a search criteria] //! [Creating an exception to a particular recurrent event] QOrganizerItemEventTimeRange newTime; - newTime.setStartDateTime("6pm"); - newTime.setEndDateTime("8pm"); + newTime.setStartDateTime(QDateTime::fromString("13.05.2010 18:00:00", "dd.MM.yy hh:mm:ss")); + newTime.setEndDateTime(QDateTime::fromString("13.05.2010 20:00:00", "dd.MM.yy hh:mm:ss")); QOrganizerItemNote newNote; newNote.setNote("The next meeting will go for an hour longer (starting one "\ "hour earlier than usual), since we have scheduled one hour"\ @@ -143,7 +146,7 @@ void snippets() "at the meeting."); // the following line should be made simpler via QOIM::itemInstances(item, startDateTime, endDateTime, count)... - QOrganizerEventOccurrence nextMarshmallowMeeting = QOrganizerEventOccurrence(defaultManager.itemInstances(dfil).first()); + QOrganizerEventOccurrence nextMarshmallowMeeting = QOrganizerEventOccurrence(defaultManager.itemInstances().first()); // should use dfil. nextMarshmallowMeeting.saveDetail(&newTime); nextMarshmallowMeeting.saveDetail(&newNote); defaultManager.saveItem(&nextMarshmallowMeeting); |
