Otherwise when the week starts on a day other than Sunday or Monday we access invalid day names.
BUG: 390330
Zren |
Plasma |
Otherwise when the week starts on a day other than Sunday or Monday we access invalid day names.
BUG: 390330
TIL there's locales where weeks start on a Saturday :)
Ran LC_TIME=ar_EG plasmawindowed org.kde.plasma.digitalclock and hat all weekdays shown properly. Previously it would only show Saturday and Sunday headings
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
Nice thinking on using repeater.count instead of the hardcoded 7!
Hmm, was worried days.count would trigger onCountChanged every time a delegate is made (count=1, count=2, etc), but it seems that the delegate.text is only calculated twice (delegate creation and after onCountChanged=7).
For reference, before the patch, it only calculates the delegate.text once. Using a hardcoded 7 also only calls it once, but it's bad practice to have magic numbers. I assume it won't reattempt to render the labels since the text didn't change.
Thanks for doing the patch broulik.
qml: days.count 0 Both point size and pixel size set. Using pixel size. qml: days.delegate.text 0 Sun Both point size and pixel size set. Using pixel size. qml: days.delegate.text 1 Mon Both point size and pixel size set. Using pixel size. qml: days.delegate.text 2 Tue Both point size and pixel size set. Using pixel size. qml: days.delegate.text 3 Wed Both point size and pixel size set. Using pixel size. qml: days.delegate.text 4 Thu Both point size and pixel size set. Using pixel size. qml: days.delegate.text 5 Fri Both point size and pixel size set. Using pixel size. qml: days.delegate.text 6 Sat Both point size and pixel size set. Using pixel size. qml: days.count 7 qml: days.delegate.text 0 Sun qml: days.delegate.text 1 Mon qml: days.delegate.text 2 Tue qml: days.delegate.text 3 Wed qml: days.delegate.text 4 Thu qml: days.delegate.text 5 Fri qml: days.delegate.text 6 Sat
Repeater { id: days onCountChanged: console.log('days.count', count) Components.Label { text: { var s = Qt.locale(Qt.locale().uiLanguages[0]).dayName((calendarBackend.firstDayOfWeek + index) % 7, Locale.ShortFormat) console.log('days.delegate.text', index, s) return s }