diff --git a/package/contents/ui/AgendaEventItem.qml b/package/contents/ui/AgendaEventItem.qml index d7926bdc..92c4bbf3 100644 --- a/package/contents/ui/AgendaEventItem.qml +++ b/package/contents/ui/AgendaEventItem.qml @@ -25,8 +25,12 @@ LinkRect { } Connections { target: timeModel - onLoaded: agendaEventItem.checkIfInProgress() - onMinuteChanged: agendaEventItem.checkIfInProgress() + function onLoaded() { + agendaEventItem.checkIfInProgress() + } + function onMinuteChanged() { + agendaEventItem.checkIfInProgress() + } } Component.onCompleted: { agendaEventItem.checkIfInProgress() @@ -228,7 +232,7 @@ LinkRect { } // eventColumn } - + onLeftClicked: { // logger.log('agendaItem.event.leftClicked', model.startDateTime, mouse) if (false) { diff --git a/package/contents/ui/AgendaListItem.qml b/package/contents/ui/AgendaListItem.qml index 1aa3ca9b..feb4be1d 100644 --- a/package/contents/ui/AgendaListItem.qml +++ b/package/contents/ui/AgendaListItem.qml @@ -22,8 +22,12 @@ GridLayout { Component.onCompleted: agendaListItem.checkIfToday() Connections { target: timeModel - onLoaded: agendaListItem.checkIfToday() - onDateChanged: agendaListItem.checkIfToday() + function onLoaded() { + agendaListItem.checkIfToday() + } + function onDateChanged() { + agendaListItem.checkIfToday() + } } property bool agendaItemInProgress: agendaItemIsToday property bool weatherOnRight: plasmoid.configuration.agendaWeatherOnRight @@ -32,7 +36,7 @@ GridLayout { Connections { target: agendaModel - onPopulatingChanged: { + function onPopulatingChanged() { if (!agendaModel.populating) { agendaListItem.reset() } diff --git a/package/contents/ui/AgendaTaskItem.qml b/package/contents/ui/AgendaTaskItem.qml index 38f2d737..cae2d270 100644 --- a/package/contents/ui/AgendaTaskItem.qml +++ b/package/contents/ui/AgendaTaskItem.qml @@ -23,8 +23,12 @@ LinkRect { } Connections { target: timeModel - onLoaded: agendaTaskItem.checkIfIsOverdue() - onMinuteChanged: agendaTaskItem.checkIfIsOverdue() + function onLoaded() { + agendaTaskItem.checkIfIsOverdue() + } + function onMinuteChanged() { + agendaTaskItem.checkIfIsOverdue() + } } Component.onCompleted: { agendaTaskItem.checkIfIsOverdue() @@ -164,7 +168,7 @@ LinkRect { // onClicked: Qt.openUrlExternally(model.htmlLink) // } } - + onLeftClicked: { var task = tasks.get(taskItemIndex) logger.logJSON("task", task) diff --git a/package/contents/ui/AgendaView.qml b/package/contents/ui/AgendaView.qml index fc204bfa..96304e25 100644 --- a/package/contents/ui/AgendaView.qml +++ b/package/contents/ui/AgendaView.qml @@ -22,7 +22,7 @@ Item { Connections { target: eventModel - onEventCreated: { + function onEventCreated() { notificationManager.notify({ appName: i18n("Event Calendar"), appIcon: "resource-calendar-insert", @@ -34,7 +34,7 @@ Item { }) }) } - onEventDeleted: { + function onEventDeleted() { logger.logJSON('AgendaView.onEventDeleted', data) notificationManager.notify({ appName: i18n("Event Calendar"), @@ -80,7 +80,7 @@ Item { // scrollToIndexTimer.updatePosition() // } // } - + // Component.onCompleted: console.log(Date.now(), 'AgendaListItem.onCompleted', index) // Component.onDestruction: console.log(Date.now(), 'AgendaListItem.onDestruction', index) } diff --git a/package/contents/ui/DaysCalendar.qml b/package/contents/ui/DaysCalendar.qml index 5a84503c..341bca3d 100644 --- a/package/contents/ui/DaysCalendar.qml +++ b/package/contents/ui/DaysCalendar.qml @@ -299,7 +299,7 @@ Item { Connections { target: theme - onTextColorChanged: { + function onTextColorChanged() { canvas.requestPaint() } } @@ -424,7 +424,7 @@ Item { Connections { target: daysCalendar - onActivateHighlightedItem: { + function onActivateHighlightedItem() { if (delegate.containsMouse) { delegate.clicked(null) } diff --git a/package/contents/ui/EditEventForm.qml b/package/contents/ui/EditEventForm.qml index 389226b6..f7e5762e 100644 --- a/package/contents/ui/EditEventForm.qml +++ b/package/contents/ui/EditEventForm.qml @@ -86,8 +86,8 @@ Loader { //---- Testing // Connections { // target: durationSelector - // onStartDateTimeChanged: logger.logJSON('onStartDateTimeChanged', editEventItem.getChanges()) - // onEndDateTimeChanged: logger.logJSON('onEndDateTimeChanged', editEventItem.getChanges()) + // function onStartDateTimeChanged() { logger.logJSON('onStartDateTimeChanged', editEventItem.getChanges()) } + // function onEndDateTimeChanged() { logger.logJSON('onEndDateTimeChanged', editEventItem.getChanges()) } // } //---- diff --git a/package/contents/ui/Logic.qml b/package/contents/ui/Logic.qml index e8e030bc..272ecc4a 100644 --- a/package/contents/ui/Logic.qml +++ b/package/contents/ui/Logic.qml @@ -23,7 +23,7 @@ Item { //--- Update Timer { id: pollTimer - + repeat: true triggeredOnStart: true interval: plasmoid.configuration.eventsPollInterval * 60000 @@ -79,7 +79,7 @@ Item { } else { shouldUpdate = true } - + if (force || shouldUpdate) { updateWeatherTimer.restart() } @@ -160,33 +160,59 @@ Item { target: plasmoid.configuration //--- Events - onAccessTokenChanged: logic.updateEvents() - onCalendarIdListChanged: logic.updateEvents() - onEnabledCalendarPluginsChanged: logic.updateEvents() - onTasklistIdListChanged: logic.updateEvents() - onGoogleEventClickActionChanged: logic.updateEvents() + function onAccessTokenChanged() { + logic.updateEvents() + } + function onCalendarIdListChanged() { + logic.updateEvents() + } + function onEnabledCalendarPluginsChanged() { + logic.updateEvents() + } + function onTasklistIdListChanged() { + logic.updateEvents() + } + function onGoogleEventClickActionChanged() { + logic.updateEvents() + } //--- Weather - onWeatherServiceChanged: logic.resetWeatherAndUpdate() - onOpenWeatherMapAppIdChanged: logic.resetWeatherAndUpdate() - onOpenWeatherMapCityIdChanged: logic.resetWeatherAndUpdate() - onWeatherCanadaCityIdChanged: logic.resetWeatherAndUpdate() - onWeatherUnitsChanged: logic.updateWeather(true) - onWidgetShowMeteogramChanged: { + function onWeatherServiceChanged() { + logic.resetWeatherAndUpdate() + } + function onOpenWeatherMapAppIdChanged() { + logic.resetWeatherAndUpdate() + } + function onOpenWeatherMapCityIdChanged() { + logic.resetWeatherAndUpdate() + } + function onWeatherCanadaCityIdChanged() { + logic.resetWeatherAndUpdate() + } + function onWeatherUnitsChanged() { + logic.updateWeather(true) + } + function onWidgetShowMeteogramChanged() { if (plasmoid.configuration.widgetShowMeteogram) { logic.updateHourlyWeather() } } //--- UI - onAgendaBreakupMultiDayEventsChanged: popup.updateUI() - onMeteogramHoursChanged: popup.updateMeteogram() + function onAgendaBreakupMultiDayEventsChanged() { + popup.updateUI() + } + function onMeteogramHoursChanged() { + popup.updateMeteogram() + } } //--- Connections { target: appletConfig - onClock24hChanged: popup.updateUI() + function onClock24hChanged() { + popup.updateUI() + } } //--- @@ -206,7 +232,7 @@ Item { } Connections { target: eventModel - onError: { + function onError() { logic.currentErrorMessage = msg logic.currentErrorType = errorType if (popup) popup.showError(logic.currentErrorMessage) @@ -216,24 +242,24 @@ Item { //--- Connections { target: eventModel - onCalendarFetched: { + function onCalendarFetched() { logger.debug('onCalendarFetched', calendarId) // logger.debug('onCalendarFetched', calendarId, JSON.stringify(data, null, '\t')) if (popup) popup.deferredUpdateUI() } - onAllDataFetched: { + function onAllDataFetched() { logger.debug('onAllDataFetched') if (popup) popup.deferredUpdateUI() } - onEventCreated: { + function onEventCreated() { logger.logJSON('onEventCreated', calendarId, data) if (popup) popup.deferredUpdateUI() } - onEventUpdated: { + function onEventUpdated() { logger.logJSON('onEventUpdated', calendarId, eventId, data) if (popup) popup.deferredUpdateUI() } - onEventDeleted: { + function onEventDeleted() { logger.logJSON('onEventDeleted', calendarId, eventId, data) if (popup) popup.deferredUpdateUI() } @@ -242,7 +268,7 @@ Item { //--- Connections { target: networkMonitor - onIsConnectedChanged: { + function onIsConnectedChanged() { if (networkMonitor.isConnected) { if (logic.currentErrorType == ErrorType.NetworkError) { logic.clearError() diff --git a/package/contents/ui/MeteogramView.qml b/package/contents/ui/MeteogramView.qml index e5594b83..52e53387 100644 --- a/package/contents/ui/MeteogramView.qml +++ b/package/contents/ui/MeteogramView.qml @@ -35,11 +35,21 @@ Item { Connections { target: appletConfig - onMeteogramTextColorChanged: graph.update() - onMeteogramScaleColorChanged: graph.update() - onMeteogramPositiveTempColorChanged: graph.update() - onMeteogramNegativeTempColorChanged: graph.update() - onMeteogramPrecipitationRawColorChanged: graph.update() + function onMeteogramTextColorChanged() { + graph.update() + } + function onMeteogramScaleColorChanged() { + graph.update() + } + function onMeteogramPositiveTempColorChanged() { + graph.update() + } + function onMeteogramNegativeTempColorChanged() { + graph.update() + } + function onMeteogramPrecipitationRawColorChanged() { + graph.update() + } } Item { @@ -201,7 +211,7 @@ Item { for (var i = 1; i < path.length - 2; i++) { var xc = (gridPath[i].x + gridPath[i+1].x) / 2 var yc = (gridPath[i].y + gridPath[i+1].y) / 2 - + context.quadraticCurveTo(gridPath[i].x, gridPath[i].y, xc, yc) } var n = path.length-1 @@ -285,7 +295,7 @@ Item { if (i === 0 || item.y < pathMinY) pathMinY = item.y if (i === 0 || item.y > pathMaxY) pathMaxY = item.y } - + var pZeroY = graph.gridPoint(0, graph.freezingPoint).y var pMaxY = graph.gridPoint(0, pathMinY).y // y axis gets flipped var pMinY = graph.gridPoint(0, pathMaxY).y // y axis gets flipped @@ -373,7 +383,7 @@ Item { // context.strokeText(labelText, graph.gridX2, graph.gridY + 6) // context.fillText(labelText, graph.gridX2, graph.gridY + 6) // } - + // Area graph.updateGridItemAreas() @@ -384,7 +394,7 @@ Item { } - + Repeater { id: gridDataAreas anchors.fill: parent diff --git a/package/contents/ui/PopupView.qml b/package/contents/ui/PopupView.qml index bf7515d2..03615e3d 100644 --- a/package/contents/ui/PopupView.qml +++ b/package/contents/ui/PopupView.qml @@ -84,7 +84,7 @@ MouseArea { Connections { target: monthView - onDateSelected: { + function onDateSelected() { // logger.debug('onDateSelected', selectedDate) scrollToSelection() } diff --git a/package/contents/ui/TimeFormatSizeHelper.qml b/package/contents/ui/TimeFormatSizeHelper.qml index 8ba6f58b..9ca8e6f9 100644 --- a/package/contents/ui/TimeFormatSizeHelper.qml +++ b/package/contents/ui/TimeFormatSizeHelper.qml @@ -73,16 +73,26 @@ Item { Connections { target: clock - onWidthChanged: timeFormatSizeHelper.updateMinWidth() - onHeightChanged: timeFormatSizeHelper.updateMinWidth() + function onWidthChanged() { + timeFormatSizeHelper.updateMinWidth() + } + function onHeightChanged() { + timeFormatSizeHelper.updateMinWidth() + } } Connections { target: timeLabel - onHeightChanged: timeFormatSizeHelper.updateMinWidth() - onTimeFormatChanged: timeFormatSizeHelper.updateMinWidth() + function onHeightChanged() { + timeFormatSizeHelper.updateMinWidth() + } + function onTimeFormatChanged() { + timeFormatSizeHelper.updateMinWidth() + } } Connections { target: timeModel - onDateChanged: timeFormatSizeHelper.updateMinWidth() + function onDateChanged() { + timeFormatSizeHelper.updateMinWidth() + } } } diff --git a/package/contents/ui/TimerView.qml b/package/contents/ui/TimerView.qml index 5911b9ec..a5b909dc 100644 --- a/package/contents/ui/TimerView.qml +++ b/package/contents/ui/TimerView.qml @@ -106,7 +106,7 @@ Item { } } } - + ColumnLayout { id: toggleButtonColumn Layout.alignment: Qt.AlignBottom @@ -118,7 +118,7 @@ Item { text: "Test" visible: false } - + PlasmaComponents3.ToolButton { id: timerRepeatsButton readonly property bool isChecked: plasmoid.configuration.timerRepeats // New property to avoid checked=pressed theming. @@ -153,7 +153,7 @@ Item { } } } - + } RowLayout { @@ -212,7 +212,7 @@ Item { Connections { target: timerModel - onSecondsLeftChanged: { + function onSecondsLeftChanged() { timerLabel.text = timerModel.formatTimer(timerModel.secondsLeft) } } diff --git a/package/contents/ui/UpcomingEvents.qml b/package/contents/ui/UpcomingEvents.qml index b1603793..c5cf7ad7 100644 --- a/package/contents/ui/UpcomingEvents.qml +++ b/package/contents/ui/UpcomingEvents.qml @@ -211,7 +211,7 @@ CalendarManager { Connections { target: eventModel - onAllDataFetched: { + function onAllDataFetched() { logger.debug('upcomingEvents eventModel.onAllDataFetched', eventModel.dateMin, timeModel.currentTime, eventModel.dateMax) // if data is from current month if (eventModel.dateMin <= timeModel.currentTime && timeModel.currentTime <= eventModel.dateMax) { @@ -227,6 +227,8 @@ CalendarManager { Connections { target: timeModel - onMinuteChanged: upcomingEvents.tick() + function onMinuteChanged() { + upcomingEvents.tick() + } } } diff --git a/package/contents/ui/calendars/PlasmaCalendarManager.qml b/package/contents/ui/calendars/PlasmaCalendarManager.qml index 7ba05940..80a0cdab 100644 --- a/package/contents/ui/calendars/PlasmaCalendarManager.qml +++ b/package/contents/ui/calendars/PlasmaCalendarManager.qml @@ -106,7 +106,7 @@ CalendarManager { } Connections { target: plasmoid.configuration - onEnabledCalendarPluginsChanged: { + function onEnabledCalendarPluginsChanged() { PlasmaCalendarUtils.setEnabledPluginsByFilename(PlasmaCalendar.EventPluginsManager, plasmoid.configuration.enabledCalendarPlugins) } } @@ -169,7 +169,7 @@ CalendarManager { var endDateTime = new Date(Shared.isValidDate(dayItem.endDateTime) ? dayItem.endDateTime : day) // logger.log('\t startDateTime', dayItem.startDateTime, startDateTime) // logger.log('\t endDateTime', dayItem.endDateTime, endDateTime) - + if (dayItem.isAllDay) { start.date = Shared.localeDateString(startDateTime) // 2018-01-31 // Google Calendar has the event start at midnight, and end at midnight the next day @@ -224,7 +224,7 @@ CalendarManager { calendarBackend.displayedDate = middleDay var items = [] - + // 2018-05-24T00:00:00.000Z var dateMinUtcStr = Shared.localeDateString(dateMin) + 'T00:00:00.000Z' var dateMinUtc = new Date(dateMinUtcStr) diff --git a/package/contents/ui/config/ConfigTimezones.qml b/package/contents/ui/config/ConfigTimezones.qml index bad34c9e..00fe60f3 100644 --- a/package/contents/ui/config/ConfigTimezones.qml +++ b/package/contents/ui/config/ConfigTimezones.qml @@ -80,7 +80,7 @@ ColumnLayout { // ConfigPage creates a binding loop when a child uses fillHeight Connections { target: timeZoneView - onToggleCurrent: { + function onToggleCurrent() { if (styleData.row === timeZoneView.currentRow) { checkBox.setValue(!checkBox.checked) } diff --git a/package/contents/ui/config/OpenWeatherMapCityDialog.qml b/package/contents/ui/config/OpenWeatherMapCityDialog.qml index 72b3a028..996f2832 100644 --- a/package/contents/ui/config/OpenWeatherMapCityDialog.qml +++ b/package/contents/ui/config/OpenWeatherMapCityDialog.qml @@ -27,14 +27,14 @@ Dialog { // sourceModel: cityListModel // Link after populating cityListModel so the UI doesn't freeze. filterRole: 'name' sortRole: 'name' - sortCaseSensitivity: Qt.CaseInsensitive + sortCaseSensitivity: Qt.CaseInsensitive } property string selectedCityId: '' Connections { target: tableView.selection - - onSelectionChanged: { + + function onSelectionChanged() { tableView.selection.forEach(function(row) { var city = filteredCityListModel.get(row) chooseCityDialog.selectedCityId = city.id @@ -44,8 +44,8 @@ Dialog { } Connections { target: filteredCityListModel - - onFilterRegExpChanged: { + + function onFilterRegExpChanged() { tableView.selection.clear() chooseCityDialog.selectedCityId = '' } @@ -143,7 +143,7 @@ Dialog { // link after populating so that each append() doesn't attempt to rebuild the UI. filteredCityListModel.sourceModel = cityListModel - + chooseCityDialog.loadingCityList = false }) } @@ -151,7 +151,7 @@ Dialog { function fetchCityList(args, callback) { if (!args.appId) return callback('OpenWeatherMap AppId not set') - + var url = 'https://api.openweathermap.org/data/2.5/' url += 'find?q=' + encodeURIComponent(args.q) url += '&type=like' diff --git a/package/contents/ui/config/WeatherCanadaCityDialog.qml b/package/contents/ui/config/WeatherCanadaCityDialog.qml index 79af513d..fe37362b 100644 --- a/package/contents/ui/config/WeatherCanadaCityDialog.qml +++ b/package/contents/ui/config/WeatherCanadaCityDialog.qml @@ -25,14 +25,14 @@ Dialog { sourceModel: emptyListModel filterRole: 'name' sortRole: 'name' - sortCaseSensitivity: Qt.CaseInsensitive + sortCaseSensitivity: Qt.CaseInsensitive } property string selectedCityId: '' Connections { target: tableView.selection - - onSelectionChanged: { + + function onSelectionChanged() { tableView.selection.forEach(function(row) { var city = filteredCityListModel.get(row) chooseCityDialog.selectedCityId = city.id @@ -42,8 +42,8 @@ Dialog { } Connections { target: filteredCityListModel - - onFilterRegExpChanged: { + + function onFilterRegExpChanged() { tableView.selection.clear() chooseCityDialog.selectedCityId = '' } @@ -83,7 +83,7 @@ Dialog { onCurrentIndexChanged: loadProvinceCityList() } } - + TextField { id: cityNameInput Layout.fillWidth: true @@ -142,10 +142,10 @@ Dialog { for (var i = 0; i < cityList.length; i++) { cityListModel.append(cityList[i]) } - + // link after populating so that each append() doesn't attempt to rebuild the UI. filteredCityListModel.sourceModel = cityListModel - + chooseCityDialog.cityListLoaded = true chooseCityDialog.loadingCityList = false }) @@ -157,7 +157,7 @@ Dialog { if (provinceTabView.currentIndex >= 0) { provinceId = provinceIdList[provinceTabView.currentIndex] } - + var provinceUrl = 'https://weather.gc.ca/forecast/canada/index_e.html?id=' + provinceId loadCityList(provinceUrl) } diff --git a/package/contents/ui/lib/AppletVersion.qml b/package/contents/ui/lib/AppletVersion.qml index b61caf5e..64a800f3 100644 --- a/package/contents/ui/lib/AppletVersion.qml +++ b/package/contents/ui/lib/AppletVersion.qml @@ -31,7 +31,7 @@ Item { Connections { target: executable - onExited: { + function onExited() { version = stdout.replace('\n', ' ').trim() } } diff --git a/package/contents/ui/lib/ConfigAdvanced.qml b/package/contents/ui/lib/ConfigAdvanced.qml index 2c8715a0..05a53a56 100644 --- a/package/contents/ui/lib/ConfigAdvanced.qml +++ b/package/contents/ui/lib/ConfigAdvanced.qml @@ -152,10 +152,10 @@ ColumnLayout { return stringControl } } - + } } - + } } } @@ -285,7 +285,7 @@ ColumnLayout { } var value = plasmoid.configuration[key] - + configTableModel.append({ key: key, valueType: typeof value, @@ -301,7 +301,7 @@ ColumnLayout { Connections { target: configDefaults - onUpdated: { + function onUpdated() { var keys = configTableModel.keys // Assume the default main.xml's order and plasmoid.configuration is the same (we probably shouldn't). for (var i = 0; i < keys.length; i++) { @@ -330,7 +330,7 @@ ColumnLayout { Connections { target: plasmoid.configuration - onValueChanged: { + function onValueChanged() { var keyIndex = configTableModel.keys.indexOf(key) if (keyIndex >= 0) { configTableModel.setProperty(keyIndex, 'value', value) diff --git a/package/contents/ui/main.qml b/package/contents/ui/main.qml index ef221032..a743fdb0 100644 --- a/package/contents/ui/main.qml +++ b/package/contents/ui/main.qml @@ -26,7 +26,7 @@ Item { property alias eventModel: eventModel property alias agendaModel: agendaModel - + TimeModel { id: timeModel } TimerModel { id: timerModel } EventModel { id: eventModel } @@ -177,7 +177,7 @@ Item { Connections { target: timeModel - onDateChanged: { + function onDateChanged() { popup.updateToday() logger.debug('root.onDateChanged', timeModel.currentTime, popup.today) }