Created attachment 133154 [details] schreenshot with tar listing SUMMARY When option "Show hidden files", Krusader shows some garbage content inside of tar:// archives in form of the repeating archive name in every "subdir". The problem is reproducable only with kio-extras >= 20.08. With previous versions of kio-extras, 20.04.* problem doesn't exists. STEPS TO REPRODUCE 1. Make sure kio-extras = 20.08 2. Open in krusader any *tar.* archive containing subdirs OBSERVED RESULT File list in file panel will have some garbage items named as original archive file and presented as directories EXPECTED RESULT There should not be any wrong items in file list SOFTWARE/OS VERSIONS Linux/KDE Plasma: Gentoo Linux (available in About System) KDE Plasma Version: 5.75.0 KDE Frameworks Version: 5.78 Qt Version: 5.15.1 ADDITIONAL INFORMATION The bug came with the following commit in kio-extras: https://github.com/KDE/kio-extras/commit/21b86254 Probably, it's not a krusader bug and it should be fixed in kio-extras, but, on the other hand, in Dolphin the bug with the same URLs is not reproducible. So, probably Krusader should handle it and filter garbage content.
I doubt that this has anything to do with kio-extras given krusader uses its own archive ioslave krarc. I do reproduce.
Krusader uses an internal way to represent the contents of the filesystem. This cannot be reproduced in Dolphin. "Show hidden files" is a good tip to start from; while the commit in kio-extras is the "cause" (should be in the ArchiveProtocolBase::createRootUDSEntry changes, but I'm not entirely sure), the solution will be internal to Krusader (excludes an element when it is the archive itself).
(In reply to Davide Gianforte from comment #2) > Krusader uses an internal way to represent the contents of the filesystem. > This cannot be reproduced in Dolphin. > > "Show hidden files" is a good tip to start from; while the commit in > kio-extras is the "cause" (should be in the > ArchiveProtocolBase::createRootUDSEntry changes, but I'm not entirely sure), > the solution will be internal to Krusader (excludes an element when it is > the archive itself). I believe kio-extras change made apparent a misuse of KIO/KFileItem. The issue I can see is krusader using indirectly UDS_DISPLAY_NAME instead of UDS_NAME as the filename, probably hidden behind some accessor (I had a look at krarc code).
Thanks for the help Meven! I followed the code in Krusader, it starts from DefaultFileSystem::refreshInternal, and in FileSystem::createFileItemFromKIO we use KFileItem in https://invent.kde.org/utilities/krusader/-/blob/master/krusader/FileSystem/filesystem.cpp#L289 (as you said) to retrieve the filename with ::text(), which returns UDS_DISPLAY_NAME while ::name() returns UDS_NAME. I think the change will be limited to this line.
(In reply to Davide Gianforte from comment #4) > Thanks for the help Meven! I followed the code in Krusader, it starts from > DefaultFileSystem::refreshInternal, and in FileSystem::createFileItemFromKIO > we use KFileItem in > https://invent.kde.org/utilities/krusader/-/blob/master/krusader/FileSystem/ > filesystem.cpp#L289 (as you said) to retrieve the filename with ::text(), > which returns UDS_DISPLAY_NAME while ::name() returns UDS_NAME. I think the > change will be limited to this line. You seem to be right, Davide. I replaced "name()" with "text()" and the problem has gone.
(In reply to WiseLord from comment #5) > (In reply to Davide Gianforte from comment #4) > > Thanks for the help Meven! I followed the code in Krusader, it starts from > > DefaultFileSystem::refreshInternal, and in FileSystem::createFileItemFromKIO > > we use KFileItem in > > https://invent.kde.org/utilities/krusader/-/blob/master/krusader/FileSystem/ > > filesystem.cpp#L289 (as you said) to retrieve the filename with ::text(), > > which returns UDS_DISPLAY_NAME while ::name() returns UDS_NAME. I think the > > change will be limited to this line. > > You seem to be right, Davide. I replaced "name()" with "text()" and the > problem has gone. Great ! I believe you meant "text()" to "name()". ``` - const QString name = kfi.text(); + const QString name = kfi.name(); // ignore un-needed entries if (name.isEmpty() || name == "." || name == "..") { return nullptr; // <- will now return null for archive root } ``` Who will do the honor of opening the MR ? (I can do it it if no one else wants to)
Yes, I've mistaken. This patch works for me: wiselord@home ~ $ cat /etc/portage/patches/kde-misc/krusader-2.7.2/fix-tar-arhives.patch diff --git a/krusader/FileSystem/filesystem.cpp b/krusader/FileSystem/filesystem.cpp index 6aafb837..e302eea1 100644 --- a/krusader/FileSystem/filesystem.cpp +++ b/krusader/FileSystem/filesystem.cpp @@ -286,7 +286,7 @@ FileItem *FileSystem::createFileItemFromKIO(const KIO::UDSEntry &entry, const QU { const KFileItem kfi(entry, directory, true, true); - const QString name = kfi.text(); + const QString name = kfi.name(); // ignore un-needed entries if (name.isEmpty() || name == "." || name == "..") { return nullptr; (In reply to Méven Car from comment #6) > (In reply to WiseLord from comment #5) > > (In reply to Davide Gianforte from comment #4)
A possibly relevant merge request was started @ https://invent.kde.org/utilities/krusader/-/merge_requests/35
Git commit 98bdfe9ff649eea10112e33a68d82ae6a102ae2e by Méven Car. Committed on 13/11/2020 at 20:36. Pushed by meven into branch 'master'. Filesystem: Use KFileItem::name to get files name KFileItem::text() returns human readable values. To get name as file on disk name we need to use name(). M +1 -1 krusader/FileSystem/filesystem.cpp https://invent.kde.org/utilities/krusader/commit/98bdfe9ff649eea10112e33a68d82ae6a102ae2e
*** Bug 433478 has been marked as a duplicate of this bug. ***