×

Discussion Board

Results 1 to 10 of 10
  1. #1
    Registered User
    Join Date
    Apr 2010
    Posts
    12

    QOrganizerItemVisualReminder

    Dear all,

    I've got the following code:

    QOrganizerManager manager;
    QOrganizerEvent event;
    QScopedPointer<QOrganizerItemReminder> reminder(new QOrganizerItemVisualReminder());

    event.setPriority(QOrganizerItemPriority::HighPriority);
    event.setStartDateTime(start);
    event.setDisplayLabel(message);
    event.setDescription(message);
    event.setEndDateTime(end);

    reminder->setSecondsBeforeStart(0);
    (static_cast<QOrganizerItemVisualReminder*>(reminder.data()))->setMessage(message);
    event.saveDetail(reminder.data());
    manager.saveItem(&event);

    and it works great, in the simulator, creating the event and associated visual reminder.

    The problem is when running on a N9 the event gets to the calendar, but no reminder/alarm !!

    Can someone give me a clue?

    Thanks a lot.

  2. #2
    Super Contributor
    Join Date
    Mar 2009
    Posts
    1,024

    Re: QOrganizerItemVisualReminder

    Hi,
    Do you lunch the application by Qt Creator or clicking the icon in the device applications menu?
    Qt creator launches the app as "developer" unix user. So data saved in the phone is not visible.

  3. #3
    Registered User
    Join Date
    Apr 2010
    Posts
    12

    Re: QOrganizerItemVisualReminder

    Hi gnuton,

    The problem is when i actually install the deb package to a real phone (through Nokia Remote Device Access).

    I've made further tests, and when listing the item details after saving it (with QOrganizerItem::details()), the reminder detail isn't there, it gets scraped off the item.

    If i go to the native calendar app i can see that the event was created, but with no reminder, also, if I edit the event in the calendar and add a reminder there, and then go back to my app and run the test that lists the item's details, the reminder doesn't show up, but other details like 'location' do show up.

    Is this some bug in the QOrganizer module's backend for Harmattan?

    I'm going crazy about this, and i really need this for my app to work.

    Please can someone give me a workaround...

    Many thanks!!

  4. #4
    Registered User
    Join Date
    Apr 2010
    Posts
    12

    Re: QOrganizerItemVisualReminder

    The resulting list of details from the QOrganizerItem created in the calendar (which i got from a call to QOrganizerItem::details()) is the following:
    "Type, DisplayLabel, Description, Guid, EventTime".

    The "Reminder" detail doesn't show up, even after manually adding it in the calendar app.

    So the QOrganizer backend doesn't create the QOrganizerItemReminder and it also can't show an alert created in the calendar app.

  5. #5
    Registered User
    Join Date
    Apr 2010
    Posts
    12

    Re: QOrganizerItemVisualReminder

    I'm investigating using mkcal as an alternative api for calendar... Anyone have tried this?

  6. #6
    Registered User
    Join Date
    Apr 2010
    Posts
    12

    Re: QOrganizerItemVisualReminder

    I had sucess with mkcal lib !!

    For this to work, I had to install Qt SDK and Harmattan Platform SDK in a Linux environment.

    This is the code I used:

    ExtendedCalendar::Ptr calendar = ExtendedCalendar::Ptr ( new ExtendedCalendar( KDateTime::Spec::LocalZone() ) );
    ExtendedStorage::Ptr storage = calendar->defaultStorage(calendar);
    Event::Ptr event;
    Alarm::Ptr alarm;

    storage->open();
    storage->load(start.date(), end.date());

    event=Event::Ptr(new Event());
    event->setDtStart(KDateTime(start));
    event->setDescription(message);
    event->setSummary(message);

    alarm=Alarm::Ptr(new Alarm(event.data()));
    alarm->setDisplayAlarm(message);
    alarm->setEnabled(true);
    alarm->setRepeatCount(1);
    alarm->setStartOffset(Duration(0));
    alarm->setTime(KDateTime(start));
    alarm->setEndOffset(Duration(0));

    event->addAlarm(alarm);


    calendar->addEvent(event, "11111111-2222-3333-4444-555555555555");
    calendar->save();

    storage->save();
    storage->close();

  7. #7
    Super Contributor
    Join Date
    Mar 2009
    Posts
    1,024

    Re: QOrganizerItemVisualReminder

    Great!
    Any chance to see a little wiki article which explain a little bit more how to use this lib?

  8. #8
    Registered User
    Join Date
    Apr 2010
    Posts
    12

    Re: QOrganizerItemVisualReminder

    Sure, i'll do that

  9. #9
    Registered User
    Join Date
    Apr 2010
    Posts
    12

  10. #10
    Super Contributor
    Join Date
    Mar 2009
    Posts
    1,024

    Re: QOrganizerItemVisualReminder

    Thanks mate!

Posting Permissions

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