diff --git a/src/libs/ssh/sftpchannel.cpp b/src/libs/ssh/sftpchannel.cpp index 2e397ea404e..59c6ea66ec4 100644 --- a/src/libs/ssh/sftpchannel.cpp +++ b/src/libs/ssh/sftpchannel.cpp @@ -921,6 +921,10 @@ void SftpChannelPrivate::attributesToFileInfo(const SftpFileAttributes &attribut if (attributes.permissions & 00400) // S_IRUSR fileInfo.permissions |= QFile::ReadUser | QFile::ReadOwner; } + if (attributes.timesPresent) { + fileInfo.mtime = attributes.mtime; + fileInfo.mtimeValid = true; + } } void SftpChannelPrivate::removeTransferRequest(const JobMap::Iterator &it) diff --git a/src/libs/ssh/sftpdefs.h b/src/libs/ssh/sftpdefs.h index 71d2d6dd308..b996c38ca4f 100644 --- a/src/libs/ssh/sftpdefs.h +++ b/src/libs/ssh/sftpdefs.h @@ -44,16 +44,16 @@ enum SftpFileType { FileTypeRegular, FileTypeDirectory, FileTypeOther, FileTypeU class QSSH_EXPORT SftpFileInfo { public: - SftpFileInfo() : type(FileTypeUnknown), sizeValid(false), permissionsValid(false) { } - QString name; - SftpFileType type; - quint64 size; + SftpFileType type = FileTypeUnknown; + quint64 size = 0; QFile::Permissions permissions; + quint32 mtime = 0; // The RFC allows an SFTP server not to support any file attributes beyond the name. - bool sizeValid; - bool permissionsValid; + bool sizeValid = false; + bool permissionsValid = false; + bool mtimeValid = false; }; } // namespace QSsh