Save the musiK!

In case you haven't noticed, there's a nice cute little menu in amaroK's playlist which mentions the horrible word "delete". Yes sir, delete, as in "remove completely from your harddisk". The option is side by side with "remove from playlist" option, so loosing your files by mistake is so easy. (nobody reads warnings nowadays, and everyone knows that).

So, unless you want to end up like me, deleting tons of files by mistake (only saved by an http:// url in the playlist), I suggest you test the following patch. Sorry, I'm not welcome to apply the patch nor anything similar to svn, by the maintainers ;)

Save yer musiK!

Index: src/playlist.cpp
--- src/playlist.cpp (revision 470659)
+++ src/playlist.cpp (working copy)
@@ -2590,27 +2590,27 @@
const int count = urls.count();
QString text;
if (count == 1) // remember: there are languages that use singular also for 0 or 2
- text = i18n("You have selected the file '%1' to be irreversibly deleted.")
+ text = i18n("You have selected the file '%1' to be trashed.")
.arg(static_cast( currentItem() )->url().fileName() );
- text = i18n( "You have selected one file to be irreversibly deleted.",
- "You have selected %n files to be irreversibly deleted.", count );
+ text = i18n( "You have selected one file to be trashed.",
+ "You have selected %n files to be trashed.", count );

int button = KMessageBox::warningContinueCancel( this,
- KStdGuiItem::del() );
+ i18n("&Move to Trash") );

if ( button == KMessageBox::Continue )
// TODO We need to check which files have been deleted successfully
- KIO::DeleteJob* job = KIO::del( urls );
+ KIO::CopyJob* job = KIO::trash( urls );
connect( job, SIGNAL(result( KIO::Job* )), SLOT(removeSelectedItems()) );

job->setAutoErrorHandlingEnabled( false );

amaroK::StatusBar::instance()->newProgressOperation( job )
- .setDescription( i18n("Deleting files") );
+ .setDescription( i18n("&Trash") );

// we must handle delete errors somehow
CollectionDB::instance()->removeSongs( urls );
@@ -3145,8 +3145,8 @@

popup.insertItem( SmallIconSet( "edittrash" ), i18n( "&Remove From Playlist" ), this, SLOT( removeSelectedItems() ), Key_Delete, REMOVE );
popup.insertItem( SmallIconSet( "editdelete" ), itemCount == 1
- ? i18n("&Delete File")
- : i18n("&Delete Selected Files"), this, SLOT( deleteSelectedFiles() ), SHIFT+Key_Delete, DELETE );
+ ? i18n("&Move to Trash")
+ : i18n("Move &Selected Files to Trash"), this, SLOT( deleteSelectedFiles() ), SHIFT+Key_Delete, DELETE );

popup.insertItem( SmallIconSet( "info" )


IIRC, at some point, the "Del" key was actually associated with the "Delete file" action (and not "Remove from playlist") - pretty counter-intuitive and surprising. It's better now, but your patch fixes the fundamental problem.

By eike hein at Fri, 10/14/2005 - 17:15

Well, actually, the 'Del' key is associated with remove from playlist and 'Shift-Del' is to delete.

There have been numerous discussions regarding whether the entry should be trash or delete, and the consensus is delete - sorry for those who disagree.

Additionally, it seems that the use delete or trash option from kde is a setting which is brought in by kdebase, and we only have a dependency of kdelibs.

By sebr at Fri, 10/14/2005 - 23:08

For people that care much about a cool app with good usability allowing a user to hurt himself so easily is just weird. I concluded for myself that the developers of Amarok are from a different planet and have a different way of thinking then the rest of us.
The point that something is in kdebase is just a simple excuse; if this was a priority a solution would be found, simple as that.

By Thomas Zander at Tue, 10/18/2005 - 09:29

It does make far more sense that the files are simply put in the trash can instead of being deleted from the system! (don't you even have to manually enable that menu option in Konqueror to do that???)

That sounds like a patch that should definitely be in Amarok! Trashing makes far more sense than a program just deleting a file from the system.

By sirtalon at Fri, 10/14/2005 - 18:02

Actually trashing doesn't always work depending on where the file resides, so deletion can be a better option.

However, I do think that the option to delete could be moved a little so its not so easy to hit.

By halcyoncorsair at Sat, 10/15/2005 - 04:55

I'll try this one, my personal copy had the whole action removed without committing since I got a deaf ear from the maintainers when I talked about various usability issues as well. They create some good stuff but have way too much confidence in their ability to judge their own work.

By Thomas Zander at Fri, 10/14/2005 - 19:56

even though checking for whether Konqui is set to show Trash or Delete and then using that would be even better :)

By Gábor Lehel at Fri, 10/14/2005 - 20:41

Please, attach the patch to this bug report

By alexandre oliveira at Sat, 10/15/2005 - 01:51

I add myself to the list of supporters for this patch.

The trash option should also be there for the files browser; there used to indeed be a trash option there, if I recall correctly, but this has now been changed to delete, for consistency with the playlist I suppose.

In the collection browser there is neither; one could argue that there should be a trash option there as well.

By martin at Mon, 10/17/2005 - 15:22