Skip navigation.
KDE Developer's Journals

Save the musiK!

uga's picture

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 Eye-wink

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("<p>You have selected the file <i>'%1'</i> to be <b>irreversibly</b> deleted.")
+        text = i18n("<p>You have selected the file <i>'%1'</i> to be trashed.")
                     .arg(static_cast<PlaylistItem*>( currentItem() )->url().fileName() );
     else
-        text = i18n( "<p>You have selected one file to be <b>irreversibly</b> deleted.",
-                     "<p>You have selected %n files to be <b>irreversibly</b> deleted.", count );
+        text = i18n( "<p>You have selected one file to be trashed.",
+                     "<p>You have selected %n files to be trashed.", count );

     int button = KMessageBox::warningContinueCancel( this,
                                                      text,
                                                      QString::null,
-                                                     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.insertSeparator();

     popup.insertItem( SmallIconSet( "info" )

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
martin's picture

Also for the other interface elements...

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.

alexandre oliveira's picture

There's a bug report about it

Please, attach the patch to this bug report
http://bugs.kde.org/show_bug.cgi?id=98822

illissius's picture

I agree with this patch.

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

zander's picture

Thanks!

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.

sirtalon's picture

scary!

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.

halcyoncorsair's picture

The bonus of deletion....

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.

eike hein's picture

Good one.

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.

sebr's picture

Well, actually...

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.

zander's picture

Different planet..

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.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.