aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/scanner
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2017-10-12 14:16:57 +0200
committerJoerg Bornemann <joerg.bornemann@qt.io>2017-10-13 08:54:00 +0000
commitf07f07a871179eda9cd97b2830d1437163851605 (patch)
tree9d527d1ba96a5a8881dff12584269b1c7e8c2410 /src/plugins/scanner
parent07fa68a352864f70b7930c996c4b4a7c5d9cd4a7 (diff)
Replace QScopedPointer with std::unique_ptr
Now only one unique pointer class is used. Change-Id: Ic03106d02614f14b120a316c1fbbf27c8caec8f2 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Diffstat (limited to 'src/plugins/scanner')
-rw-r--r--src/plugins/scanner/cpp/cppscanner.cpp8
-rw-r--r--src/plugins/scanner/qt/qtscanner.cpp7
2 files changed, 8 insertions, 7 deletions
diff --git a/src/plugins/scanner/cpp/cppscanner.cpp b/src/plugins/scanner/cpp/cppscanner.cpp
index 2d652b9e2..a29b00e78 100644
--- a/src/plugins/scanner/cpp/cppscanner.cpp
+++ b/src/plugins/scanner/cpp/cppscanner.cpp
@@ -58,10 +58,10 @@ using namespace CPlusPlus;
#include <QtCore/qbytearray.h>
#include <QtCore/qlist.h>
-#include <QtCore/qscopedpointer.h>
#include <QtCore/qstring.h>
#include <cstring>
+#include <memory>
struct ScanResult
{
@@ -203,7 +203,7 @@ static void scanCppFile(void *opaq, CPlusPlus::Lexer &yylex, bool scanForFileTag
static void *openScanner(const unsigned short *filePath, const char *fileTags, int flags)
{
- QScopedPointer<Opaq> opaque(new Opaq);
+ std::unique_ptr<Opaq> opaque(new Opaq);
opaque->fileName = QString::fromUtf16(filePath);
const int fileTagsLength = static_cast<int>(std::strlen(fileTags));
const QList<QByteArray> &tagList = QByteArray::fromRawData(fileTags, fileTagsLength).split(',');
@@ -249,8 +249,8 @@ static void *openScanner(const unsigned short *filePath, const char *fileTags, i
opaque->fileContent = reinterpret_cast<char *>(vmap);
CPlusPlus::Lexer lex(opaque->fileContent, opaque->fileContent + mapl);
- scanCppFile(opaque.data(), lex, flags & ScanForFileTagsFlag, flags & ScanForDependenciesFlag);
- return opaque.take();
+ scanCppFile(opaque.get(), lex, flags & ScanForFileTagsFlag, flags & ScanForDependenciesFlag);
+ return opaque.release();
}
static void closeScanner(void *ptr)
diff --git a/src/plugins/scanner/qt/qtscanner.cpp b/src/plugins/scanner/qt/qtscanner.cpp
index 408a65220..04de23fe6 100644
--- a/src/plugins/scanner/qt/qtscanner.cpp
+++ b/src/plugins/scanner/qt/qtscanner.cpp
@@ -60,10 +60,11 @@
#include <QtCore/qfile.h>
#endif
-#include <QtCore/qscopedpointer.h>
#include <QtCore/qstring.h>
#include <QtCore/qxmlstream.h>
+#include <memory>
+
struct OpaqQrc
{
#ifdef Q_OS_UNIX
@@ -104,7 +105,7 @@ static void *openScannerQrc(const unsigned short *filePath, const char *fileTags
{
Q_UNUSED(flags);
Q_UNUSED(fileTags);
- QScopedPointer<OpaqQrc> opaque(new OpaqQrc);
+ std::unique_ptr<OpaqQrc> opaque(new OpaqQrc);
#ifdef Q_OS_UNIX
QString filePathS = QString::fromUtf16(filePath);
@@ -136,7 +137,7 @@ static void *openScannerQrc(const unsigned short *filePath, const char *fileTags
opaque->map = reinterpret_cast<char *>(map);
opaque->xml = new QXmlStreamReader(opaque->map);
- return static_cast<void *>(opaque.take());
+ return static_cast<void *>(opaque.release());
}
static void closeScannerQrc(void *ptr)