Gnome and KDE trash are incompatible. Was: usdigikam expects trash to be in ~/Desktop/Trash - causes error in Ubuntu

Bug #75435 reported by Menachem Shapiro
12
Affects Status Importance Assigned to Milestone
digikam (Ubuntu)
Fix Released
Undecided
Brandon Holtsclaw

Bug Description

Binary package hint: digikam

I am using digikam version 0.8.2-2ubuntu1 in Ubuntu (Gnome based). I tried to delete a picture and got an error message saying "could not rename file FILENAME" (where FILENAME was the name of the file it was trying to delete).

I looked around and found this bug report on KDE's site: http://bugs.kde.org/show_bug.cgi?id=123120

In the comments on the bug, someone advises to link ~/.Trash to ~/Desktop/Trash. Doing so solves the problem, and deleting the file is possible.

I am assuming that this is because KDE (and Kubuntu) uses ~/Desktop/Trash as the trashcan, while Gnome (and Ubuntu) uses ~/.Trash.

Can the program be tweaked to look for the trash in either place?

Revision history for this message
Achim Bohnet (allee) wrote :

That's strange. With kubuntu edgy my trash is in

     ~/.local/share/Trash/

when I move this directory away and move a picture in digikam
to Trash it gets recreated.

Can you check that you 'trashed' images from digikam really end up in ~/.Trash and not below ~/.local/share/Trash/* ?

When you start digikam from the command line
is there anything suspect written to the termial
when you delete an image in digikam?

What method are you using to delete picture?
   o RMB over a thumbnail and 'Move to Trash'
   o drag and drop to gnome trash icon
   o or ...

What's the output of 'digikam --version'?

Achim

Revision history for this message
Menachem Shapiro (menachem) wrote : Re: [Bug 75435] Re: digikam expects trash to be in ~/Desktop/Trash - causes error in Ubuntu

B"H
Achim

Before I start, I want to say that since I posted this bug, I upgraded
to digikam 0.9.0, using your unofficial packages at
http://www.mpe.mpg.de/~ach/kubuntu/edgy/Pkgs.php.

On 1/16/07, allee <email address hidden> wrote:
> That's strange. With kubuntu edgy my trash is in
>
> ~/.local/share/Trash/
>
> when I move this directory away and move a picture in digikam
> to Trash it gets recreated.
>
> Can you check that you 'trashed' images from digikam really end up in
> ~/.Trash and not below ~/.local/share/Trash/* ?

I don't have a Trash folder in ~/.local/share/Trash. All I have is an
applications folder.

The Trashed images really end up in ~/.Trash, here is the output:

-----------------------------------
mshapiro@eskimo:~$ ls -l /home/mshapiro/Desktop/Trash
lrwxrwxrwx 1 mshapiro mshapiro 22 2006-12-11 21:15
/home/mshapiro/Desktop/Trash -> /home/mshapiro/.Trash/
mshapiro@eskimo:~$ ls /home/mshapiro/Desktop/Trash
IMG_1278.JPG IMG_1328.JPG IMG_1366.JPG IMG_1586.JPG IMG_1619.JPG
IMG_1279.JPG IMG_1329.JPG IMG_1368.JPG IMG_1588.JPG IMG_1620.JPG
IMG_1280.JPG IMG_1331.JPG IMG_1377.JPG IMG_1592.JPG IMG_1621.JPG
IMG_1290.JPG IMG_1332.JPG IMG_1384.JPG IMG_1602.JPG IMG_1622.JPG
IMG_1298.JPG IMG_1334.JPG IMG_1392.JPG IMG_1603.JPG IMG_1623.JPG
IMG_1299.JPG IMG_1335.JPG IMG_1395.JPG IMG_1606.JPG IMG_1624.JPG
IMG_1300.JPG IMG_1337.JPG IMG_1401.JPG IMG_1609.JPG IMG_1625.JPG
IMG_1301.JPG IMG_1346.JPG IMG_1402.JPG IMG_1610.JPG IMG_1627.JPG
IMG_1309.JPG IMG_1347.JPG IMG_1403.JPG IMG_1611.JPG IMG_1628.JPG
IMG_1318.JPG IMG_1353.JPG IMG_1404.JPG IMG_1612.JPG IMG_1630.JPG
IMG_1322.JPG IMG_1354.JPG IMG_1409.JPG IMG_1614.JPG IMG_1631.JPG
IMG_1323.JPG IMG_1355.JPG IMG_1413.JPG IMG_1616.JPG IMG_1638.JPG
IMG_1325.JPG IMG_1358.JPG IMG_1417.JPG IMG_1617.JPG IMG_1641.JPG
IMG_1326.JPG IMG_1359.JPG IMG_1555.JPG IMG_1618.JPG
----------------------------------------

>
> When you start digikam from the command line
> is there anything suspect written to the termial
> when you delete an image in digikam?
>

I just deleted the ~/Desktop/Trash symbolic link and tried deleting a
file. Here is the message that came up in the terminal:
OggS-SEEK: at 704 want 47096 got 23104 (diff-requested 46392)
OggS-SEEK: at 47040 want 1032 got 0 (diff-requested -46008)

> What method are you using to delete picture?
> o RMB over a thumbnail and 'Move to Trash'
> o drag and drop to gnome trash icon
> o or ...

RMB over a thumbnail and 'Move to Trash'.
Hitting the Delete Key in the digiKam Image Editor also gives the same error.

>
> What's the output of 'digikam --version'?

Again, this is the output from the unofficial package, but:
mshapiro@eskimo:~$ digikam --version
Qt: 3.3.6
KDE: 3.5.5
digiKam: 0.9.0

I hope this helps, as the problem seem to still be with 0.9.0.

Menachem

> Achim
>
> --
> digikam expects trash to be in ~/Desktop/Trash - causes error in Ubuntu
> https://launchpad.net/bugs/75435
>

Revision history for this message
Achim Bohnet (allee) wrote : Re: digikam expects trash to be in ~/Desktop/Trash - causes error in Ubuntu

Hi Menachem,

digikam 0.9 or 0.8.2 does not matter because they use the
trash support from kdebase.

 I've create a fresh default ubuntu edgy
installation, and aptitude install'ed digikam, and Pictures I deleted
in digikam ended up in ~/.local/share/Trash (that did not
exists before I started digikam.

Maybe the protection of ~/.local is wrong so kio_trash
can't create it?

Nevertheless creating a soft link

    ln -s ~/.Trash ~/.local/share/Trash

should fix your problem (tested here works fine.
Gnome trash gets the counting wrong from because it
does not understand the XDG draft but that's cosmetic.)

Anyway. The hole stuff is not a bug in digikam. digikam
uses trash kio slave (as all conformant KDE apps should to).
So running GNOME apps in KDE desktop or vice versa
would have the problem

The kio_trash implements the XDG trash standard currently at http://www.ramendik.ru/docs/trashspec.html. This draft is
referenced at http://www.freedesktop.org/wiki/Standards.

<quote>
  For every user2 a “home trash” directory MUST be available3. Its name and location are $XDG_DATA_HOME/Trash ; $XDG_DATA_HOME is the base directory for user-specific data, as defined in the Desktop Base Directory Specification .
</quote>

I'll ping the kubuntu/ubuntu core devs what they think,
as a real fix has impact on the hole Desktop environment.

Achim

Revision history for this message
Menachem Shapiro (menachem) wrote : Re: [Bug 75435] Re: digikam expects trash to be in ~/Desktop/Trash - causes error in Ubuntu

B"H
On 1/17/07, allee <email address hidden> wrote:
> Hi Menachem,
>
> I've create a fresh default ubuntu edgy
> installation, and aptitude install'ed digikam, and Pictures I deleted
> in digikam ended up in ~/.local/share/Trash (that did not
> exists before I started digikam.
>
> Maybe the protection of ~/.local is wrong so kio_trash
> can't create it?
>

What should the permissions for ~/.local and ~/.local/share be? I got:
mshapiro@eskimo:~$ ls -ld .local/
drwx------ 3 mshapiro mshapiro 4096 2006-04-23 06:36 .local/

and the same for ~/.local/share as well.

> Nevertheless creating a soft link
>
> ln -s ~/.Trash ~/.local/share/Trash
>
> should fix your problem (tested here works fine.
> Gnome trash gets the counting wrong from because it
> does not understand the XDG draft but that's cosmetic.)

Creating ~/.local/share/Trash did not work, it still failed. If the
permissions are wrong for ~/.local, that might explain why.

Menachem

> Achim
>

Revision history for this message
Achim Bohnet (allee) wrote :

[...]
> mshapiro@eskimo:~$ ls -ld .local/
> drwx------ 3 mshapiro mshapiro 4096 2006-04-23 06:36 .local/
>
> and the same for ~/.local/share as well.

Protection is okay. Same here. Only important thing is that
processes owned by you can create the directories, as
it's the case for you.

[...]
> Creating ~/.local/share/Trash did not work, it still failed. If the
> permissions are wrong for ~/.local, that might explain why.

Unfortunately not.

Wild guessing, would be easier if I could reproduce it here
but works fine in my fresh ubuntu gnome installation :(

What does
   echo $XDG_DATA_HOME
   kde-config --path xdgdata-dirs
   kde-config --path xdgdata-apps
return? Does the start with ~/.local/share/...

Do you have a Desktop/trash.desktop file?

Mine looks like:

$ cat ~/Desktop/trash.desktop
[Desktop Entry]
Comment=Contains removed files
EmptyIcon=trashcan_empty
Encoding=UTF-8
Icon=trashcan_full
Name=Trash
NoDisplay=true
OnlyShowIn=KDE
Type=Link
URL=trash:/

$ ls -l ~/Desktop/trash.desktop
-rw-r--r-- 1 ach ach 169 2006-11-16 21:49 /home/ach/Desktop/trash.desktop

This file is created vi kdesktop (that might never run in a
Gnome desktop).

Achim

Revision history for this message
Menachem Shapiro (menachem) wrote :

Achim

Here is the output of the commands. As you can see, I also don't have
a Desktop/trash.desktop directory.

mshapiro@eskimo:~$ echo $XDG_DATA_HOME

mshapiro@eskimo:~$ kde-config --path xdgdata-dirs
/home/mshapiro/.local/share/desktop-directories/:/usr/share/desktop-directories/
mshapiro@eskimo:~$ kde-config --path xdgdata-apps
/home/mshapiro/.local/share/applications/:/usr/share/applications/
mshapiro@eskimo:~$ cat /home/mshapiro/Desktop/trash.desktop
cat: /home/mshapiro/Desktop/trash.desktop: No such file or directory

I just copied your trash.desktop into a file on my desktop and got
this error message when starting digikam (the program still started):

kio (KService*): WARNING: The desktop entry file
/usr/share/applications/DefaultPlugins.desktop has Type=Link instead
of "Application" or "Service"
kio (KService*): WARNING: Invalid Service :
/usr/share/applications/DefaultPlugins.desktop

I was not able to use digikam to delete a picture.

Menachem

Revision history for this message
Achim Bohnet (allee) wrote :

Hi, this issue came up on digikam-users ml yesterday:

http://mail.kde.org/pipermail/digikam-users/2007-March/003194.html

Have you the pkg: kdebase-kio-plugins
installed? There needs to be a file /usr/lib/kde3/kio_trash.so

Here's also a more or less useful hint how to manage
KDE trash under Gnome:

You can can look at the KDE trash with

  konqueror trash:/

You can create an desktop file for this action and place it where-
ever you want.

Or if you don't have/want konqueror installed, as a work around,
open Digikam -> File -> Import images. This opens the standard
kde file dialog. There use trash:/ as the location. You
can select multiple (all) files and in the RMB menu you have
a delete.

Revision history for this message
Menachem Shapiro (menachem) wrote :

I checked, and kdebase-kio-plugins was not installed, so I installed it.

Now my KDE trash is located in "~/.local/share/Trash/files", and deleting pictures in digikam moves them there.

In order to have KDE and Gnome apps use the same trash, can I just delete "~/.local/share/Trash/files", and then link "~/.Trash" to "~/.local/share/Trash/files"? Will there be any repercussions to doing this?

With regards to Gnome and KDE apps integration, is it considered a bug that KDE apps on Ubuntu use a different Trash than Gnome apps?

Should kdebase-kio-plugins be added as a dependency for digikam?

Revision history for this message
Menachem Shapiro (menachem) wrote :

I forgot to add that with kdebase-kio-plugins, I no longer need a ~/Desktop/Trash folder in order to delete a picture, so I guess the original bug might be considered solved.

Revision history for this message
Achim Bohnet (allee) wrote :

Good. I've fixed the digikam pkging.

Changed in digikam:
assignee: nobody → allee
status: Unconfirmed → In Progress
Luka Renko (lure)
Changed in digikam:
assignee: allee → imbrandon
Revision history for this message
Brandon Holtsclaw (imbrandon) wrote :

uploaded, thanks for the patch

Changed in digikam:
status: In Progress → Fix Committed
Luka Renko (lure)
Changed in digikam:
status: Fix Committed → Fix Released
Revision history for this message
Alexandre Racine (alexandreracine) wrote :

Hi Allee,

>>I'll ping the kubuntu/ubuntu core devs what they think,
>>as a real fix has impact on the hole Desktop environment.

What did they say? People are playing the hot potato game. See : http://bugs.kde.org/show_bug.cgi?id=145277

Revision history for this message
Achim Bohnet (allee) wrote :

Hi Alexandre,
It's me playing this hot potato game. "Achim Bohnet" == allee ;)
Seriously: As freedesktop.org is there to create standards that should
be used by all desktop environments. Therefore the real fix IMHO is
gnome implementing the same freedesktop trash draft.

Achim

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.