Bug 489164 - Empty Trash option in sidebar context menu greyed out despite trash
Summary: Empty Trash option in sidebar context menu greyed out despite trash
Status: CONFIRMED
Alias: None
Product: dolphin
Classification: Applications
Component: general (other bugs)
Version First Reported In: 24.05.1
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-25 09:26 UTC by Gert Oja
Modified: 2024-11-17 13:36 UTC (History)
3 users (show)

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


Attachments
Icon is full but menu item is greyed out (6.46 KB, image/png)
2024-06-25 09:26 UTC, Gert Oja
Details
Screen recording of bug (1.39 MB, video/x-matroska)
2024-07-09 09:15 UTC, Gert Oja
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gert Oja 2024-06-25 09:26:24 UTC
Created attachment 170950 [details]
Icon is full but menu item is greyed out

SUMMARY

Despite there being a directory and a file in the trash, and the Empty Trash button in the toolbar (top right) is available, the Empty Trash menu item in the right-click menu is not available. The Trash icon is also in the solid "full" state despite the option being unavailable.

I'm not sure what caused this as I can't reproduce this again. One of the directories was a hidden directory starting with a dot, but this doesn't seem to affect it.

STEPS TO REPRODUCE
1. Place items in trash
2. Right click on Trash icon in sidebar or the file area in the Trash view

OBSERVED RESULT

Empty Trash option is greyed out and unclickable

EXPECTED RESULT

Empty Trash option should be clickable

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux
(available in About System)
KDE Plasma Version: 6.1.0
KDE Frameworks Version: 6.3.0
Qt Version: 6.7.2

ADDITIONAL INFORMATION
Comment 1 TraceyC 2024-07-01 17:48:07 UTC
This seems similar to https://bugs.kde.org/show_bug.cgi?id=424917 in that the icon isn't reflecting the actual state of the Trash folder

I attempted to reproduce, but wasn't able to with Dolphin 24.05.1
Emptied the Trash folder
Selected a directory and a few files, pressed Delete to add them to the Trash folder
Right clicked the Trash icon at the left of Dolphin - it was enabled and I was able to empty the trash folder

I also don't see any other reports of this behavior. 
Are there any settings, plugins or anything else you may have customized that might affect this?
Comment 2 Gert Oja 2024-07-09 09:12:20 UTC
(In reply to TraceyC from comment #1)
> This seems similar to https://bugs.kde.org/show_bug.cgi?id=424917 in that
> the icon isn't reflecting the actual state of the Trash folder
> 
> I attempted to reproduce, but wasn't able to with Dolphin 24.05.1
> Emptied the Trash folder
> Selected a directory and a few files, pressed Delete to add them to the
> Trash folder
> Right clicked the Trash icon at the left of Dolphin - it was enabled and I
> was able to empty the trash folder
> 
> I also don't see any other reports of this behavior. 
> Are there any settings, plugins or anything else you may have customized
> that might affect this?

This seems to be happening due to files or folders being moved to an otherwise empty Trash from Visual Studio Code (version 1.91.0)
Comment 3 Gert Oja 2024-07-09 09:15:44 UTC
Created attachment 171492 [details]
Screen recording of bug
Comment 4 Gert Oja 2024-07-09 09:16:49 UTC
The screen recording indicates that this seems to be the opposite of the bug you've mentioned.
Comment 5 TraceyC 2024-07-09 18:07:32 UTC
Thank you for the additional information. How did you install VS Code? Was it through the Arch repo, AUR, flatpak etc? I ask because I can reproduce with flatpak  installs but not with snaps or an install from the Solus repo.


Details

Solus Plasma: I wasn't able to reproduce with VS Code, installed via package from the repo
When I deleted a file in VS Code, it did not immediately appear in Dolphin. I had to refresh the window to show the files in the trash.
Both trash icons were active.
I *was* able to reproduce with VS Codium installed via flatpak

❯ eopkg info vscode
Installed package:
Name                : vscode, version: 1.91.0, release: 214

KDE Neon:  I *was* able to reproduce the behavior.
VS Codium is installed via flatpak (no apt package available)

tracey@tracey-kde-neon-vm:~$ flatpak list |grep vsc
Peter Squicciarini      com.vscodium.codium     1.91.0.24190    stable  system

Kubuntu:
- "codium" is snap only, as is VS Code. I am not able to reproduce with these.
When I deleted a file in VS Code, it *did* immediately appear in Dolphin in the Trash folder, even before I switched to that window.
Both trash icons were active.
Preconditions:
In VS Code, Settings: Enable Trash - checked (default)
Open Dolphin and navigate to Trash

Steps:
Open a folder in VS Code, right click a file and Delete
In Dolphin use F5 to refresh the window, the deleted file is shown
Right click the Trash icon on the left in Places
Comment 6 Gert Oja 2024-07-09 19:07:57 UTC
(In reply to TraceyC from comment #5)

I have no issue with the Trash icon. The problem is that the context menu option to actually empty the trash is disabled (the trash icon is inverted in the image because the menu item is active, there is no outline - this indicates that the trash can is indeed full). The taskbar button to empty the trash in the top right corner in the Trash view is clickable and works.

I installed VSCode from the AUR via visual-studio-code-bin
Comment 7 TraceyC 2024-07-10 15:44:55 UTC
When I said the trash icon was active, I meant that Empty Trash in the right click menu item was working. My apologies for being unclear.