After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 590277 - "Empty trash" button still disabled when trash contains files
"Empty trash" button still disabled when trash contains files
Status: RESOLVED INCOMPLETE
Product: nautilus
Classification: Core
Component: Trash
2.26.x
Other Linux
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-07-30 15:24 UTC by Pedro Villavicencio
Modified: 2013-04-08 15:04 UTC
See Also:
GNOME target: ---
GNOME version: 2.25/2.26



Description Pedro Villavicencio 2009-07-30 15:24:36 UTC
this report has been filed here:

https://bugs.edge.launchpad.net/ubuntu/+source/nautilus/+bug/376445

"Empty trash button in Nautilus shows up disabled even though there are items in the trash and the trash applet has the Empty trash menu item enabled."

"

> Is this reproducible?
Yes if i empty trash via applet menu item, delete something the button in nautilus is still disabled.

> If so, what specific steps should we take to recreate this bug?
I installed Ubuntu 9.04 and there already was this problem. I can't find out steps to reproduce, because i can't make this button enabled. It's always disabled.

> Does gvfs-monitor works on the directory?
On which directory? You mean on .local/share/Trash/files? Yes, when i delete something it writes:
Directory Monitor Event:
Child = /home/fuxx/.local/share/Trash/files/123
Event = CREATED

If this will be helpful i can use gdb to see values of variables in running nautilus.
"

"

Probably this related to gnome theme or russian language or both.
In libnautilus-private/nautilus-trash-monitor.c:238 in update_info_cb there is following code:

empty = TRUE;
if (G_IS_THEMED_ICON (icon)) {
                                names = g_themed_icon_get_names (G_THEMED_ICON (icon));
                                for (i = 0; names[i] != NULL; i++) {
                                        if (strcmp (names[i], NAUTILUS_ICON_TRASH_FULL) == 0) {
                                                empty = FALSE;
                                                break;
                                        }
                                }
}
if (trash_monitor->details->empty != empty) {
    /* Change emptyness status and notify
        via signal everyone who cares. */
}

I wonder why this code checks trashcan icon to see if the trash is full. Isn't there some trashcan API?!

Let's look into code which works: trashapplet from gnome-applets. Yes there is such API, g_file_query_info(GFileInfo.G_FILE_ATTRIBUTE_TRASH_ITEM_COUNT):

info = g_file_query_info (applet->trash,
                            G_FILE_ATTRIBUTE_STANDARD_ICON","
                            G_FILE_ATTRIBUTE_TRASH_ITEM_COUNT,
                            0, NULL, &error);

  icon = g_file_info_get_icon (info);
  items = g_file_info_get_attribute_uint32 (info,
                                            G_FILE_ATTRIBUTE_TRASH_ITEM_COUNT);
  if (items != applet->items) {
     /* Update UI here. */
  }
"

There's a few more comments on the downstream report in case you're looking for more information. Thanks in advance.
Comment 1 William Jon McCann 2012-08-14 03:20:34 UTC
How is this reproduced? I'm not seeing it.
Comment 2 Timothy Arceri 2012-11-21 04:59:03 UTC
The upstream bug report has been closed as the problem can no longer be reproduced.
Comment 3 Tobias Mueller 2013-04-08 15:04:30 UTC
Closing this bug report as no further information has been provided. Please feel free to reopen this bug if you can provide the information asked for.
Thanks!