Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Deleting Device Calender items through a client(application)

Deleting Device Calender items through a client(application)

Scheduled Pinned Locked Moved Mobile and Embedded
5 Posts 2 Posters 1.9k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    imrrk
    wrote on last edited by
    #1

    Hello friends,I am devloping an application which uses organizer apis,till now I am able to set the entries in the device calendar through my application,Now when i try to delete the entries which i set in the device calendar through my application,they get deleted but also the entries in the device calendar which are not set by mu application also get deleted so how shall i solve this issue.
    below is my code which i have used to deleted calendar entries..

    @void ReminderForm::on_DeleteReminder_clicked()
    {
    QList<QOrganizerItemId> ids = m_manager->itemIds();
    qDebug()<<ids;
    if(ids.count()) {
    m_remReq.setItemIds(ids);
    m_remReq.setManager(m_manager);
    m_remReq.start();
    connect(&m_remReq, SIGNAL(stateChanged(QOrganizerAbstractRequest::State)),
    this, SLOT(removeReqStateChanged(QOrganizerAbstractRequest::State)));

    }
    }
    void ReminderForm::removeReqStateChanged(QOrganizerAbstractRequest::State reqState)
    {
    if(QOrganizerAbstractRequest::ActiveState == reqState) {
    // Request started. Show a progress or wait dialog
    m_progressDlg = new QProgressDialog("Removing events..", "Cancel", 100, 100, this);
    connect(m_progressDlg, SIGNAL(canceled()), &m_remReq, SLOT(cancel()));
    m_progressDlg->show();
    } else if (QOrganizerAbstractRequest::FinishedState == reqState ||
    QOrganizerAbstractRequest::CanceledState == reqState) {
    // Request finished or cancelled. Stop showing the progress dialog and refresh
    m_progressDlg->hide();

    }
    

    }
    @

    regards
    imrrk

    1 Reply Last reply
    0
    • L Offline
      L Offline
      leon.anavi
      wrote on last edited by
      #2

      According to the official documentation of "the Organizer API":http://doc.qt.nokia.com/qtmobility-1.1.0/organizer.html you can retrieve the entry and after that to delete it using an instance of class "QOrganizerManager":http://doc.qt.nokia.com/qtmobility/qorganizermanager.html

      In your case I guess you can delete an item like this:
      @
      m_manager->removeItem(ids[0]);
      @
      Please note that I have used id 0 just for an example.

      http://anavi.org/

      1 Reply Last reply
      0
      • I Offline
        I Offline
        imrrk
        wrote on last edited by
        #3

        ok thanks leon,for your reply ..i will try it

        regards
        imrrk

        1 Reply Last reply
        0
        • I Offline
          I Offline
          imrrk
          wrote on last edited by
          #4

          to save an item i have added these lines of code
          @m_organizerEvent.setDisplayLabel(str);
          m_organizerEvent.setDisplayLabel(str1);
          m_organizerEvent.setStartDateTime(dtFromTime);
          m_organizerEvent.setEndDateTime(dtToTime);
          m_manager->saveItem(&m_organizerEvent);@

          so now to delete entries can be done like this
          @void ReminderForm::on_DeleteReminder_clicked()
          {

            QList<QOrganizerEvent> ids =m_manager->itemIds();
            ids.removeAll(m_organizerEvent.id());
          

          }
          @

          regards
          imrrk

          1 Reply Last reply
          0
          • I Offline
            I Offline
            imrrk
            wrote on last edited by
            #5

            Hello friends..I am not able to delete only the application specific entries from the device calendar.when i delete the entries from the application,not only the application specific entries but also the device calendar entries gets deleted..so any help..

            regards
            imrrk

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved