From ca3be922349d5fa282578fbb6c1dc2bd25d1f5aa Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Thu, 29 Aug 2019 16:22:53 +0200 Subject: Remove QFileInfo::type and related enum from 5.14 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The API is problematic for several reasons: - the mixing of flags and enum in a single enum type - the name "type" as somewhat overloaded - the ease of misuse when comparing the result rather than testing for a bit being set In light of this, focus for 5.14 on the new isShortcut and isSymbolicLink functions, thus migitating the problematic isSymLink which conflates the two concepts. Change-Id: I57e02321edd5061f69a775f04a0932ef89adf866 Reviewed-by: Tor Arne Vestbø Reviewed-by: Marc Mutz --- src/corelib/io/qfileinfo.h | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) (limited to 'src/corelib/io/qfileinfo.h') diff --git a/src/corelib/io/qfileinfo.h b/src/corelib/io/qfileinfo.h index 1cbeafdd4a..3ac028085a 100644 --- a/src/corelib/io/qfileinfo.h +++ b/src/corelib/io/qfileinfo.h @@ -66,20 +66,6 @@ public: QFileInfo(const QFileInfo &fileinfo); ~QFileInfo(); - enum FileType { - Unknown, - // base type - Regular, - Directory, - // indirection flag - SymbolicLink = 0x10, - Shortcut = 0x20, - // mask - FileTypeMask = 0x0f, - LinkTypeMask = 0xf0 - }; - Q_DECLARE_FLAGS(FileTypes, FileType) - QFileInfo &operator=(const QFileInfo &fileinfo); QFileInfo &operator=(QFileInfo &&other) noexcept { swap(other); return *this; } @@ -125,8 +111,8 @@ public: bool isFile() const; bool isDir() const; bool isSymLink() const; - inline bool isSymbolicLink() const { return type() & SymbolicLink; } - inline bool isShortcut() const { return type() & Shortcut; } + bool isSymbolicLink() const; + bool isShortcut() const; bool isRoot() const; bool isBundle() const; @@ -145,7 +131,6 @@ public: QFile::Permissions permissions() const; qint64 size() const; - FileTypes type() const; // ### Qt6: inline these functions #if QT_DEPRECATED_SINCE(5, 10) -- cgit v1.2.3