diff options
author | Hannah von Reth <hannah.vonreth@owncloud.com> | 2021-06-30 11:29:39 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-30 11:29:39 +0300 |
commit | 8ea0cf72882ae80b1557e419ac6b3a102369360a (patch) | |
tree | d0e191e622422565bba06caa8b2ab0182de0336c | |
parent | 06f28a74433a461c5796765f08ade0491b4e1781 (diff) | |
parent | f6ef04addfceee0ee3acbebb143aeb58d2ab132d (diff) |
Merge pull request #27 from dschmidt/work/no_q_forach
Dont use Q_FOREACH
-rw-r--r-- | CMakeLists.txt | 3 | ||||
-rw-r--r-- | src/libcrashreporter-gui/CrashReporter.cpp | 12 |
2 files changed, 9 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 9861aa6..43fa720 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,9 @@ option(ENABLE_GPL_CODE "Enable GPL-licensed depencencies of libcrashreporter-qt option(ENABLE_CRASH_REPORTER "Enable libcrashreporter-qt GUI component" ON) find_package(Qt5 COMPONENTS Core Network Widgets) +add_definitions( + -DQT_NO_FOREACH +) if((CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_FLAGS) OR (UNIX AND NOT APPLE AND CMAKE_CXX_COMPILER_ID MATCHES "Clang")) diff --git a/src/libcrashreporter-gui/CrashReporter.cpp b/src/libcrashreporter-gui/CrashReporter.cpp index 9f8891d..b419265 100644 --- a/src/libcrashreporter-gui/CrashReporter.cpp +++ b/src/libcrashreporter-gui/CrashReporter.cpp @@ -227,16 +227,16 @@ CrashReporter::send() QByteArray body; - foreach (const QByteArray& name, m_formContents.keys() ) + for(auto it = m_formContents.cbegin(); it != m_formContents.cend(); ++it) { body += "--thkboundary\r\n"; - body += "Content-Disposition: form-data; name=\"" + name + "\""; + body += "Content-Disposition: form-data; name=\"" + it.key() + "\""; - if ( !m_formFileNames.value( name ).isEmpty() && !m_formContentTypes.value( name ).isEmpty() ) + if ( !m_formFileNames.value( it.key() ).isEmpty() && !m_formContentTypes.value( it.key() ).isEmpty() ) { - body += "; filename=\"" + m_formFileNames.value( name ) + "\"\r\n"; - body += "Content-Type: " + m_formContentTypes.value( name ) + "\r\n"; + body += "; filename=\"" + m_formFileNames.value( it.key() ) + "\"\r\n"; + body += "Content-Type: " + m_formContentTypes.value( it.key() ) + "\r\n"; } else { @@ -245,7 +245,7 @@ CrashReporter::send() body += "\r\n"; - body += m_formContents.value( name ) + "\r\n"; + body += it.value() + "\r\n"; } body += "--thkboundary\r\n"; |