on xenial help sign in
MenuItemFactory: avoid getting data from undefined menuData.actionState in calendar
ae49e0eMarco Trevisan (Treviño)
qml/Panel/Indicators/MenuItemFactory.qml+6−8
@@ -510,18 +510,16 @@ Item {
510
510
511 property QtObject menuData: null
511 property QtObject menuData: null
512 property var menuModel: menuFactory.menuModel
512 property var menuModel: menuFactory.menuModel
513+ property var actionState: menuData && menuData.actionState || null
514+ property int calendarDay: getExtendedProperty(actionState, "calendar-day", 0) * 1000
513 property int menuIndex: -1
515 property int menuIndex: -1
514
516
515− showWeekNumbers: menuData && menuData.actionState["show-week-numbers"]
517+ showWeekNumbers: getExtendedProperty(actionState, "show-week-numbers", false)
518+ eventDays: getExtendedProperty(actionState, "appointment-days", [])
516
519
517 Binding on currentDate {
520 Binding on currentDate {
518− when: menuData && menuData.actionState.hasOwnProperty("calendar-day") > 0
521+ when: calendarDay > 0
519− value: new Date(menuData.actionState["calendar-day"] * 1000)
522+ value: new Date(calendarDay)
520− }
521−
522− Binding on eventDays {
523− when: menuData && menuData.actionState.hasOwnProperty("appointment-days") > 0
524− value: menuData.actionState["appointment-days"]
525 }
523 }
526
524
527 onSelectedDateChanged: {
525 onSelectedDateChanged: {