From 057329c24c00047c8c3e1502a9a8dfa9a4169481 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Tue, 23 Jun 2020 12:40:55 +0200 Subject: Make feature datetimeparser depend on feature datestring MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit No client of QDateTimeParser actually uses it unless datestring was enabled, nor is it any use without datestring. Various methods conditioned on datestring are broken unless datetimeparser is enabled. We can't condition public API on datetimeparser, as it's a private feature, but client code can condition use of it on the private feature. All string-to-date/time conversions that use a string format (this includes all locale-specific formats) depend on feature datetimeparser. Change #if-ery (or add it) in all client (including test) code to test the right feature. Tidied up some code in the process. Killed some already-redundant textdate #if-ery. Renamed a test whose name claimed it involved locale, which it doesn't, in the course of #if-ing it. This simplifies the condition for feature datetimeedit (which overtly depended on textdate, redundantly since it depends on datestring which depends on textdate; its dependence on datetimeparser now makes its dependency on datestring also redundant). It also removes the need for assorted datestring checks in QDateTimeParser itself. Change-Id: I5dfe3a977042134b2cfb16cbcc795070634e7adf Reviewed-by: MÃ¥rten Nordheim --- src/network/access/qnetworkaccessftpbackend.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/network/access/qnetworkaccessftpbackend.cpp') diff --git a/src/network/access/qnetworkaccessftpbackend.cpp b/src/network/access/qnetworkaccessftpbackend.cpp index 7f5439a16e..7c353b5c47 100644 --- a/src/network/access/qnetworkaccessftpbackend.cpp +++ b/src/network/access/qnetworkaccessftpbackend.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtNetwork module of the Qt Toolkit. @@ -424,7 +424,7 @@ void QNetworkAccessFtpBackend::ftpRawCommandReply(int code, const QString &text) if (id == sizeId) { // reply to the size command setHeader(QNetworkRequest::ContentLengthHeader, text.toLongLong()); -#if QT_CONFIG(datestring) +#if QT_CONFIG(datetimeparser) } else if (id == mdtmId) { QDateTime dt = QDateTime::fromString(text, QLatin1String("yyyyMMddHHmmss")); setHeader(QNetworkRequest::LastModifiedHeader, dt); -- cgit v1.2.3