forked from qt-creator/qt-creator
FilePath: Use isSameDevice
Some places compared the scheme and host of a filepath to decide whether its the same device. This is incorrect and leads to false negatives. isSameDevice is the correct way to decide whether two paths are from the same device. Fixes: QTCREATORBUG-29474 Change-Id: Iced8f434dadb931f6595f47f95647b341c48d3aa Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -722,8 +722,7 @@ bool FileUtils::copyRecursively(
|
||||
bool FileUtils::copyIfDifferent(const FilePath &srcFilePath, const FilePath &tgtFilePath)
|
||||
{
|
||||
QTC_ASSERT(srcFilePath.exists(), return false);
|
||||
QTC_ASSERT(srcFilePath.scheme() == tgtFilePath.scheme(), return false);
|
||||
QTC_ASSERT(srcFilePath.host() == tgtFilePath.host(), return false);
|
||||
QTC_ASSERT(srcFilePath.isSameDevice(tgtFilePath), return false);
|
||||
|
||||
if (tgtFilePath.exists()) {
|
||||
const QDateTime srcModified = srcFilePath.lastModified();
|
||||
|
||||
Reference in New Issue
Block a user