Skip to content

Commit

Permalink
Don't use Qt's old foreach any more
Browse files Browse the repository at this point in the history
  • Loading branch information
pcolby committed Apr 9, 2023
1 parent 1b1e832 commit 9220eee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
18 changes: 5 additions & 13 deletions qnetworkaccessmanager.patch
@@ -1,15 +1,6 @@
--- ./qtbase/src/network/access/qnetworkaccessmanager.cpp 2020-09-02 20:15:07.000000000 +1000
+++ ./qtbase/src/network/access/qnetworkaccessmanager.new 2022-12-27 17:17:28.577375419 +1100
@@ -95,6 +95,8 @@

#include "qnetconmonitor_p.h"

+#include "QtCore/qstandardpaths.h"
+
QT_BEGIN_NAMESPACE

Q_GLOBAL_STATIC(QNetworkAccessFileBackendFactory, fileBackend)
@@ -876,6 +878,67 @@
--- ./qtbase/src/network/access/qnetworkaccessmanager.cpp 2020-10-27 19:02:11.000000000 +1100
+++ ./qtbase/src/network/access/qnetworkaccessmanager.new 2023-04-09 14:13:32.503075064 +1000
@@ -876,6 +876,68 @@
*/
QNetworkReply *QNetworkAccessManager::post(const QNetworkRequest &request, QIODevice *data)
{
Expand All @@ -31,7 +22,8 @@
+ .arg(QDateTime::currentDateTime().toString())
+ .arg(QDir::toNativeSeparators(dataDir.absolutePath())).toUtf8());
+ dataDir.mkpath(fileName);
+ Q_FOREACH (const QChar &c, urlPath.startsWith(QLatin1Char('/')) ? urlPath.mid(1) : urlPath) {
+ const QString trimmedUrlPath = urlPath.startsWith(QLatin1Char('/')) ? urlPath.mid(1) : urlPath;
+ for (const QChar &c: trimmedUrlPath) {
+ fileName += (c.isLetterOrNumber()) ? c : QChar::fromLatin1('-');
+ }
+ debug.write(QString::fromLatin1("%1 fileName %2\r")
Expand Down
2 changes: 1 addition & 1 deletion update-diff.sh
Expand Up @@ -3,7 +3,7 @@
set -o errexit -o noclobber -o nounset -o pipefail # or set -Ceuo pipefail
shopt -s inherit_errexit

: "${QT_VERSION:=5.15.1}" # The version used by Polar FlowSync.
: "${QT_VERSION:=5.15.2}" # The version used by Polar FlowSync.
: "${QT_NAME:=qt-everywhere-src-$QT_VERSION}"
: "${SCRIPT_DIR:="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"}"
: "${OUTPUT_DIR:=$SCRIPT_DIR}"
Expand Down

0 comments on commit 9220eee

Please sign in to comment.