diff --git a/kmymoney/kmymoney.cpp b/kmymoney/kmymoney.cpp --- a/kmymoney/kmymoney.cpp +++ b/kmymoney/kmymoney.cpp @@ -1696,17 +1696,9 @@ d->m_backupState = BACKUP_IDLE; QLocale locale; - int weekStart = locale.firstDayOfWeek(); - int weekEnd = weekStart-1; - if (weekEnd < Qt::Monday) { - weekEnd = Qt::Sunday; - } - bool startFirst = (weekStart < weekEnd); - for (int i = 0; i < 8; ++i) { - if (startFirst) - d->m_processingDays.setBit(i, (i >= weekStart && i <= weekEnd)); - else - d->m_processingDays.setBit(i, (i >= weekStart || i <= weekEnd)); + for (auto const& weekDay: locale.weekdays()) + { + d->m_processingDays.setBit(static_cast(weekDay)); } d->m_autoSaveTimer = new QTimer(this); d->m_progressTimer = new QTimer(this); @@ -4221,9 +4213,9 @@ bool KMyMoneyApp::isProcessingDate(const QDate& date) const { -#ifdef KF5Holidays_FOUND if (!d->m_processingDays.testBit(date.dayOfWeek())) return false; +#ifdef KF5Holidays_FOUND if (!d->m_holidayRegion || !d->m_holidayRegion->isValid()) return true; @@ -4236,7 +4228,6 @@ return processingDay; } #else - Q_UNUSED(date); return true; #endif } diff --git a/kmymoney/mymoney/mymoneyschedule.cpp b/kmymoney/mymoney/mymoneyschedule.cpp --- a/kmymoney/mymoney/mymoneyschedule.cpp +++ b/kmymoney/mymoney/mymoneyschedule.cpp @@ -1534,6 +1534,7 @@ if (processingCalendarPtr) return processingCalendarPtr->isProcessingDate(date); + /// @todo test against m_processingDays instead? (currently only for tests) return date.dayOfWeek() < Qt::Saturday; } diff --git a/kmymoney/mymoney/tests/mymoneyschedule-test.cpp b/kmymoney/mymoney/tests/mymoneyschedule-test.cpp --- a/kmymoney/mymoney/tests/mymoneyschedule-test.cpp +++ b/kmymoney/mymoney/tests/mymoneyschedule-test.cpp @@ -1587,6 +1587,8 @@ void MyMoneyScheduleTest::testProcessingDates() { + /// @todo extend test to cover application usage (with a processing calendar defined) ? + // There should be no processing calendar defined so // make sure fall back works