Changeset 04acaf9 for src/mvc


Ignore:
Timestamp:
04/15/10 14:50:23 (12 years ago)
Author:
kirilma <kirilma@…>
Branches:
master, qt5
Children:
2eda137
Parents:
d97bcab
Message:

fix deletion of last conference

implement for cleaning all views in the tabs
clean the models when no active conference found
fix cleaning model and signalling views

Location:
src/mvc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/mvc/eventmodel.cpp

    rd97bcab r04acaf9  
    2525
    2626EventModel::EventModel()
    27 {
    28     mEvents.clear();
    29 }
     27{ }
    3028
    3129void EventModel::createTimeGroups()
     
    6361
    6462    mGroups.last().mChildCount = mEvents.count() - mGroups.last().mFirstEventIndex;
     63
     64    reset();
    6565}
    6666
     
    200200void EventModel::clearModel()
    201201{
    202     for(int i = 0;i < mGroups.count();i++){
    203         QModelIndex idx = index(i, 0);
    204         Group group = mGroups[i];
    205         beginRemoveRows(idx, 0, group.mChildCount - 1);
    206         /*bool ok =*/ removeRows(0, group.mChildCount, idx);
    207         endRemoveRows();
    208         //qDebug() << "removing " << group.mChildCount << " events from group:" << i << idx.data() << ":" << ok;
    209     }
     202    qDebug() << __PRETTY_FUNCTION__ << this << mEvents.count();
     203    mGroups.clear();
    210204    mEvents.clear();
     205    mParents.clear();
     206
     207    reset();
    211208}
    212209
  • src/mvc/eventmodel.h

    rd97bcab r04acaf9  
    4242    void loadEventsByRoom(const QDate &aDate, int aConferenceId);
    4343    void loadConflictEvents(int aEventId, int aConferenceId); // loads events in conflict
     44    void clearModel();
    4445
    4546private:
     
    6364    void createTrackGroups();
    6465    void createTrackGroupsNew();
    65     void clearModel();
    6666    void createRoomGroups();
    6767
Note: See TracChangeset for help on using the changeset viewer.