Ignore:
Timestamp:
01/18/10 09:49:50 (12 years ago)
Author:
pavelpa <pavelpa@…>
Branches:
master, qt5
Children:
27102d5
Parents:
9f7666d
Message:

fix: segfault

  • fixes segfault when switching days in "Day View"
  • TODO: needs to be verified, 'cause it looks like

it shouldn't work, but it does

  • when calling 'QAbstractItemModel::removeRows()' it returns false, but it prevents application from crash(segfault)
    • possible explanation is that the timing has changed and so the conditions for the segfault
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mvc/eventmodel.cpp

    r9f7666d r8035cef  
    120120void EventModel::loadEvents(const QDate &aDate, int aConferenceId)
    121121{
     122    for(int i=0; i<mGroups.count(); i++)
     123    {
     124        QModelIndex idx = index(i,0);
     125        Group group = mGroups[i];
     126        beginRemoveRows(idx,0,group.mChildCount-1);
     127        bool ok = removeRows(0,group.mChildCount,idx);
     128        endRemoveRows();
     129        //qDebug() << "removing " << group.mChildCount << " events from group:" << i << idx.data() << ":" << ok;
     130    }
     131
    122132    mEvents.clear();
    123133
     
    133143void EventModel::loadFavEvents(const QDate &aDate, int aConferenceId)
    134144{
     145    for(int i=0; i<mGroups.count(); i++)
     146    {
     147        QModelIndex idx = index(i,0);
     148        Group group = mGroups[i];
     149        beginRemoveRows(idx,0,group.mChildCount-1);
     150        bool ok = removeRows(0,group.mChildCount,idx);
     151        endRemoveRows();
     152        //qDebug() << "removing " << group.mChildCount << " events from group:" << i << idx.data() << ":" << ok;
     153    }
     154
    135155    mEvents.clear();
    136156
Note: See TracChangeset for help on using the changeset viewer.