QLockFile: remove unneeded tryLock_impl middle-man
It's perfectly ok to de-inline a function, even an exported one, so
remove the tryLock_impl() middle-man and pull the Qt 7 pre-programming
into the here and now.
Amends 5cea5fc80b
.
Pick-to: 6.6
Change-Id: I7e9626a91d8ebd64e02c3784c74621950da669fb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
This commit is contained in:
parent
44fd4a3ba0
commit
508629522d
@ -257,7 +257,7 @@ bool QLockFile::tryLock(int timeout)
|
||||
return tryLock(std::chrono::milliseconds{ timeout });
|
||||
}
|
||||
|
||||
/*! \fn bool QLockFile::tryLock(std::chrono::milliseconds timeout)
|
||||
/*!
|
||||
\overload
|
||||
\since 6.2
|
||||
|
||||
@ -275,11 +275,7 @@ bool QLockFile::tryLock(int timeout)
|
||||
|
||||
\sa lock(), unlock()
|
||||
*/
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0)
|
||||
bool QLockFile::tryLock(std::chrono::milliseconds timeout)
|
||||
#else
|
||||
bool QLockFile::tryLock_impl(std::chrono::milliseconds timeout)
|
||||
#endif
|
||||
{
|
||||
using namespace std::chrono_literals;
|
||||
using Msec = std::chrono::milliseconds;
|
||||
|
@ -28,14 +28,7 @@ public:
|
||||
void setStaleLockTime(int);
|
||||
int staleLockTime() const;
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0)
|
||||
bool tryLock(std::chrono::milliseconds timeout = std::chrono::milliseconds::zero());
|
||||
#else
|
||||
bool tryLock(std::chrono::milliseconds timeout = std::chrono::milliseconds::zero())
|
||||
{
|
||||
return tryLock_impl(timeout);
|
||||
}
|
||||
#endif
|
||||
|
||||
void setStaleLockTime(std::chrono::milliseconds value);
|
||||
std::chrono::milliseconds staleLockTimeAsDuration() const;
|
||||
@ -58,10 +51,6 @@ protected:
|
||||
private:
|
||||
Q_DECLARE_PRIVATE(QLockFile)
|
||||
Q_DISABLE_COPY(QLockFile)
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
|
||||
bool tryLock_impl(std::chrono::milliseconds timeout);
|
||||
#endif
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
Loading…
Reference in New Issue
Block a user