"Empty trash" button still disabled when trash contains files.

Bug #376445 reported by Sergey Fukanchik
40
This bug affects 8 people
Affects Status Importance Assigned to Milestone
Nautilus
Expired
Medium
nautilus (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Binary package hint: nautilus

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.

It looks like i have same problem as in this bug: https://bugs.launchpad.net/ubuntu/+source/nautilus/+bug/335617
I open new bug as suggested here: https://bugs.launchpad.net/ubuntu/+source/nautilus/+bug/335617/comments/5
And all entries in trash are writable by current user.

ProblemType: Bug
Architecture: amd64
DistroRelease: Ubuntu 9.04
ExecutablePath: /usr/bin/nautilus
MediaBuild: Ubuntu 9.04 "Jaunty Jackalope" - Release amd64 (20090420.1)
Package: nautilus 1:2.26.2-0ubuntu2
ProcEnviron:
 LANG=ru_RU.UTF-8
 SHELL=/bin/bash
SourcePackage: nautilus
Uname: Linux 2.6.28-11-generic x86_64

Revision history for this message
Sergey Fukanchik (fuxx) wrote :
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. Please answer these questions:

 * Is this reproducible?
 * If so, what specific steps should we take to recreate this bug?
 * Does gvfs-monitor works on the directory?

 This will help us to find and resolve the problem.

Changed in nautilus (Ubuntu):
assignee: nobody → Ubuntu Desktop Bugs (desktop-bugs)
importance: Undecided → Low
status: New → Incomplete
Revision history for this message
Sergey Fukanchik (fuxx) wrote :

> 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.

Revision history for this message
Sergey Fukanchik (fuxx) wrote :

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. */
  }

Revision history for this message
Sebastien Bacher (seb128) wrote :

It would be nice if somebody having the issue could send the bug the to the people writting the software (https://wiki.ubuntu.com/Bugs/Upstream/GNOME)

Changed in nautilus (Ubuntu):
status: Incomplete → New
Revision history for this message
Sebastien Bacher (seb128) wrote :

What icon theme do you use? The code probably check the icon to update the display but should not rely on that to update the button

Revision history for this message
Sergey Fukanchik (fuxx) wrote :

> What icon theme do you use?
The name of theme is in russian and corresponding word in English will be "Clearance".
> The code probably check the icon to update the display but should not rely on that to update the button
Trashapplet does exactly this. It checks if it's own current icon of trashcan is the same as trashcan's. And uses itemcount to update tooltip.

Unfortunately after restarting nautilus (logout/login) i have no this issue. Will wait until it happens again.

I wrote simple code (attaching) to check icon name but obviously now it shows that all is ok.

Revision history for this message
japrogramer (japrogramer) wrote :

i have the same problem in the same distribution of ubuntu (9.04)
watch my screen shots
different theme different icon theme

Revision history for this message
Steve McGrath (smcgrath23) wrote :

I've got this one too, 2-day old Jaunty install, en_US.UTF-8 locale, default Ubuntu Gnome theme. Can empty trash from trash applet right-click menu, but opening trash in Nautilus shows disabled "Empty Trash" button.

Nautilus is: Version: 1:2.26.2-0ubuntu2

Revision history for this message
Sergey Fukanchik (fuxx) wrote :

Some time ago i had opposite situation: nautilus trash window works fine, but applet shows wrong number of trashcan items in tooltip. The problem isn't related to use or ignoring of
g_file_query_info(GFileInfo.G_FILE_ATTRIBUTE_TRASH_ITEM_COUNT).

Revision history for this message
Pedro Villavicencio (pedro) wrote :

Thanks for your bug report. This bug has been reported to the developers of the software. You can track it and make comments here: http://bugzilla.gnome.org/show_bug.cgi?id=590277

Changed in nautilus (Ubuntu):
status: New → Triaged
Changed in nautilus:
status: Unknown → New
Revision history for this message
Olleg Samoylov (olleg) wrote :

Ubuntu 9.10. This bug is here still. :)

Changed in nautilus:
importance: Unknown → Medium
Revision history for this message
Abhinav Upadhyay (er-abhinav-upadhyay) wrote :

yaay, I hit this bug too today.

Running Maverick

Changed in nautilus:
status: New → Incomplete
Revision history for this message
Sebastien Bacher (seb128) wrote :

Is that still an issue? Could you describe extra steps to get it?

Changed in nautilus (Ubuntu):
assignee: Ubuntu Desktop Bugs (desktop-bugs) → nobody
status: Triaged → Incomplete
Revision history for this message
Sergey Fukanchik (fuxx) wrote :

Sebastien, what version are you asking about? There are several versions mentioned in this thread.

I am on Lucid Lynx and have not seen this for some time now.

Revision history for this message
Sebastien Bacher (seb128) wrote :

recent versions, but if it's fixed on lucid and we didn't get recent report let's assume the issue is resolved, if anyone still get things not working as they should on precise open a new bug

Changed in nautilus (Ubuntu):
status: Incomplete → Fix Released
Changed in nautilus:
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.