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

List:       kde-commits
Subject:    [libechonest] src: Merge pull request #7 from xhochy/qt5
From:       Leo Franchi <lfranchi () kde ! org>
Date:       2013-11-06 15:27:30
Message-ID: E1Ve510-0005tx-K5 () scm ! kde ! org
[Download RAW message or body]

Git commit 5719e5566792f7ae2a54a1839ff2f7d8520e61f2 by Leo Franchi.
Committed on 27/08/2013 at 13:37.
Pushed by lfranchi into branch 'master'.

Merge pull request #7 from xhochy/qt5

Add the ability to compile with Qt5

M  +243  -243  src/Parsing.cpp
M  +28   -22   src/Playlist.cpp
M  +20   -15   src/Song.cpp

http://commits.kde.org/libechonest/5719e5566792f7ae2a54a1839ff2f7d8520e61f2

diff --cc src/Parsing.cpp
index e61a884,717a786..f5e4ecf
--- a/src/Parsing.cpp
+++ b/src/Parsing.cpp
@@@ -250,33 -249,25 +250,33 @@@ Echonest::AudioSummary Echonest::Parser
      }
  
      Echonest::AudioSummary summary;
-     while( !( xml.name() == "audio_summary" && xml.tokenType() == \
                QXmlStreamReader::EndElement ) ) {
-         if( xml.name() == "key" && xml.isStartElement() )
+     while( !( xml.name() == QLatin1String( "audio_summary" ) && xml.tokenType() == \
QXmlStreamReader::EndElement ) ) { +         if( xml.name() == QLatin1String( "key" ) \
&& xml.isStartElement() )  summary.setKey( xml.readElementText().toInt() );
-         else if( xml.name() == "analysis_url" && xml.isStartElement() )
+         else if( xml.name() == QLatin1String( "analysis_url" ) && \
                xml.isStartElement() )
              summary.setAnalysisUrl( QUrl::fromEncoded( \
                xml.readElementText().toUtf8(), QUrl::TolerantMode ) );
-         else if( xml.name() == "tempo" && xml.isStartElement() )
+         else if( xml.name() == QLatin1String( "tempo" ) && xml.isStartElement() )
              summary.setTempo( xml.readElementText().toDouble() );
-         else if( xml.name() == "mode" && xml.isStartElement() )
+         else if( xml.name() == QLatin1String( "mode" ) && xml.isStartElement() )
              summary.setMode( xml.readElementText().toInt() );
-         else if( xml.name() == "time_signature" && xml.isStartElement() )
+         else if( xml.name() == QLatin1String( "time_signature" ) && \
xml.isStartElement() )  summary.setTimeSignature( xml.readElementText().toInt() );
-         else if( xml.name() == "duration" && xml.isStartElement() )
+         else if( xml.name() == QLatin1String( "duration" ) && xml.isStartElement() \
)  summary.setDuration( xml.readElementText().toDouble() );
-         else if( xml.name() == "loudness" && xml.isStartElement() )
+         else if( xml.name() == QLatin1String( "loudness" ) && xml.isStartElement() \
)  summary.setLoudness( xml.readElementText().toDouble() );
-         else if( xml.name() == "danceability" && xml.isStartElement() )
+         else if( xml.name() == QLatin1String( "danceability" ) && \
xml.isStartElement() )  summary.setDanceability( xml.readElementText().toDouble() );
-         else if( xml.name() == "energy" && xml.isStartElement() )
+         else if( xml.name() == QLatin1String( "energy" ) && xml.isStartElement() )
              summary.setEnergy( xml.readElementText().toDouble() );
 +        else if( xml.name() == "acousticness" && xml.isStartElement() )
 +            summary.setAcousticness( xml.readElementText().toDouble() );
 +        else if( xml.name() == "speechiness" && xml.isStartElement() )
 +            summary.setSpeechiness( xml.readElementText().toDouble() );
 +        else if( xml.name() == "liveness" && xml.isStartElement() )
 +            summary.setLiveness( xml.readElementText().toDouble() );
 +        else if( xml.name() == "valence" && xml.isStartElement() )
 +            summary.setValence( xml.readElementText().toDouble() );
  
          xml.readNext();
      }


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

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