From 430e733c0db335e4056bc1dc56f4446e84aea49a Mon Sep 17 00:00:00 2001 From: Dominik Schmidt Date: Thu, 15 Nov 2012 13:05:21 +0100 Subject: [PATCH] Build with QT_STRICT_ITERATORS --- CMakeLists.txt | 2 ++ .../qxt/qxtweb-standalone/qxtweb/qxtwebcgiservice.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 72314edf2..8985802c6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,6 +19,8 @@ SET( TOMAHAWK_VERSION_PATCH 99 ) # enforce proper symbol exporting on all platforms add_definitions( "-fvisibility=hidden" ) +# enforce using constBegin, constEnd for const-iterators +add_definitions( "-DQT_STRICT_ITERATORS" ) # build options option(BUILD_GUI "Build Tomahawk with GUI" ON) diff --git a/thirdparty/qxt/qxtweb-standalone/qxtweb/qxtwebcgiservice.cpp b/thirdparty/qxt/qxtweb-standalone/qxtweb/qxtwebcgiservice.cpp index c522554e0..4ddc00c7e 100644 --- a/thirdparty/qxt/qxtweb-standalone/qxtweb/qxtwebcgiservice.cpp +++ b/thirdparty/qxt/qxtweb-standalone/qxtweb/qxtwebcgiservice.cpp @@ -212,8 +212,8 @@ void QxtWebCgiService::pageRequestedEvent(QxtWebRequestEvent* event) env["QUERY_STRING"] = event->url.encodedQuery(); // Populate HTTP header environment variables - QMultiHash::const_iterator iter = event->headers.begin(); - while (iter != event->headers.end()) + QMultiHash::const_iterator iter = event->headers.constBegin(); + while (iter != event->headers.constEnd()) { QString key = "HTTP_" + iter.key().toUpper().replace('-', '_'); if (key != "HTTP_CONTENT_TYPE" && key != "HTTP_CONTENT_LENGTH") @@ -222,9 +222,9 @@ void QxtWebCgiService::pageRequestedEvent(QxtWebRequestEvent* event) } // Populate HTTP_COOKIE parameter - iter = event->cookies.begin(); + iter = event->cookies.constBegin(); QString cookies; - while (iter != event->cookies.end()) + while (iter != event->cookies.constEnd()) { if (!cookies.isEmpty()) cookies += "; ";