calendarui/views/dayview/tsrc/unittests/unittest_calendaymodelmanager/calendaymodel.h
changeset 81 ce92091cbd61
parent 45 b6db4fd4947b
equal deleted inserted replaced
75:7ac58b2aae6f 81:ce92091cbd61
    39 {
    39 {
    40     Q_OBJECT
    40     Q_OBJECT
    41 public:
    41 public:
    42 	CalenDayModel(const QDateTime &date, MCalenServices &services,
    42 	CalenDayModel(const QDateTime &date, MCalenServices &services,
    43 						QObject *parent = 0){
    43 						QObject *parent = 0){
    44 							Q_UNUSED(date);
       
    45 							Q_UNUSED(services);
    44 							Q_UNUSED(services);
    46 							Q_UNUSED(parent);
    45 							Q_UNUSED(parent);
       
    46 							mModelRefreshed = 0;
       
    47 							mModelDate = date;
    47 						}
    48 						}
    48 	
    49 	
    49     // from QAbstractListModel
    50     // from QAbstractListModel
    50 	int rowCount(const QModelIndex &parent = QModelIndex()) const{
    51 	int rowCount(const QModelIndex &parent = QModelIndex()) const{
    51 		Q_UNUSED(parent);
    52 		Q_UNUSED(parent);
    56 		Q_UNUSED(role);
    57 		Q_UNUSED(role);
    57 		return 0;
    58 		return 0;
    58     }
    59     }
    59     
    60     
    60 	void refreshModel(const QDateTime &date){
    61 	void refreshModel(const QDateTime &date){
    61 		Q_UNUSED(date);
    62 		mModelDate = date;
       
    63 		mModelRefreshed++;
    62 	}
    64 	}
    63 	
    65 	
    64 	QDateTime modelDate(){
    66 	QDateTime modelDate(){
    65 		return QDateTime(QDate(2000, 10, 10));
    67 		return mModelDate;
    66 	}
    68 	}
       
    69 	
       
    70 	//return info how much time model was refreshed
       
    71 	quint32 modelRefreshed() {return mModelRefreshed;}
       
    72 	
       
    73 private:
       
    74 	quint32 mModelRefreshed;
       
    75 	QDateTime mModelDate;
    67 };
    76 };
    68 
    77 
    69 #endif //CALENDAYMODEL_H
    78 #endif //CALENDAYMODEL_H
    70 
    79