diff options
author | David Faure <faure@kde.org> | 2011-11-05 12:09:54 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-11-08 12:09:06 +0100 |
commit | 5e26608ae2d724f5e45d9e8667378bf7faf69d8c (patch) | |
tree | cedada7bc66ca7fc361a02719e98865f4b5613a3 /src/corelib/io/qdir.h | |
parent | 4d398c90fb5f5830f7c060d2a7867ba15f8c39a1 (diff) |
Add Q_DECLARE_PRIVATE equivalent for QDir, to be able to subclass it
Apply the same solution to QFileInfo (no public detach(), but a
non-inline d_func instead).
Change-Id: I31c4c759f44a0649b97f7884b078b174c9c00f22
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io/qdir.h')
-rw-r--r-- | src/corelib/io/qdir.h | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/corelib/io/qdir.h b/src/corelib/io/qdir.h index de5fb1bf00..822173dfc8 100644 --- a/src/corelib/io/qdir.h +++ b/src/corelib/io/qdir.h @@ -57,9 +57,6 @@ class QDirPrivate; class Q_CORE_EXPORT QDir { -protected: - QSharedDataPointer<QDirPrivate> d_ptr; - public: enum Filter { Dirs = 0x001, Files = 0x002, @@ -99,7 +96,7 @@ public: Reversed = 0x08, IgnoreCase = 0x10, DirsLast = 0x20, - LocaleAware = 0x40, + LocaleAware = 0x40, Type = 0x80, NoSort = -1 }; @@ -208,6 +205,20 @@ public: static QString cleanPath(const QString &path); void refresh() const; + +protected: + explicit QDir(QDirPrivate &d); + + QSharedDataPointer<QDirPrivate> d_ptr; + +private: + // Q_DECLARE_PRIVATE equivalent for shared data pointers + QDirPrivate* d_func(); + inline const QDirPrivate* d_func() const + { + return d_ptr.constData(); + } + }; Q_DECLARE_OPERATORS_FOR_FLAGS(QDir::Filters) |