Utils: Add a FilePath::lastModified() interface

And a local implementation.

Change-Id: I26400d960890c1cfb3daf82e6bfdeffa68455471
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
hjk
2021-06-08 15:30:01 +02:00
parent d97335c4ea
commit b820a832b2
2 changed files with 7 additions and 0 deletions

View File

@@ -1302,6 +1302,12 @@ uint FilePath::hash(uint seed) const
return qHash(m_data, seed);
}
QDateTime FilePath::lastModified() const
{
QTC_CHECK(!needsDevice());
return toFileInfo().lastModified();
}
QTextStream &operator<<(QTextStream &s, const FilePath &fn)
{
return s << fn.toString();

View File

@@ -171,6 +171,7 @@ public:
bool isEmpty() const;
uint hash(uint seed) const;
QDateTime lastModified() const;
// NOTE: Most FilePath operations on FilePath created from URL currently
// do not work. Among the working are .toVariant() and .toUrl().