Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a shortcut to actionRefreshSelected action #145

Closed
wants to merge 1 commit into from

Conversation

brunetton
Copy link

Hi,

Blabla

I just discovered QDirStat and I've to say that I'm super happy about this ! This is amazing, more or less exactly the tool I was dreaming of 💖 So; thank you a lot for this (just bought you a beer via the support link)

Actual PR comment

I love using keyboard and leaving touchpad away. This was almost possible due to the wonderful work you did on the UI. But I (only) missed one super-usefull shortcut to refresh selected folder.
Here it is.

@shundhammer
Copy link
Owner

shundhammer commented Oct 14, 2020

Since that action is also available from the menu, there was always a key combination to invoke it:

[Alt] [F]   [F]

(Menu File -> Refresh Selected)

@brunetton
Copy link
Author

Indded ... but you could say that for all the shortcuts you've added in the app; so in that case, what's the point of a shortkey when you can access all actions from the menu ?
For example, I can trigger "Open file manager here" doing [Alt] [C] [F] so I could say: why is the point of adding a shortcut for this action ? The answer is: because this is a super common action, used often while using the software, and this is wayyyy more convenient to remember and use [Ctrl]+[F] than [Alt] [C] [F].

So except if you do not consider that "Refresh selected" is not a common used action, I don't see why you seems to be reluctant to adding a shortcut to this action. This will not prevent users that are used to do [Alt] [F] [F] from keeping doing this, and this offers a quicker way to use this action to other users that (as me) missed it.

@brunetton
Copy link
Author

I wouldn't like to have to maintain a fork of QDirStat only for the add of a simple shortkey :(

@shundhammer
Copy link
Owner

shundhammer commented Oct 14, 2020

Honestly, I am not very happy with using [Ctrl] [R] for that:

  • I found that action very uncommon; I rarely use it at all. Plain Refresh ([F5]) is so quick that I never bother with refreshing just the selected branch.

    For cleanup actions that change the directory that the current file or directory is in (Move to Trash, Delete), this "refresh selected" is typically done automatically anyway (that's the Refresh Policy of the cleanup). And consuming a very common key combination like [Ctrl] [R] for an uncommon action appears counterproductive to me; there are only 26 of those available, and a lot of them tend to have predefined meanings from other contexts (like [Ctrl] [C] for Copy, [Ctrl] [V] for Paste, [Ctrl] [Q] for Quit).

  • Since plain Refresh (refreshing everything) is started with the [F5] key (like in all web browsers), using [Ctrl] [R] for such a closely related action is very inconsistent. But there is a problem with using any modifier combination like [Shift] [F5], [Ctrl] [F5], [Alt] [F5]: Those are commonly used by window managers or in general the desktop environment.

  • If there is really a need to use that action frequently, and a case can be made why the existing [Alt] [F] [F] key combination is too unwieldy, this should go further: Just like with cleanup actions, it should refresh the directory if a directory is currently selected, or the parent directory if a file is currently selected. Right now the action is disabled if a non-directory is selected.

Please explain your use case.

@shundhammer
Copy link
Owner

I am really curious. How are you using QDirStat that makes you want to use that "Refresh Selected" action so often that you wish you had that keyboard shortcut for it? Maybe I overlooked a common use case.

@brunetton
Copy link
Author

brunetton commented Oct 15, 2020

Thanks for your detailed answer, and sorry for the last reply, I live in France, and there's a quite big time time difference !

Honestly, I am not very happy with using [Ctrl] [R] for that:

  • I found that action very uncommon; I rarely use it at all. Plain Refresh ([F5]) is so quick that I never bother with refreshing just the selected branch.

I do not really agree with your assumption "Plain Refresh ([F5]) is so quick". In my classical use case:

  • plain refresh of my home directory: ~2m30
  • plain refresh a fuse mounted sshfs hard drive I frequently use: > 20mn

In that cases, refreshing only a branch is vital (but that's not the purpose here)

For cleanup actions that change the directory that the current file or directory is in (Move to Trash, Delete), this "refresh selected" is typically done automatically anyway (that's the Refresh Policy of the cleanup).

Indeed, this is totally right. My typical case is using open with file browser action. I could add a refresh policy after that action but I don't really want to refresh the sub-tree all the time I'm using this action because I do not delete files each time, and sometimes the sub-tree is deep and I'm working on network mounted volumes (the subtree refresh could take a lot of time)

And consuming a very common key combination like [Ctrl] [R] for an uncommon action appears counterproductive to me; there are only 26 of those available, and a lot of them tend to have predefined meanings from other contexts (like [Ctrl] [C] for Copy, [Ctrl] [V] for Paste, [Ctrl] [Q] for Quit).

I totally understand and agree on this point ! Ctrl-R could be replaced by something less "intrusive"

  • Since plain Refresh (refreshing everything) is started with the [F5] key (like in all web browsers), using [Ctrl] [R] for such a closely related action is very inconsistent. But there is a problem with using any modifier combination like [Shift] [F5], [Ctrl] [F5], [Alt] [F5]: Those are commonly used by window managers or in general the desktop environment.

Indeed

  • If there is really a need to use that action frequently, and a case can be made why the existing [Alt] [F] [F] key combination is too unwieldy, this should go further: Just like with cleanup actions, it should refresh the directory if a directory is currently selected, or the parent directory if a file is currently selected. Right now the action is disabled if a non-directory is selected.

Please explain your use case.

My use case is:

  • I see a folder that's too big
  • I open it with the file browser to have a better gain control over what files I could delete, and what files I have to keep
  • I come back to QDirStat and I'd like to refresh the folder I just houseworked

But, as I explained above, I do not want the refresh to be done automatically as I sometimes work on network mounted volumes with deep trees and refreshing could take a lot of time.

Update

I just thought of a workaround to satisfy my personal needs: I can define a Refresh sub-tree action that do not do anything (command line will be empty, or just a kind on no-op) but with a refresh policy. I'll be able to assign a shortkey to this action using & syntax in title: &Refresh sub-tree

So I think I'll be happy with this workaround :)

Thanks a lot for your time, and sorry for it !

@brunetton brunetton closed this Oct 15, 2020
@shundhammer
Copy link
Owner

shundhammer commented Oct 15, 2020

OK, thanks for coming back for this.

2:30 min for re-scanning a home directory that is now already cached in the kernel is pretty long. I made benchmarks some time ago, and back then my problem had been that re-scans from hot caches are so quick that it's hard to measure any meaningful difference: #97

That was 1.5 seconds for cached values for a 230 GB / 216000 items filesystem compared to about 25 seconds from dropped caches.

sshfs via fuse is another matter; it does not surprise me at all that this is slow. In that use case, maybe try experimenting with cache files; create them on the remote machine and copy them to your local workstation? See https://github.com/shundhammer/qdirstat/blob/master/doc/QDirStat-for-Servers.md

@shundhammer
Copy link
Owner

Please try the lastest commit: 2647f7c

See also https://github.com/shundhammer/qdirstat#latest-news

It's now on [F6], and if a file is selected, it now refreshes the parent directory.

@shundhammer
Copy link
Owner

As for cleanup hotkeys: It's not accessible from the GUI, but you can add a line like

Hotkey=Ctrl+R

to any of them. Check out the existing ones in your ~/.config/QDirStat/QDirStat-cleanup.conf file.

@brunetton
Copy link
Author

As for cleanup hotkeys: It's not accessible from the GUI, but you can add a line like

Hotkey=Ctrl+R

to any of them. Check out the existing ones in your ~/.config/QDirStat/QDirStat-cleanup.conf file.

Super usefull ! Thank you very much. This totally cover my use case 👍

@stdedos
Copy link

stdedos commented Nov 16, 2020

Slightly related to #136

Thanks :-D

@brunetton
Copy link
Author

In brief, for anyone that comes here and don't want to read the whole story:

  • the workaround is to define a "noop" operation that refresh current item when finished
  • as keyboard shortkeys can't be defined via UI, we edit config file

Add to ~/.config/QDirStat/QDirStat-cleanup.conf

[Cleanup_14]
Active=true
AskForConfirmation=false
Command=0
OutputWindowAutoClose=false
OutputWindowPolicy=ShowNever
Recurse=false
RefreshPolicy=RefreshThis
Title=Refresh current
WorksForDir=true
WorksForDotEntry=false
WorksForFile=true
Hotkey=Ctrl+R

⚠ Adapt the action number ([Cleanup_14] in this example) to avoid duplicates

@shundhammer
Copy link
Owner

There is F6, released with V1.7.1 and already available since 2020-10-15.

@brunetton
Copy link
Author

There is F6, released with V1.7.1 and already available since 2020-10-15.

Thanks a lot @shundhammer

But I'm was installing Qdirstat for a friend using Ubuntu and the v1.7.1 isn't available for now in Ubuntu 20.04 LTS

@stdedos
Copy link

stdedos commented Sep 22, 2021

Unfortunately, you have to compile it yourself. @shundhammer is against even trying to commit packaging code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants