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>bb10
parent
eec2d5e68a
commit
2ecd95bbe9
|
|
@ -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();
|
||||
}
|
||||
|
||||
//////////////////////////////////
|
||||
|
|
|
|||
Loading…
Reference in New Issue