Uploaded image for project: 'Qt Mobility'
  1. Qt Mobility
  2. QTMOBILITY-1410

QML OrganizerModel crashes with invalid data index

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • 1.2.0
    • 1.1.1
    • Organizer
    • bad8acfe7e07ff276dee3acf188281442dfc9322 188280d91a03a7f61854899e62bae694d6006348

      The following patch can fix this issue (provided by Bjørn Erik Nilsen):

      diff --git
      a/plugins/declarative/organizer/qdeclarativeorganizermodel.cpp
      b/plugins/declarative/organizer/qdeclarativeorganizermo
      index 940a525..e5f46f8 100644
      — a/plugins/declarative/organizer/qdeclarativeorganizermodel.cpp
      +++ b/plugins/declarative/organizer/qdeclarativeorganizermodel.cpp
      @@ -960,7 +960,11 @@ void QDeclarativeOrganizerModel::itemsRemoved(const
      QList<QOrganizerItemId>& ids

      QVariant QDeclarativeOrganizerModel::data(const QModelIndex &index, int role) const
      {

      • QDeclarativeOrganizerItem* di = d->m_items.value(index.row());
        + if (index.row() < 0 || index.row() > d->m_items.count())
        + return QVariant();
        +
        + QDeclarativeOrganizerItem* di = d->m_items.at(index.row());
        + Q_ASSERT(di);
        QOrganizerItem item = di->item();
        switch(role) {
        case Qt::DisplayRole:

      Note: The ContactModel code may have the same issue.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            pengwu peng wu (Inactive)
            charles Charles Yin (closed Nokia identity) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes