diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2020-07-21 16:42:11 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2020-07-27 11:21:00 +0200 |
commit | 197ba3e938169f73426c37e969c1529588e2fa26 (patch) | |
tree | 78c8d592bdb652fa3bae5fc023a272f5f811bd5a /src | |
parent | 02c2c930f0874a8886cb0983606c38cb8b356cd7 (diff) |
Inline QDir::separator(), as requested by a ### Qt6 comment
Task-number: QTBUG-85700
Change-Id: Icd44e428b607703defb9be1c149db6a564e6b4f0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/io/qdir.cpp | 10 | ||||
-rw-r--r-- | src/corelib/io/qdir.h | 9 |
2 files changed, 10 insertions, 9 deletions
diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp index e202be154a..3e0174e383 100644 --- a/src/corelib/io/qdir.cpp +++ b/src/corelib/io/qdir.cpp @@ -1969,6 +1969,8 @@ QFileInfoList QDir::drives() } /*! + \fn QChar QDir::separator() + Returns the native directory separator: "/" under Unix and "\\" under Windows. @@ -1980,14 +1982,6 @@ QFileInfoList QDir::drives() \sa listSeparator() */ -QChar QDir::separator() -{ -#if defined(Q_OS_WIN) - return QLatin1Char('\\'); -#else - return QLatin1Char('/'); -#endif -} /*! \fn QDir::listSeparator() diff --git a/src/corelib/io/qdir.h b/src/corelib/io/qdir.h index f0dda73ebb..05adb688f8 100644 --- a/src/corelib/io/qdir.h +++ b/src/corelib/io/qdir.h @@ -239,7 +239,14 @@ public: #endif } - static QChar separator(); // ### Qt6: Make it inline + static QChar separator() + { +#if defined(Q_OS_WIN) + return QLatin1Char('\\'); +#else + return QLatin1Char('/'); +#endif + } static bool setCurrent(const QString &path); static inline QDir current() { return QDir(currentPath()); } |