From 78bba7b0029f9c626f0c686339dec9a9bf9466c6 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 24 Jun 2015 10:09:16 +0200 Subject: [PATCH] Clean up QZipReader::FileInfo - don't define special member functions if the compiler-generated ones are just fine (inhibits move semantics) - implement all remaining methods inline - unexport - remove unused (and, to add insult to injury, never init'ed) d-pointer. This is private API. No need for a d-pointer, much less an unused one. Change-Id: I6979cb5103a361c0313c252d3bf7073a3c47addd Reviewed-by: Konstantin Ritt --- src/gui/text/qzip.cpp | 32 -------------------------------- src/gui/text/qzipreader_p.h | 14 +++++++------- 2 files changed, 7 insertions(+), 39 deletions(-) diff --git a/src/gui/text/qzip.cpp b/src/gui/text/qzip.cpp index 40088d573a..00a1aa397c 100644 --- a/src/gui/text/qzip.cpp +++ b/src/gui/text/qzip.cpp @@ -411,38 +411,6 @@ struct FileHeader }; Q_DECLARE_TYPEINFO(FileHeader, Q_MOVABLE_TYPE); -QZipReader::FileInfo::FileInfo() - : isDir(false), isFile(false), isSymLink(false), crc(0), size(0) -{ -} - -QZipReader::FileInfo::~FileInfo() -{ -} - -QZipReader::FileInfo::FileInfo(const FileInfo &other) -{ - operator=(other); -} - -QZipReader::FileInfo& QZipReader::FileInfo::operator=(const FileInfo &other) -{ - filePath = other.filePath; - isDir = other.isDir; - isFile = other.isFile; - isSymLink = other.isSymLink; - permissions = other.permissions; - crc = other.crc; - size = other.size; - lastModified = other.lastModified; - return *this; -} - -bool QZipReader::FileInfo::isValid() const -{ - return isDir || isFile || isSymLink; -} - class QZipPrivate { public: diff --git a/src/gui/text/qzipreader_p.h b/src/gui/text/qzipreader_p.h index 7a18dc7340..e4026285b2 100644 --- a/src/gui/text/qzipreader_p.h +++ b/src/gui/text/qzipreader_p.h @@ -70,13 +70,14 @@ public: bool isReadable() const; bool exists() const; - struct Q_GUI_EXPORT FileInfo + struct FileInfo { - FileInfo(); - FileInfo(const FileInfo &other); - ~FileInfo(); - FileInfo &operator=(const FileInfo &other); - bool isValid() const; + FileInfo() Q_DECL_NOTHROW + : isDir(false), isFile(false), isSymLink(false), crc(0), size(0) + {} + + bool isValid() const Q_DECL_NOTHROW { return isDir || isFile || isSymLink; } + QString filePath; uint isDir : 1; uint isFile : 1; @@ -85,7 +86,6 @@ public: uint crc; qint64 size; QDateTime lastModified; - void *d; }; QList fileInfoList() const;