<table><tr><td style="">wbauer updated this revision to Diff 60227.<br />wbauer edited the summary of this revision. <a href="https://phabricator.kde.org/transactions/detail/PHID-XACT-DREV-3cwld4hx3q4nrcj/">(Show Details)</a><br />wbauer added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D21955">View Revision</a></tr></table><br /><div><div><p>Check already when setting info.mtime in CopyJobPrivate::addCopyInfoFromUDSEntry().</p></div></div><br /><div><strong>CHANGES TO REVISION SUMMARY</strong><div><div style="white-space: pre-wrap; color: #74777D;">If the slave didn't pass a modification time (e.g. the http slave doesn't), <span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">it i</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">it wa</span>s set to -1<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);"> in line#672:<br />
```</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">,</span><br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">     info.mtime = QDateTime::fromMSecsSinceEpoch(1000 * entry.numberValue(KIO::UDSEntry::UDS_MODIFICATION_TIME, -1), Qt::UTC);</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">resulting in setting a wrong modification time for the destination file in `copyNextFile()` later on because that</span><br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">```<br />
This results in setting a wrong modification </span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">case wasn't checked.<br />
<br />
So only set `info.m</span>time<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);"> for</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">` when</span> the <span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">destination file in `copyNextFile()` later on</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">slave actually provided a value</span>.<br />
<br />
T<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">o fix this, only set the modifcation time if it is not -1.<br />
<br />
The Qt4 version had the same check, but this got lost in the port to Qt5</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">here's no need for further checks later in `copyNextFile()` (where `FileCopyJob::setModificationTime()` is called)<br />
because `FileCopyJob` checks for validity anyway</span>.<div style="padding: 8px 0;">...</div></div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R241 KIO</div></div></div><br /><div><strong>CHANGES SINCE LAST UPDATE</strong><div><a href="https://phabricator.kde.org/D21955?vs=60202&id=60227">https://phabricator.kde.org/D21955?vs=60202&id=60227</a></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D21955">https://phabricator.kde.org/D21955</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>src/core/copyjob.cpp</div></div></div><br /><div><strong>To: </strong>wbauer, Frameworks, bruns, dfaure, ngraham<br /><strong>Cc: </strong>ngraham, kde-frameworks-devel, Dolphin, LeGast00n, michaelh, bruns<br /></div>