D8983: Properly parse dates in cookies when running in non-English locale
Anthony Fieroni
noreply at phabricator.kde.org
Sun Nov 26 05:29:42 UTC 2017
anthonyfieroni added inline comments.
INLINE COMMENTS
> kcookiejar.cpp:78-84
> + static const char *const day_name[] = {
> + "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"
> + };
> + for (int i = 0; i < 7; ++i) {
> + // No need to check for long names since the short names are
> + // prefixes of the long names
> + if (weekday.startsWith(QL1S(day_name[i]), Qt::CaseInsensitive)) {
You can use not predefined days name
QLocale locale = QLocale::c();
for (int i = 1; i < 8; ++i) {
if (weekday.startsWith(locale.dayName(i, QLocale::ShortFormat), Qt::CaseInsensitive)) {
REPOSITORY
R241 KIO
REVISION DETAIL
https://phabricator.kde.org/D8983
To: schwab, dfaure, #frameworks
Cc: anthonyfieroni, #frameworks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20171126/e404b456/attachment.html>
More information about the Kde-frameworks-devel
mailing list