Delete to trash doesn't work on DEs which don't use gvfs

Bug #1136025 reported by Francois van der Ven
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Variety
Fix Released
Medium
Peter Levi

Bug Description

Hi, the delete to trash item in the tray icon doesn't work here.

1. variety version 0.4.13
2. KDE 4.8.5
3. Kubuntu 12.04

4. This is what the variety.log says in the .config/variety dir:

ERROR: move_to_trash() 'Exception in move_to_trash'
Traceback (most recent call last):
  File "/opt/extras.ubuntu.com/variety/variety/VarietyWindow.py", line 1440, in move_to_trash
    self.thumbs_manager.remove_image(file)
  File "/opt/extras.ubuntu.com/variety/variety/ThumbsManager.py", line 385, in remove_image
    self.images = [f for f in self.images if f != file]
TypeError: 'NoneType' object is not iterable

Attached is the varietylog.txt file with verbose info. It gives a suspicious line saying sh: 1: gvfs-trash: not found. Now my guess is I can install the gvfs-bin package, but since I'm not running gnome I'm not sure if this is a good idea. Please tell me if otherwise :)

Thanks for this great tool!

Revision history for this message
Francois van der Ven (francoisvdven) wrote :
description: updated
Revision history for this message
Peter Levi (peterlevi) wrote :

Yes, unfortunately it turned out there is no DE-agnostic way to delete to trash, so at the time I solved the problem using gvfs without realizing this excludes KDE completely. We'll need a dedicated script for this, similar to set_wallpaper, which calls the appropriate command for each DE.

The exception is a separate problem that will be easy to fix.

Changed in variety:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → Peter Levi (peterlevi)
Peter Levi (peterlevi)
summary: - Delete to trash doesn't work
+ Delete to trash doesn't work on DEs which don't use gvfs
Peter Levi (peterlevi)
Changed in variety:
status: Confirmed → Fix Committed
Revision history for this message
Peter Levi (peterlevi) wrote :

The actual fix was to use trash-put, so I added a new dependency - trash-cli, but also fallback to gnome-gvfs or kfmclient.
The trash command now looks like this:

'gvfs-trash "%s" || trash-put "%s" || kfmclient move "%s" trash:/' % (file, file, file)

This makes it possible to later move the trash-cli dependency from Depends into Recommends section (once I trick Quickly into doing this one way or another...).

Fixed deb attached.

Peter Levi (peterlevi)
Changed in variety:
status: Fix Committed → Fix Released
milestone: none → 0.4.15
Revision history for this message
Bsienn (bsienn) wrote :

I installed trash-cli and tried the delet to trash option and now it works. But It takes 6 seconds to delete a picture. i use HD1080p pics. any thoughts on the speed of deletion?

Ubuntu 14.04.1
Variety 0.4.20 (Beta from ppa/Next)

Revision history for this message
Peter Levi (peterlevi) wrote :

That's an issue of the Beta, as it makes a server-request to report the trash action before it actually removes the file. But 6 seconds is somewhat slow. How fast does https://vrty.org load where you are? What is your ping time to vrty.org?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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