Skip to content

Commit 82f8da7

Browse files
committed
mtime 0 is valid
1 parent 53852c4 commit 82f8da7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/libsync/common/syncjournalfilerecord.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class OCC::SyncJournalFileRecordData : public QSharedData
3636

3737
QString _path;
3838
quint64 _inode = 0;
39-
qint64 _modtime = 0;
39+
std::optional<qint64> _modtime;
4040
ItemType _type = ItemTypeUnsupported;
4141
QString _etag;
4242
QByteArray _fileId;
@@ -73,7 +73,7 @@ bool SyncJournalFileRecord::validateRecord()
7373
Q_ASSERT(d != SyncJournalFileRecord().d);
7474
Q_ASSERT(!remotePerm().isNull());
7575
Q_ASSERT(inode() != 0);
76-
Q_ASSERT(modtime() != 0);
76+
Q_ASSERT(d->_modtime.has_value());
7777
Q_ASSERT(!fileId().isEmpty());
7878
Q_ASSERT(type() != ItemTypeUnsupported);
7979
return true;
@@ -192,7 +192,7 @@ QByteArray SyncJournalFileRecord::checksumHeader() const
192192

193193
time_t SyncJournalFileRecord::modtime() const
194194
{
195-
return d->_modtime;
195+
return d->_modtime.value_or(0);
196196
}
197197

198198
int64_t SyncJournalFileRecord::size() const

0 commit comments

Comments
 (0)