From 94cf203f36deb5b46d47197d31b780de5f464937 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 13 Jul 2017 17:19:49 +0200 Subject: Use QSharedPointer::create() more MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is the result of running the (experimental) clang-tidy check qt-modernize-qsharedpointer-create Discarded changes: - tst_qsharedpointer.cpp: not sure we want these replacements there (→ separate change) - tst_collations.cpp: hit in a template specialization that is instantiated with both QSharedPointer and QSharedDataPointer. Change-Id: I203c2646e91d026735d923473af3d151d19e3820 Reviewed-by: Thiago Macieira --- tests/auto/corelib/io/qabstractfileengine/tst_qabstractfileengine.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/auto/corelib/io/qabstractfileengine/tst_qabstractfileengine.cpp') diff --git a/tests/auto/corelib/io/qabstractfileengine/tst_qabstractfileengine.cpp b/tests/auto/corelib/io/qabstractfileengine/tst_qabstractfileengine.cpp index dba920d1f7..ddfd14550b 100644 --- a/tests/auto/corelib/io/qabstractfileengine/tst_qabstractfileengine.cpp +++ b/tests/auto/corelib/io/qabstractfileengine/tst_qabstractfileengine.cpp @@ -466,7 +466,7 @@ protected: if (create) { QSharedPointer &p = fileSystem[fileName_]; if (p.isNull()) - p = QSharedPointer(new File); + p = QSharedPointer::create(); return p; } @@ -564,7 +564,7 @@ class FileEngineHandler void tst_QAbstractFileEngine::initTestCase() { m_previousCurrent = QDir::currentPath(); - m_currentDir = QSharedPointer(new QTemporaryDir()); + m_currentDir = QSharedPointer::create(); QVERIFY2(!m_currentDir.isNull(), qPrintable("Could not create current directory.")); QDir::setCurrent(m_currentDir->path()); } -- cgit v1.2.3