Bug 468505 - Get rid of VFS handles without affected found files
Summary: Get rid of VFS handles without affected found files
Status: RESOLVED NOT A BUG
Alias: None
Product: krusader
Classification: Applications
Component: general (other bugs)
Version First Reported In: 2.7.2
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Krusader Bugs Distribution List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-04-14 15:30 UTC by adalbert.hanssen
Modified: 2024-12-11 09:19 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Script to reset Krusader (i.e. get rid of all vfs together) (869 bytes, application/x-shellscript)
2023-06-21 21:57 UTC, adalbert.hanssen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description adalbert.hanssen 2023-04-14 15:30:42 UTC
SUMMARY
***
An easy way to get rid of VFS handles without deleting files shown in them is necessary
***


STEPS TO REPRODUCE
1. Search for files meeting some search criteria,
2. Feed found results to a listbox (German: "In Dateifenster einspeisen")
3. There is no way to get rid of that listbox.

OBSERVED RESULT
p. 36 of the documentation warns: deleting a VFS results in deleting all files shown in it.

EXPECTED RESULT
1. There should be a warning of how many files will be deleted if one confirms it when deleting a VFS handle.
2. A means to get rid of VFS handles alone is necessary.



SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: Xubuntu 20.04 LTS
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 5.68.0
Qt Version: Qt 5.12.8 (kompiliert gegen 5.12.8)

ADDITIONAL INFORMATION
After searching for files whose names meet certain criteria and which contain e.g. a given keyword, I can click on a button "Feed to listbox". (Deutsch: In Dateifenster einspeisen)

Then Krusader 2.7.2 asks me for a name for this search result list, a so called virtual file system (VFS). By entering a name, I create such a VFS.

Then I can use the VFS like any other active directory, e.g. copy files from there or move them to some other location or delete them (in fact, deleting the result list really deletes the files from where they were found, which is very dangerous since it differs from when one knows from Total commander and the like)! So this might be considered a security issue, although described in the documentation on page 36.

Krusader seems to memorize searches and search results in ~/.config/krusaderrc and possibly also in ~/.local/share/krusader/virtualfilesystem.db.

Over time, therefore, more and more residues accumulate in these files. An easy way to get rid of that without uninstalling Krusader and purging all its associated files is important. 

In conjunction with VFS Krusader should not delete many files without asking a security prompt where it indicates how many files it would delete besides the VFS handle. There should be a means to just get rid of those VFS handles and keeping the files which are shown in it.

(Unfortunately I was unable to compile Krusader 2.8.0 on my Xubuntu 20.04 system.)
Comment 1 adalbert.hanssen 2023-06-21 21:57:09 UTC
Created attachment 159824 [details]
Script to reset Krusader (i.e. get rid of all vfs together)

Explanations see https://askubuntu.com/questions/1440560/how-can-i-get-rid-of-names-of-virtual-file-systems-made-by-krusader-after-feed
Comment 2 Alex Bikadorov 2024-12-07 15:10:28 UTC
You can go to "virt:///" - the root directory of all virtual directories and delete the directories you want.
Deleting single files in a virtual directory is currently not supported.

Does this solve your issue?
Comment 3 adalbert.hanssen 2024-12-10 22:41:50 UTC
(In reply to Alex Bikadorov from comment #2)
> You can go to "virt:///" - the root directory of all virtual directories and
> delete the directories you want.
> Deleting single files in a virtual directory is currently not supported.
> 
> Does this solve your issue?

Thank you for your hint. It solves my problem even better than my script, which requires you to create the ~/.config/krusaderrc_reset file before using it for the first time.

There is no directory with the name "virt:" or "virt" in the directory tree of my computer. virt:/// looks to be a purely krusader-internal entity.

In my post I mentioned the file ~/.local/share/krusader/virtualfilesystem.db, which changes its content after feeding search results to a listbox or after the operation which you describe. I guess, this file physically is what is called the virtual file system.

Trying out your advice I created several such search result listboxes. I can select n of them (internal to krusader) in "virt:" and delete them. Then a message appears asking me whether I wanted to delete theses n entries, the physical files are kept.
So your advice solves my problem.

But I think the user interface should becomre clearer and it should enable one to manually manipulate the listbox too (as an alternative to manipulating physical files).

One often has to refine some search by by excluding some found items manually and possibly applying another search to the manipulated search results. So it probably would be a good thing to be able to delete single found files from a listbox (without deleting the files) and then continue searches from such a manually modified set.

As I have observed, this can be done by manipulating the proper line in ~/.local/share/krusader/virtualfilesystem.db. But that's cumbersome and error prone. To enable such search refinements with manual manipulations of search results, I suggest 
1. to add a checkbox switching between manipulating selected file in the listbox rather than the physical files (it should default to that) or really manipulate the physical files themselves. 
2. when it comes to delete physical files by a listbox operation, there always should be a safety question..
Comment 4 Alex Bikadorov 2024-12-11 09:19:15 UTC
> There is no directory with the name "virt:" or "virt" in the directory tree
> of my computer. virt:/// looks to be a purely krusader-internal entity.

yes, "virt://" is an internal protocol by Krusader. The parent directories in it are purely virtual.

> But I think the user interface should becomre clearer and it should enable
> one to manually manipulate the listbox too (as an alternative to
> manipulating physical files).
> 
> One often has to refine some search by by excluding some found items
> manually and possibly applying another search to the manipulated search
> results. So it probably would be a good thing to be able to delete single
> found files from a listbox (without deleting the files) and then continue
> searches from such a manually modified set.
> 
> As I have observed, this can be done by manipulating the proper line in
> ~/.local/share/krusader/virtualfilesystem.db. But that's cumbersome and
> error prone. To enable such search refinements with manual manipulations of
> search results, I suggest 
> 1. to add a checkbox switching between manipulating selected file in the
> listbox rather than the physical files (it should default to that) or really
> manipulate the physical files themselves. 
> 2. when it comes to delete physical files by a listbox operation, there
> always should be a safety question..

The easiest way is to add an option (maybe as context menu entry + shortcut) to remove entries (not physical files) in virtual directories. Please create a new bug report with importance "wishlist" for this. This bug report has been solved.