Summary: | Garbage items when listing tar archives when option to show hiddens files is enabled | ||
---|---|---|---|
Product: | [Applications] krusader | Reporter: | WiseLord <wiselord1983> |
Component: | krarc | Assignee: | Krusader Bugs Distribution List <krusader-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | davide, krusader-bugs-null, ksensitive, meven29 |
Priority: | NOR | ||
Version: | Git | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/utilities/krusader/commit/98bdfe9ff649eea10112e33a68d82ae6a102ae2e | Version Fixed In: | |
Attachments: | schreenshot with tar listing |
Description
WiseLord
2020-11-08 17:47:15 UTC
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. *** |