1
mirror of https://invent.kde.org/network/falkon.git synced 2024-09-21 09:42:10 +02:00

Use faster QFileInfo::exists

Signed-off-by: Juraj Oravec <jurajoravec@mailo.com>
This commit is contained in:
Juraj Oravec 2024-06-15 12:35:20 +02:00
parent abcd1c9415
commit e72a661378
Signed by: SGOrava
GPG Key ID: 13660A3F1D9F093B
2 changed files with 4 additions and 4 deletions

View File

@ -296,7 +296,7 @@ void QzToolsTest::copyRecursivelyTest()
const QString testDir = createPath("copyRecursivelyTest"); const QString testDir = createPath("copyRecursivelyTest");
createTestDirectoryStructure(testDir); createTestDirectoryStructure(testDir);
QVERIFY(!QFileInfo(testDir + QSL("-copy")).exists()); QVERIFY(!QFileInfo::exists(testDir + QSL("-copy")));
// Copy to non-existent target // Copy to non-existent target
QCOMPARE(QzTools::copyRecursively(testDir, testDir + QSL("-copy")), true); QCOMPARE(QzTools::copyRecursively(testDir, testDir + QSL("-copy")), true);
@ -331,7 +331,7 @@ void QzToolsTest::removeRecursivelyTest()
QCOMPARE(QzTools::copyRecursively(testDir, testDir + QSL("-copy")), true); QCOMPARE(QzTools::copyRecursively(testDir, testDir + QSL("-copy")), true);
QCOMPARE(QzTools::removeRecursively(testDir + QSL("-copy")), true); QCOMPARE(QzTools::removeRecursively(testDir + QSL("-copy")), true);
QCOMPARE(QFileInfo(testDir + QSL("-copy")).exists(), false); QCOMPARE(QFileInfo::exists(testDir + QSL("-copy")), false);
// Remove non-existent path returns success // Remove non-existent path returns success
QCOMPARE(QzTools::removeRecursively(testDir + QSL("-copy")), true); QCOMPARE(QzTools::removeRecursively(testDir + QSL("-copy")), true);

View File

@ -249,7 +249,7 @@ void TLDExtractor::loadData()
for (const QString &path : std::as_const(m_dataSearchPaths)) { for (const QString &path : std::as_const(m_dataSearchPaths)) {
dataFileName = QFileInfo(path + QLatin1String("/effective_tld_names.dat")).absoluteFilePath(); dataFileName = QFileInfo(path + QLatin1String("/effective_tld_names.dat")).absoluteFilePath();
if (QFileInfo(dataFileName).exists()) { if (QFileInfo::exists(dataFileName)) {
parsedDataFileExist = true; parsedDataFileExist = true;
break; break;
} }
@ -352,7 +352,7 @@ bool TLDExtractor::test()
for (const QString &path : std::as_const(m_dataSearchPaths)) { for (const QString &path : std::as_const(m_dataSearchPaths)) {
testDataFileName = QFileInfo(path + QLatin1String("/test_psl.txt")).absoluteFilePath(); testDataFileName = QFileInfo(path + QLatin1String("/test_psl.txt")).absoluteFilePath();
if (QFileInfo(testDataFileName).exists()) { if (QFileInfo::exists(testDataFileName)) {
testDataFileExist = true; testDataFileExist = true;
break; break;
} }