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

[BUG] Deselecting all commands from submenu actually displays all commands instead of none in the submenu #170

Open
ulu opened this issue Aug 1, 2023 · 3 comments
Assignees
Labels

Comments

@ulu
Copy link

ulu commented Aug 1, 2023

Describe the bug
removing all entries from submenu resulting in a garbaged submenu.

To Reproduce
Steps to reproduce the behavior:

  1. go to UNC-Path and right right click on an entry

  2. click on "Path Copy > Settings..."

  3. remove all check marks

  4. set check marks for "copy long UNC path" in "Main menu" and "Submenu"

  5. click "OK" button

  6. right right click on an UNC-Path entry

  7. see a main menu entry for "copy long UNC path"

  8. right right click on an UNC-Path entry

  9. click on "Path Copy > "

  10. see a Submenu with 2 entries: "copy long UNC path" and "Settings ..."

  11. click on "Path Copy > Settings..."

  12. remove all check marks

  13. set check marks for "copy long UNC path" only in "Main menu"

  14. click "OK" button

  15. right right click on an UNC-Path entry

  16. see a main menu entry for "copy long UNC path"

  17. right right click on an UNC-Path entry

  18. click on "Path Copy > "

  19. [ERROR] see a Submenu with lots of entries

Expected behavior
I want to see no submenu entries except "Settings ..." if I have only "Main menu" entries. My preferred solution is to get rid of the menu entry in context menu (explorer right click) at all. The visibility of the submenu structure in context menu (explorer right click) should be configurable. Because the settings are accessible over windows menu and I only want the Opt-In features I checked in pathcopycopy configuration.

Screenshots
01_settings
02_garbaged_submenu

Software (please complete the following information):

  • OS: Windows 10 Enterprise, 22H2
  • Path Copy Copy Version 20.0
@ulu ulu added the bug label Aug 1, 2023
@clechasseur
Copy link
Owner

This is due to this part of the code:

https://github.com/clechasseur/pathcopycopy/blob/default/PathCopyCopy/src/PathCopyCopyContextMenuExt.cpp#L422-L423

I think this is due to a legacy behavior that should have been removed, but I'm not sure yet.

@clechasseur clechasseur changed the title [BUG] garbaged submenu [BUG] Deselecting all commands from submenu actually displays all commands instead of none in the submenu Aug 2, 2023
@ulu
Copy link
Author

ulu commented Aug 8, 2023

Seems a good line to start. You could check it by removing the complete line from the code. But you will get a nullptr exception in line 429. So you have to guard this code with a check for a nullptr like
if (pvspPlugins != nullptr)
In addition I would not rely on the try-catch because it is forwarded in the catch block.

Currently I have no cpp environment installed. So I cannot help here at the moment...

@clechasseur clechasseur self-assigned this Aug 9, 2023
@clechasseur
Copy link
Owner

I think this is mostly due to legacy behavior - the way to store commands displayed in the submenu has evolved quite a lot over the years and gone through at least two major refactorings. Now, we should consider an empty list to be different from the absence of a setting - we do that for the main menu, but not for the submenu, which is a bug.

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

No branches or pull requests

2 participants