~mihirsoni/ubuntu-calendar-app/dateSelectNewEventTest

« back to all changes in this revision

Viewing changes to EventListModel.qml

  • Committer: Frank Mertens
  • Date: 2013-03-19 23:42:36 UTC
  • mto: This revision was merged to the branch mainline in revision 11.
  • Revision ID: frank@cyblogic.de-20130319234236-p5tcchd8harzcfwa
Added the EventListModel to support the display of event lists.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
import "dataService.js" as DataService
4
4
 
5
5
ListModel {
6
 
    property var term: QtObject {
7
 
        property var start: new Date()
8
 
        property var length: Date.msPerDay
9
 
    }
 
6
    id: model
 
7
 
 
8
    property var termStart: new Date()
 
9
    property var termLength: Date.msPerDay
 
10
 
10
11
    signal reload
 
12
 
11
13
    onReload: {
12
 
        // data.getEvents(term
 
14
        var t0 = termStart.getTime()
 
15
        var t1 = t0 + termLength
 
16
        model.clear()
 
17
        DataService.getEvents(t0, t1, model)
 
18
        console.log("termStart, t0, t1, count =", termStart, t0, t1, count)
13
19
    }
14
20
    Component.onCompleted: {
15
21
        reload()
16
22
        DataService.eventsNotifier.dataChanged.connect(reload)
17
 
        termChanged.connect(reload)
 
23
        termStartChanged.connect(reload)
18
24
    }
19
25
}