diff --git a/src/common/vfs.h b/src/common/vfs.h index 079bccb46a381..8080d9e955276 100644 --- a/src/common/vfs.h +++ b/src/common/vfs.h @@ -114,8 +114,8 @@ class OCSYNC_EXPORT Vfs : public QObject Q_ENUM(ConvertToPlaceholderResult) enum UpdateMetadataType { - DatabaseMetadata = 0 >> 1, - FileMetadata = 0 >> 2, + DatabaseMetadata = 1 << 0, + FileMetadata = 1 << 1, AllMetadata = DatabaseMetadata | FileMetadata, }; diff --git a/src/gui/folderwatcher.cpp b/src/gui/folderwatcher.cpp index c08d544729839..6b645c3724cf7 100644 --- a/src/gui/folderwatcher.cpp +++ b/src/gui/folderwatcher.cpp @@ -146,6 +146,7 @@ void FolderWatcher::startNotificationTestWhenReady() auto path = _testNotificationPath; if (QFile::exists(path)) { auto mtime = FileSystem::getModTime(path); + qCInfo(lcFolderWatcher()) << "setModTime" << path << (mtime + 1); FileSystem::setModTime(path, mtime + 1); } else { QFile f(path); diff --git a/src/libsync/owncloudpropagator.cpp b/src/libsync/owncloudpropagator.cpp index b2a058088c303..6abb3866f50c1 100644 --- a/src/libsync/owncloudpropagator.cpp +++ b/src/libsync/owncloudpropagator.cpp @@ -1378,6 +1378,7 @@ void PropagateDirectory::slotSubJobsFinished(SyncFileItem::Status status) qCWarning(lcDirectory) << "Error writing to the database for file" << _item->_file; } + qCInfo(lcPropagator()) << "setModTime" << propagator()->fullLocalPath(_item->destination()) << _item->_modtime; FileSystem::setModTime(propagator()->fullLocalPath(_item->destination()), _item->_modtime); } diff --git a/src/libsync/propagatedownload.cpp b/src/libsync/propagatedownload.cpp index cdc4d17e97ab2..6d6e7ce5e1a21 100644 --- a/src/libsync/propagatedownload.cpp +++ b/src/libsync/propagatedownload.cpp @@ -606,6 +606,7 @@ void PropagateDownloadFile::conflictChecksumComputed(const QByteArray &checksumT } if (_item->_modtime != _item->_previousModtime) { Q_ASSERT(_item->_modtime > 0); + qCInfo(lcPropagateDownload()) << "setModTime" << fn << _item->_modtime; FileSystem::setModTime(fn, _item->_modtime); emit propagator()->touchedFile(fn); } @@ -1162,6 +1163,7 @@ void PropagateDownloadFile::downloadFinished() if (_item->_modtime <= 0) { qCWarning(lcPropagateDownload()) << "invalid modified time" << _item->_file << _item->_modtime; } + qCInfo(lcPropagateDownload()) << "setModTime" << _tmpFile.fileName() << _item->_modtime; FileSystem::setModTime(_tmpFile.fileName(), _item->_modtime); // We need to fetch the time again because some file systems such as FAT have worse than a second // Accuracy, and we really need the time from the file system. (#3103) diff --git a/src/libsync/vfs/cfapi/cfapiwrapper.cpp b/src/libsync/vfs/cfapi/cfapiwrapper.cpp index e16a5c079c824..4fb199749a774 100644 --- a/src/libsync/vfs/cfapi/cfapiwrapper.cpp +++ b/src/libsync/vfs/cfapi/cfapiwrapper.cpp @@ -732,6 +732,7 @@ OCC::Result OCC::CfApiWrapper::createPlaceholderInfo(const QStrin cloudEntry.FsMetadata.FileSize.QuadPart = 0; } + qCInfo(lcCfApiWrapper) << "CfCreatePlaceholders" << path << modtime; const qint64 result = CfCreatePlaceholders(localBasePath.data(), &cloudEntry, 1, CF_CREATE_FLAG_NONE, nullptr); if (result != S_OK) { qCWarning(lcCfApiWrapper) << "Couldn't create placeholder info for" << path << ":" << QString::fromWCharArray(_com_error(result).ErrorMessage()); @@ -773,6 +774,7 @@ OCC::Result OCC::CfApiWrapper::up OCC::Utility::UnixTimeToLargeIntegerFiletime(modtime, &metadata.BasicInfo.ChangeTime); metadata.BasicInfo.FileAttributes = 0; + qCInfo(lcCfApiWrapper) << "CfUpdatePlaceholder" << path << modtime; const qint64 result = CfUpdatePlaceholder(handleForPath(path).get(), &metadata, fileIdentity.data(), sizeToDWORD(fileIdentitySize), nullptr, 0, CF_UPDATE_FLAG_MARK_IN_SYNC, nullptr, nullptr); diff --git a/src/libsync/vfs/suffix/vfs_suffix.cpp b/src/libsync/vfs/suffix/vfs_suffix.cpp index f4d5e9a05d72b..47725f65f5f5c 100644 --- a/src/libsync/vfs/suffix/vfs_suffix.cpp +++ b/src/libsync/vfs/suffix/vfs_suffix.cpp @@ -80,6 +80,7 @@ Result VfsSuffix::updateMetadata(const QString &filePath, time_t return {tr("Error updating metadata due to invalid modification time")}; } + qCInfo(lcVfsSuffix()) << "setModTime" << filePath << modtime; FileSystem::setModTime(filePath, modtime); return {}; } @@ -108,6 +109,7 @@ Result VfsSuffix::createPlaceholder(const SyncFileItem &item) file.write(" "); file.close(); + qCInfo(lcVfsSuffix()) << "setModTime" << fn << item._modtime; FileSystem::setModTime(fn, item._modtime); return {}; } diff --git a/src/libsync/vfs/xattr/vfs_xattr.cpp b/src/libsync/vfs/xattr/vfs_xattr.cpp index f6ba09f1e365d..2099298ac4247 100644 --- a/src/libsync/vfs/xattr/vfs_xattr.cpp +++ b/src/libsync/vfs/xattr/vfs_xattr.cpp @@ -75,6 +75,7 @@ Result VfsXAttr::updateMetadata(const QString &filePath, time_t m return {tr("Error updating metadata due to invalid modification time")}; } + qCInfo(lcVfsXAttr()) << "setModTime" << filePath << modtime; FileSystem::setModTime(filePath, modtime); return {}; } @@ -98,6 +99,7 @@ Result VfsXAttr::createPlaceholder(const SyncFileItem &item) file.write(" "); file.close(); + qCInfo(lcVfsXAttr()) << "setModTime" << path << item._modtime; FileSystem::setModTime(path, item._modtime); return xattr::addNextcloudPlaceholderAttributes(path); }