[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    =?utf-8?q?=5Bamarok=5D_src/core-impl/collections/mediadevicecoll?=
From:       Sergey Ivanov <123kash () gmail ! com>
Date:       2011-02-22 20:17:18
Message-ID: 20110222201718.84F4AA60A9 () git ! kde ! org
[Download RAW message or body]

Git commit cd8e7e0ea9dae09a3f9ba2127003cc0ca3fb05aa by Sergey Ivanov.
Committed on 20/02/2011 at 19:35.
Pushed by ivanov into branch 'master'.

Prevent crash in MediaDeviceTrack::prettyUrl() caused by infinite loop in case of \
                empty track name. Patch by Roman Malytskyy.
REVIEW: 100402

M  +8    -1    src/core-impl/collections/mediadevicecollection/MediaDeviceMeta.cpp    \


http://commits.kde.org/amarok/cd8e7e0ea9dae09a3f9ba2127003cc0ca3fb05aa

diff --git a/src/core-impl/collections/mediadevicecollection/MediaDeviceMeta.cpp \
b/src/core-impl/collections/mediadevicecollection/MediaDeviceMeta.cpp index \
                4d23d7d..44e08b5 100644
--- a/src/core-impl/collections/mediadevicecollection/MediaDeviceMeta.cpp
+++ b/src/core-impl/collections/mediadevicecollection/MediaDeviceMeta.cpp
@@ -144,7 +144,14 @@ MediaDeviceTrack::setUidUrl( const QString &newUidUrl ) const
 QString
 MediaDeviceTrack::prettyUrl() const
 {
-    return m_playableUrl.isLocalFile() ? m_playableUrl.toLocalFile() : QString( \
collection()->prettyName() + ": " + artist()->prettyName() + " - " + prettyName() ); \
+    if( m_playableUrl.isLocalFile() ) +        return m_playableUrl.toLocalFile();
+
+    QString artistName = artist()? artist()->prettyName() : i18n( "Unknown Artist" \
); +    // Check name() to prevent infinite recursion
+    QString trackName = !name().isEmpty()? prettyName() : i18n( "Unknown track" );
+
+    return  QString( "%1: %2 - %3" ).arg( collection()->prettyName(), artistName, \
trackName );  }
 
 bool


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic