Git commit 324a995d48681aad382fc1fd6abab5b13b633904 by Cristian One=C8=9B. Committed on 22/06/2016 at 16:23. Pushed by conet into branch 'master'. Port some TODOs involving the first day of the week. M +2 -4 kmymoney/reports/pivottable.cpp M +3 -4 kmymoney/widgets/register.cpp http://commits.kde.org/kmymoney/324a995d48681aad382fc1fd6abab5b13b633904 diff --git a/kmymoney/reports/pivottable.cpp b/kmymoney/reports/pivottable.= cpp index e1ac131..86a166e 100644 --- a/kmymoney/reports/pivottable.cpp +++ b/kmymoney/reports/pivottable.cpp @@ -418,10 +418,9 @@ void PivotTable::collapseColumns() = int columnpitch =3D m_config_f.columnPitch(); if (columnpitch !=3D 1) { - // TODO: port to kf5 int sourcemonth =3D (m_config_f.isColumnsAreDays()) // use the user's locale to determine the week's sta= rt - ? (m_beginDate.dayOfWeek() + 8 - 1/*KLocale::global(= )->weekStartDay()*/) % 7 + ? (m_beginDate.dayOfWeek() + 8 - QLocale().firstDayO= fWeek()) % 7 : m_beginDate.month(); int sourcecolumn =3D 1; int destcolumn =3D 1; @@ -533,8 +532,7 @@ void PivotTable::calculateColumnHeadings() QDate prv =3D m_beginDate; = // use the user's locale to determine the week's start - // TODO: port to kf5 - int dow =3D (day.dayOfWeek() + 8 - 1/*KLocale::global()->weekStartDa= y()*/) % 7; + int dow =3D (day.dayOfWeek() + 8 - QLocale().firstDayOfWeek()) % 7; = while (day <=3D m_endDate) { if (((dow % columnpitch) =3D=3D 0) || (day =3D=3D m_endDate)) { diff --git a/kmymoney/widgets/register.cpp b/kmymoney/widgets/register.cpp index 2e982d7..b2751c4 100644 --- a/kmymoney/widgets/register.cpp +++ b/kmymoney/widgets/register.cpp @@ -1954,10 +1954,9 @@ void Register::addGroupMarkers() thisMonth.setDate(today.year(), today.month(), 1); lastMonth =3D thisMonth.addMonths(-1); yesterday =3D today.addDays(-1); - // a =3D QDate::dayOfWeek() todays weekday (1 =3D Monday, 7 =3D= Sunday) - // b =3D KLocale::weekStartDay() first day of week (1 =3D Monday, 7 = =3D Sunday) - // TODO: prt this to kf5 - weekStartOfs =3D today.dayOfWeek() - 1;//KLocale::global()->weekStar= tDay(); + // a =3D QDate::dayOfWeek() todays weekday (1 =3D Monday, 7 = =3D Sunday) + // b =3D QLocale().firstDayOfWeek() first day of week (1 =3D Monday,= 7 =3D Sunday) + weekStartOfs =3D today.dayOfWeek() - QLocale().firstDayOfWeek(); if (weekStartOfs < 0) { weekStartOfs =3D 7 + weekStartOfs; }