diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2016-10-10 20:47:40 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2016-10-12 08:16:34 +0000 |
commit | 2ecd95bbe907cc9199773bb7930f781058735e1c (patch) | |
tree | 8f5f47e891f0550a5c47226d56bcb28d0689ef32 /src/widgets | |
parent | eec2d5e68af7b65342e4e5a95e47481a483be67e (diff) |
QCalendarWidget: fix misleading if-else cascade in QCalendarDayValidator::text()
By the time we hit the last else, its if condition is trivially
true, so don't check it (but leave it as a comment).
Consequently, remove the trailing (dead) return of a default-
constructed QString.
Coverity-Id: 62766
Change-Id: I47e1a49f40e6ec95d29c5052c78bfadb63af3b84
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/widgets/qcalendarwidget.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/widgets/widgets/qcalendarwidget.cpp b/src/widgets/widgets/qcalendarwidget.cpp index 3823b9c10f..7895dc04d9 100644 --- a/src/widgets/widgets/qcalendarwidget.cpp +++ b/src/widgets/widgets/qcalendarwidget.cpp @@ -205,10 +205,9 @@ QString QCalendarDayValidator::text(const QDate &date, int repeat) const return formatNumber(date.day(), 2); } else if (repeat == 3) { return m_locale.dayName(date.dayOfWeek(), QLocale::ShortFormat); - } else if (repeat >= 4) { + } else /* repeat >= 4 */ { return m_locale.dayName(date.dayOfWeek(), QLocale::LongFormat); } - return QString(); } ////////////////////////////////// |