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 <ritt.ks@gmail.com>
This commit is contained in:
Marc Mutz 2015-06-24 10:09:16 +02:00
parent 74a658599f
commit 78bba7b002
2 changed files with 7 additions and 39 deletions

View File

@ -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:

View File

@ -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<FileInfo> fileInfoList() const;