[Bug 90674] tooltip with meta data should be a little more intelligent

Brad Hards bradh at frogmouth.net
Sun Dec 5 05:32:04 GMT 2004


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
        
http://bugs.kde.org/show_bug.cgi?id=90674        




------- Additional Comments From bradh frogmouth net  2004-12-05 06:32 -------
CVS commit by bhards: 

Handle empty (but not null) entries from mp3 files. I don't have a lot of
mp3s, so I could only test with the ones from kbattleship :-)

Thomas: can you update kdemultimedia/kfile-plugins/mp3 and test
if this is still a problem?

CCMAIL:90674 bugs kde org


  M +15 -5     kfile_mp3.cpp   1.71


--- kdemultimedia/kfile-plugins/mp3/kfile_mp3.cpp  #1.70:1.71
 @ -154,11 +154,21  @ bool KMp3Plugin::readInfo(KFileMetaInfo 
         QString track = file.tag()->track() > 0 ? QString::number(file.tag()->track()) : QString::null;
 
-        appendItem(id3group, "Title",       TStringToQString(file.tag()->title()).stripWhiteSpace());
-        appendItem(id3group, "Artist",      TStringToQString(file.tag()->artist()).stripWhiteSpace());
-        appendItem(id3group, "Album",       TStringToQString(file.tag()->album()).stripWhiteSpace());
+        QString title = TStringToQString(file.tag()->title()).stripWhiteSpace();
+        if (!title.isEmpty())
+            appendItem(id3group, "Title", title);
+        QString artist = TStringToQString(file.tag()->artist()).stripWhiteSpace();
+        if (!artist.isEmpty())
+            appendItem(id3group, "Artist", artist);
+        QString album = TStringToQString(file.tag()->album()).stripWhiteSpace();
+        if (!album.isEmpty())
+            appendItem(id3group, "Album", album);
         appendItem(id3group, "Date",        date);
-        appendItem(id3group, "Comment",     TStringToQString(file.tag()->comment()).stripWhiteSpace());
+        QString comment = TStringToQString(file.tag()->comment()).stripWhiteSpace();
+        if (!comment.isEmpty())
+            appendItem(id3group, "Comment", comment);
         appendItem(id3group, "Tracknumber", track);
-        appendItem(id3group, "Genre",       TStringToQString(file.tag()->genre()).stripWhiteSpace());
+        QString genre = TStringToQString(file.tag()->genre()).stripWhiteSpace();
+        if (!genre.isEmpty())
+            appendItem(id3group, "Genre", genre);
     }



More information about the kde-multimedia mailing list