Commit 9d8fc328 authored by Michael Reeves's avatar Michael Reeves

make FileAccess::lastModified truely const

parent 31b8537d
......@@ -373,7 +373,10 @@ void FileAccess::setUdsEntry(const KIO::UDSEntry& e)
}
m_bExists = acc != 0 || fileType != 0;
//insure modifcation time is initialized if it wasn't already.
if(m_modificationTime.isNull())
m_modificationTime = m_fileInfo.lastModified();
d()->m_bValidData = true;
m_bSymLink = !d()->m_linkTarget.isEmpty();
if(d()->m_name.isEmpty())
......@@ -569,8 +572,7 @@ QDateTime FileAccess::created() const
QDateTime FileAccess::lastModified() const
{
if(isLocal() && m_modificationTime.isNull())
const_cast<FileAccess*>(this)->m_modificationTime = QFileInfo(absoluteFilePath()).lastModified();
Q_ASSERT(!m_modificationTime.isNull());
return m_modificationTime;
}
......
......@@ -59,9 +59,7 @@ public:
bool isHidden() const;
QString readLink() const;
//QDateTime created() const;
QDateTime lastModified() const;
//QDateTime lastRead() const;
QDateTime lastModified() const;
QString fileName() const; // Just the name-part of the path, without parent directories
QString filePath() const; // The path-string that was used during construction
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment