From 075e669cbe3cbbefe66d954e571db227e60eeda7 Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Mon, 27 Feb 2017 10:06:12 +0100 Subject: QHstsPolicy: Replace bool with QFlags As pointed out in the previous code-review: Replace a bool ctor parameter with QFlags to conform to Qt API Design Principles (Boolean Parameter Trap). Since the bool with its many unwanted implicit conversions is gone from the ctor parameter list now, drop the explicit keyword again. It was requested because of the boolean parameter in the first place. Change-Id: Ibaf287a6a3e38c22f033fd5d9e024c54f30a1fd4 Reviewed-by: Marc Mutz --- src/network/access/qhsts.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/network/access/qhsts.cpp') diff --git a/src/network/access/qhsts.cpp b/src/network/access/qhsts.cpp index 3581fbc796..ca9f3b977b 100644 --- a/src/network/access/qhsts.cpp +++ b/src/network/access/qhsts.cpp @@ -110,7 +110,11 @@ void QHstsCache::updateKnownHost(const QString &host, const QDateTime &expires, // IDNA 2003 (RFC3490) for us, as required by HSTS (RFC6797, section 10). const HostName hostName(host); const auto pos = knownHosts.find(hostName); - const QHstsPolicy newPolicy(expires, includeSubDomains, hostName.name); + QHstsPolicy::PolicyFlags flags; + if (includeSubDomains) + flags = QHstsPolicy::IncludeSubDomains; + + const QHstsPolicy newPolicy(expires, flags, hostName.name); if (pos == knownHosts.end()) { // A new, previously unknown host. if (newPolicy.isExpired()) { -- cgit v1.2.3