diff options
author | Kirill Burtsev <kirill.burtsev@qt.io> | 2021-11-30 13:01:39 +0100 |
---|---|---|
committer | Kirill Burtsev <kirill.burtsev@qt.io> | 2022-01-02 22:35:31 +0100 |
commit | 02d58a067fb5f0db32c254e783170f9f283aeb9d (patch) | |
tree | d9f0f4ac82ff976d1e4f59caa1d0e29ecd48dcc8 /tests/auto/core/origins/tst_origins.cpp | |
parent | 1552ad5d3e66460bbbb5bbd71ca2083fb9d17d3f (diff) |
Cleanup code and clang build warnings
Fix build noise as reported by clang for issues like api deprecation,
unused variables, sign/unsigned mismatch and other non critical issues.
Pick-to: 6.2
Change-Id: I4fba25406eea8170e3283c42e908ae86bd512e3a
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'tests/auto/core/origins/tst_origins.cpp')
-rw-r--r-- | tests/auto/core/origins/tst_origins.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/auto/core/origins/tst_origins.cpp b/tests/auto/core/origins/tst_origins.cpp index ac937037f..1731bee8a 100644 --- a/tests/auto/core/origins/tst_origins.cpp +++ b/tests/auto/core/origins/tst_origins.cpp @@ -200,8 +200,9 @@ private: if (url.path().startsWith("/qtwebchannel/")) pathPrefix = QSL(":"); QString pathSuffix = url.path(); - QFile *file = new QFile(pathPrefix + pathSuffix, job); + auto file = std::make_unique<QFile>(pathPrefix + pathSuffix, job); if (!file->open(QIODevice::ReadOnly)) { + qWarning() << "Failed to read data for:" << url << file->errorString(); job->fail(QWebEngineUrlRequestJob::RequestFailed); return; } @@ -210,7 +211,7 @@ private: mimeType = QBAL("application/javascript"); else if (pathSuffix.endsWith(QSL(".css"))) mimeType = QBAL("text/css"); - job->reply(mimeType, file); + job->reply(mimeType, file.release()); } QList<QUrl> m_requests; |