I've just attached a fix for bug #263693. I hope no one minds that I put myself 
on the copyright list. I'm not to sure how much is enough to justify that.
-- 
Ryan McCoskrie
North Canterbury, New Zealand

sourcelinksnotes.comyr.com
diff --git a/src/core-impl/collections/support/CollectionLocationDelegateImpl.cpp b/src/core-impl/collections/support/CollectionLocationDelegateImpl.cpp
index 349464c..a3ec56f 100644
--- a/src/core-impl/collections/support/CollectionLocationDelegateImpl.cpp
+++ b/src/core-impl/collections/support/CollectionLocationDelegateImpl.cpp
@@ -1,4 +1,5 @@
 /****************************************************************************************
+ * Copyright (c) 2011 Ryan McCoskrie <ryan.mccosk...@gmail.com>                         *
  * Copyright (c) 2010 Maximilian Kossick <maximilian.koss...@googlemail.com>            *
  * Copyright (c) 2010 Casey Link <unnamedramb...@gmail.com>                             *
  *                                                                                      *
@@ -32,8 +33,23 @@ CollectionLocationDelegateImpl::reallyDelete( CollectionLocation *loc, const Met
     Q_UNUSED( loc );
 
     QStringList files;
-    foreach( Meta::TrackPtr track, tracks )
-        files << track->prettyUrl();
+    foreach( Meta::TrackPtr track, tracks ){
+        //Check what metadata is available before formating the string
+        QString str;
+        Meta::ArtistPtr artist = track->artist();
+        if( ! track->prettyName().isEmpty()){ //Found track name
+            str = track->prettyName();
+            if( ! artist->prettyName().isEmpty() ) //... and artist name
+                str += ( i18n(" by ") + artist->prettyName() );
+        }
+        else{ //Did not find track name
+            str = track->prettyUrl();
+            if( ! artist->prettyName().isEmpty()) //but did find artist name
+                str += QString(" (%1)").arg(artist->prettyName());
+        }
+
+        files << str;
+    }
 
     // NOTE: taken from SqlCollection
     // TODO put the delete confirmation code somewhere else?
@@ -54,8 +70,23 @@ CollectionLocationDelegateImpl::reallyTrash( CollectionLocation *loc, const Meta
     Q_UNUSED( loc );
 
     QStringList files;
-    foreach( Meta::TrackPtr track, tracks )
-        files << track->prettyUrl();
+    foreach( Meta::TrackPtr track, tracks ){
+        //Check what metadata is available before formating the string
+        QString str;
+        Meta::ArtistPtr artist = track->artist();
+        if( ! track->prettyName().isEmpty()){ //Found track name
+            str = track->prettyName();
+            if( ! artist->prettyName().isEmpty() ) //... and artist name
+                str += ( i18n(" by ") + artist->prettyName() );
+        }
+        else{ //Did not find track name
+            str = track->prettyUrl();
+            if( ! artist->prettyName().isEmpty()) //but did find artist name
+                str += QString(" (%1)").arg(artist->prettyName());
+        }
+
+        files << str;
+    }
 
     const QString text( i18ncp( "@info",
                                 "Do you really want to move this track to the trash? "
@@ -76,8 +107,23 @@ bool CollectionLocationDelegateImpl::reallyMove(CollectionLocation* loc, const M
 {
     Q_UNUSED( loc )
     QStringList files;
-    foreach( Meta::TrackPtr track, tracks )
-        files << track->prettyUrl();
+    foreach( Meta::TrackPtr track, tracks ){
+        //Check what metadata is available before formating the string
+        QString str;
+        Meta::ArtistPtr artist = track->artist();
+        if( ! track->prettyName().isEmpty()){ //Found track name
+            str = track->prettyName();
+            if( ! artist->prettyName().isEmpty() ) //... and artist name
+                str += ( i18n(" by ") + artist->prettyName() );
+        }
+        else{ //Did not find track name
+            str = track->prettyUrl();
+            if( ! artist->prettyName().isEmpty()) //but did find artist name
+                str += QString(" (%1)").arg(artist->prettyName());
+        }
+
+        files << str;
+    }
     
     const QString text( i18ncp( "@info", "Do you really want to move this track? It will be renamed and the original deleted.",
                                 "Do you really want to move these %1 tracks? They will be renamed and the originals deleted.", tracks.count() ) );
@@ -92,8 +138,23 @@ void CollectionLocationDelegateImpl::errorDeleting( CollectionLocation* loc, con
 {
     Q_UNUSED( loc );
     QStringList files;
-    foreach( Meta::TrackPtr track, tracks )
-        files << track->prettyUrl();
+    foreach( Meta::TrackPtr track, tracks ){
+        //Check what metadata is available before formating the string
+        QString str;
+        Meta::ArtistPtr artist = track->artist();
+        if( ! track->prettyName().isEmpty()){ //Found track name
+            str = track->prettyName();
+            if( ! artist->prettyName().isEmpty() ) //... and artist name
+                str += ( i18n(" by ") + artist->prettyName() );
+        }
+        else{ //Did not find track name
+            str = track->prettyUrl();
+            if( ! artist->prettyName().isEmpty()) //but did find artist name
+                str += QString(" (%1)").arg(artist->prettyName());
+        }
+
+        files << str;
+    }
 
     const QString text( i18ncp( "@info", "There was a problem and this track could not be removed. Make sure the directory is writable.",
                                 "There was a problem and %1 tracks could not be removed. Make sure the directory is writable.", files.count() ) );

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Amarok mailing list
Amarok@kde.org
https://mail.kde.org/mailman/listinfo/amarok

Reply via email to