forked from qt-creator/qt-creator
Ssh: Add mtime to QSshFileInfo
We will need it for checking if a file needs to be deployed. Change-Id: I4dc4e3a43ea161b27319ee2771806c1d52679856 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -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)
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user