×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Oct 2011
    Posts
    3

    save QOrganizerEventOccurrence

    how to save QOrganizerEventOccurrence?
    I try
    QOrganizerManager defaultManager;
    QOrganizerEventOccurrence eventOccurrence;

    eventOccurrence.setDisplayLabel("test");
    eventOccurrence.setStartDateTime(QDateTime(QDate(2012, 3, 3)));
    eventOccurrence.setEndDateTime (QDateTime(QDate(2012, 3, 4)));
    eventOccurrence.setOriginalDate(QDate(2012, 3, 3));

    defaultManager.saveItem(&eventOccurrence);

    if (defaultManager.error())
    qDebug() << defaultManager.error();

    Result:
    QOrganizerManager::InvalidOccurrenceError 15 The most recent operation failed because it was an attempt to save an occurrence without a correct InstanceOrigin detail

  2. #2
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    4,021

    Re: save QOrganizerEventOccurrence

    Might be if its asking for DATE & TIME then providing only date might be an issue, try like this if its helps:

    QDateTime start = QDateTime::fromString(aStartDateTime, "yyyy-MM-ddTHH:mm"); // fill here the start date & time
    QDateTime end = QDateTime::fromString(aEndDateTime, "yyyy-MM-ddTHH:mm"); // fill here the end date & time


    eventOccurrence.setStartDateTime(start);
    eventOccurrence.setEndDateTime (end);

  3. #3
    Registered User
    Join Date
    Oct 2011
    Posts
    3

    Re: save QOrganizerEventOccurrence

    It does not help :-(

  4. #4
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    4,021

    Re: save QOrganizerEventOccurrence

    I think using QOrganizerEventOccurrence , you can modify an already existing event in the manager, at least that is what i understand from its description here:

    http://doc.qt.nokia.com/qtmobility/q...ccurrence.html

    Also see its example usage here :

    http://harmattan-dev.nokia.com/docs/...organizer.html (search for 'Recurring Items')

  5. #5
    Registered User
    Join Date
    Oct 2011
    Posts
    3

    Re: save QOrganizerEventOccurrence

    I read this earlier and try
    QList<QOrganizerItem> entries1 = defaultManager.items();
    foreach (QOrganizerItem item, entries1) {
    if (item.type() == QOrganizerItemType::TypeEvent) {
    QOrganizerEventOccurrence nextMarshmallowMeeting = defaultManager.itemOccurrences(item).value(0);
    nextMarshmallowMeeting.setStartDateTime(event1.startDateTime());
    nextMarshmallowMeeting.setEndDateTime(event1.endDateTime());
    nextMarshmallowMeeting.setDisplayLabel("hello");
    nextMarshmallowMeeting.setDescription("hello world");
    defaultManager.saveItem(&nextMarshmallowMeeting);
    if (defaultManager.error())
    QMessageBox::warning(this, QString(tr("Failed2")), QString("(error code %1 %2)").arg(defaultManager.error()).arg(item.displayLabel()));
    }
    }
    Result
    QOrganizerManager::InvalidDetail Error 3 The most recent operation failed because the specified organizer detail definition already exists

  6. #6
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    4,021

    Re: save QOrganizerEventOccurrence

    Not sure but you might have to add some recurrence rule to an event & also apply the case as given in 2nd link as :

    else if (item.type() == QOrganizerItemType::TypeEventOccurrence) {
    QOrganizerEventOccurrence event(item);

    ...
    ...

Similar Threads

  1. save sms
    By binsint in forum Mobile Java General
    Replies: 3
    Last Post: 2010-12-18, 18:42
  2. to save exe???
    By SymbianSangeet in forum Symbian
    Replies: 4
    Last Post: 2010-05-18, 09:51
  3. Replies: 11
    Last Post: 2008-06-26, 05:54
  4. how to save file & how to save settings?
    By MGvision in forum Mobile Java General
    Replies: 2
    Last Post: 2007-06-13, 13:56
  5. somebody save me...
    By kornhed in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2004-06-30, 07:24

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×