remove NTFS junction and mount point detection
Qt now treats neither NTFS junctions nor mount points as symlinks. Task-number: QTBUG-20431 Change-Id: I93f67d7438d441ceb53308d4a1f29335beedd547 Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
This commit is contained in:
parent
49d1b06898
commit
97a8dff3c0
@ -1362,7 +1362,7 @@ void tst_QFileInfo::ntfsJunctionPointsAndSymlinks_data()
|
||||
QString junction = "junction_pwd";
|
||||
FileSystem::createNtfsJunction(target, junction);
|
||||
QFileInfo targetInfo(target);
|
||||
QTest::newRow("junction_pwd") << junction << true << targetInfo.absoluteFilePath() << targetInfo.canonicalFilePath();
|
||||
QTest::newRow("junction_pwd") << junction << false << QString() << QString();
|
||||
|
||||
QFileInfo fileInJunction(targetInfo.absoluteFilePath().append("/file"));
|
||||
QFile file(fileInJunction.absoluteFilePath());
|
||||
@ -1375,7 +1375,7 @@ void tst_QFileInfo::ntfsJunctionPointsAndSymlinks_data()
|
||||
junction = "junction_root";
|
||||
FileSystem::createNtfsJunction(target, junction);
|
||||
targetInfo.setFile(target);
|
||||
QTest::newRow("junction_root") << junction << true << targetInfo.absoluteFilePath() << targetInfo.canonicalFilePath();
|
||||
QTest::newRow("junction_root") << junction << false << QString() << QString();
|
||||
|
||||
//Mountpoint
|
||||
typedef BOOLEAN (WINAPI *PtrGetVolumeNameForVolumeMountPointW)(LPCWSTR, LPWSTR, DWORD);
|
||||
@ -1390,7 +1390,7 @@ void tst_QFileInfo::ntfsJunctionPointsAndSymlinks_data()
|
||||
junction = "mountpoint";
|
||||
rootVolume.replace("\\\\?\\","\\??\\");
|
||||
FileSystem::createNtfsJunction(rootVolume, junction);
|
||||
QTest::newRow("mountpoint") << junction << true << QDir::fromNativeSeparators(rootPath) << QDir::rootPath();
|
||||
QTest::newRow("mountpoint") << junction << false << QString() << QString();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1403,8 +1403,10 @@ void tst_QFileInfo::ntfsJunctionPointsAndSymlinks()
|
||||
|
||||
QFileInfo fi(path);
|
||||
QCOMPARE(fi.isSymLink(), isSymLink);
|
||||
QCOMPARE(fi.symLinkTarget(), linkTarget);
|
||||
QCOMPARE(fi.canonicalFilePath(), canonicalFilePath);
|
||||
if (isSymLink) {
|
||||
QCOMPARE(fi.symLinkTarget(), linkTarget);
|
||||
QCOMPARE(fi.canonicalFilePath(), canonicalFilePath);
|
||||
}
|
||||
}
|
||||
|
||||
void tst_QFileInfo::brokenShortcut()
|
||||
|
Loading…
Reference in New Issue
Block a user