From 2eda09625a804ac1a21b8af58eb4c286371b3a1a Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Tue, 4 Jun 2024 03:17:56 +0300 Subject: [PATCH] kio: testing build fix Signed-off-by: Ivailo Monev --- kio/tests/jobtest.cpp | 39 +++---------------------------------- kio/tests/jobtest.h | 4 ---- kio/tests/kfileitemtest.cpp | 6 ++++-- 3 files changed, 7 insertions(+), 42 deletions(-) diff --git a/kio/tests/jobtest.cpp b/kio/tests/jobtest.cpp index 20347838..0755b412 100644 --- a/kio/tests/jobtest.cpp +++ b/kio/tests/jobtest.cpp @@ -1018,11 +1018,8 @@ void JobTest::deleteDirectory() QVERIFY(!QFile::exists(dest)); } -void JobTest::deleteSymlink(bool using_fast_path) +void JobTest::deleteSymlink() { - extern KIO_EXPORT bool kio_resolve_local_urls; - kio_resolve_local_urls = !using_fast_path; - const QString src = homeTmpDir() + "dirFromHome"; createTestDirectory(src); QVERIFY(QDir(src).exists()); @@ -1039,22 +1036,10 @@ void JobTest::deleteSymlink(bool using_fast_path) QVERIFY(ok); QVERIFY(!QDir(dest).exists()); QVERIFY(QDir(src).exists()); - - kio_resolve_local_urls = true; } - -void JobTest::deleteSymlink() +void JobTest::deleteManyDirs() { - deleteSymlink(true); - deleteSymlink(false); -} - -void JobTest::deleteManyDirs(bool using_fast_path) -{ - extern KIO_EXPORT bool kio_resolve_local_urls; - kio_resolve_local_urls = !using_fast_path; - const int numDirs = 50; KUrl::List dirs; for (int i = 0; i < numDirs; ++i) { @@ -1073,13 +1058,6 @@ void JobTest::deleteManyDirs(bool using_fast_path) } kDebug() << "Deleted" << numDirs << "dirs in" << dt.elapsed() << "milliseconds"; - kio_resolve_local_urls = true; -} - -void JobTest::deleteManyDirs() -{ - deleteManyDirs(true); - deleteManyDirs(false); } static void createManyFiles(const QString& baseDir, int numFiles) @@ -1112,11 +1090,8 @@ void JobTest::deleteManyFilesIndependently() kDebug() << "Deleted" << numFiles << "files in" << dt.elapsed() << "milliseconds"; } -void JobTest::deleteManyFilesTogether(bool using_fast_path) +void JobTest::deleteManyFilesTogether() { - extern KIO_EXPORT bool kio_resolve_local_urls; - kio_resolve_local_urls = !using_fast_path; - QElapsedTimer dt; dt.start(); const int numFiles = 100; // Use 1000 for performance testing @@ -1135,14 +1110,6 @@ void JobTest::deleteManyFilesTogether(bool using_fast_path) bool ok = KIO::NetAccess::synchronousRun(job, 0); QVERIFY(ok); kDebug() << "Deleted" << numFiles << "files in" << dt.elapsed() << "milliseconds"; - - kio_resolve_local_urls = true; -} - -void JobTest::deleteManyFilesTogether() -{ - deleteManyFilesTogether(true); - deleteManyFilesTogether(false); } void JobTest::rmdirEmpty() diff --git a/kio/tests/jobtest.h b/kio/tests/jobtest.h index 60fbf961..c6f10761 100644 --- a/kio/tests/jobtest.h +++ b/kio/tests/jobtest.h @@ -94,10 +94,6 @@ private: void copyLocalDirectory( const QString& src, const QString& dest, int flags = 0 ); void moveLocalFile( const QString& src, const QString& dest ); void moveLocalDirectory( const QString& src, const QString& dest ); - //void copyFileToSystem( bool resolve_local_urls ); - void deleteSymlink(bool using_fast_path); - void deleteManyDirs(bool using_fast_path); - void deleteManyFilesTogether(bool using_fast_path); void moveDestAlreadyExistsAutoRename(const QString& destDir, bool moveDirs); int m_result; diff --git a/kio/tests/kfileitemtest.cpp b/kio/tests/kfileitemtest.cpp index 22b0d6d9..0ce871f2 100644 --- a/kio/tests/kfileitemtest.cpp +++ b/kio/tests/kfileitemtest.cpp @@ -122,8 +122,9 @@ void KFileItemTest::testRootDirectory() KUrl url(rootPath); KIO::UDSEntry entry; entry.insert(KIO::UDSEntry::UDS_NAME, "."); + entry.insert(KIO::UDSEntry::UDS_URL, rootPath); entry.insert(KIO::UDSEntry::UDS_FILE_TYPE, S_IFDIR); - KFileItem fileItem(entry, rootPath); + KFileItem fileItem(entry); QCOMPARE(fileItem.text(), QString(".")); QVERIFY(fileItem.isLocalFile()); QCOMPARE(fileItem.localPath(), url.path()); @@ -216,8 +217,9 @@ void KFileItemTest::testRename() KIO::UDSEntry entry; const QString origName = QString::fromLatin1("foo"); entry.insert(KIO::UDSEntry::UDS_NAME, origName); + entry.insert(KIO::UDSEntry::UDS_URL, "/dir/foo"); entry.insert(KIO::UDSEntry::UDS_FILE_TYPE, S_IFDIR); - KFileItem fileItem(entry, KUrl("/dir/foo")); + KFileItem fileItem(entry); QCOMPARE(fileItem.name(), origName); QCOMPARE(fileItem.text(), origName); const QString newName = QString::fromLatin1("FiNeX_rocks");