Commit b5f41649beb278013df86e18c7bd20f378b1f6d3

Remove Amarok::albumArtistTrackFromUrl() as it not used at all.
Tests for Amarok::recursiveUrlExpand().
  
127127
128128 // New in Amarok2 -> recursiveUrlExpand has been replaced
129129 // existing code depending on this port need to be changed (max urls is removed)
130 AMAROK_EXPORT KUrl::List recursiveUrlExpand( const KUrl &url ); // defined in PlaylistHandler.cpp
131 AMAROK_EXPORT KUrl::List recursiveUrlExpand( const KUrl::List &urls ); // defined in PlaylistHandler.cpp
130 AMAROK_EXPORT KUrl::List recursiveUrlExpand( const KUrl &url ); // defined in PlaylistManager.cpp
131 AMAROK_EXPORT KUrl::List recursiveUrlExpand( const KUrl::List &urls ); // defined in PlaylistManager.cpp
132132
133133 AMAROK_EXPORT QString verboseTimeSince( const QDateTime &datetime ); // defined in App.cpp
134134
135135 AMAROK_EXPORT QString verboseTimeSince( uint time_t ); // defined in App.cpp
136136
137137 AMAROK_EXPORT QString conciseTimeSince( uint time_t ); // defined in App.cpp
138
139 /**
140 * Function that must be used when separating contextBrowser escaped urls
141 */
142 // defined in App.cpp
143 void albumArtistTrackFromUrl( QString url, QString &artist, QString &album, QString &detail );
144138
145139 /**
146140 * @return the LOWERCASE file extension without the preceding '.', or "" if there is none
src/App.cpp
(0 / 23)
  
772772 replace( "%27", "'" ).replace( "%25", "%" );
773773 }
774774
775 /**
776 * Function that must be used when separating contextBrowser escaped urls
777 * detail can contain track/discnumber
778 */
779 void albumArtistTrackFromUrl( QString url, QString &artist, QString &album, QString &detail )
780 {
781 if ( !url.contains("@@@") ) return;
782 //KHTML removes the trailing space!
783 if ( url.endsWith( " @@@" ) )
784 url += ' ';
785
786 const QStringList list = url.split( " @@@ ", QString::KeepEmptyParts );
787
788 int size = list.count();
789
790 if( size<=0 )
791 error() << "size<=0";
792
793 artist = size > 0 ? unescapeHTMLAttr( list[0] ) : "";
794 album = size > 1 ? unescapeHTMLAttr( list[1] ) : "";
795 detail = size > 2 ? unescapeHTMLAttr( list[2] ) : "";
796 }
797
798775 QString verboseTimeSince( const QDateTime &datetime )
799776 {
800777 const QDateTime now = QDateTime::currentDateTime();
  
2323#include <QDir>
2424#include <QString>
2525
26#include <KStandardDirs>
27
2628TestAmarok::TestAmarok( QStringList testArgumentList )
2729{
2830 testArgumentList.replace( 2, testArgumentList.at( 2 ) + "Amarok.log" );
188188
189189 Amarok::manipulateThe( teststring = "Äöü, The", false );
190190 QCOMPARE( teststring, QString( "The Äöü" ) );
191}
192
193void TestAmarok::testRecursiveUrlExpand()
194{
195 /* There are two overloaded variants of this function */
196 KUrl url( "" );
197 KUrl::List urlList, resultList;
198
199 resultList = Amarok::recursiveUrlExpand( url );
200 QCOMPARE( resultList.isEmpty(), true );
201
202 resultList = Amarok::recursiveUrlExpand( urlList );
203 QCOMPARE( resultList.isEmpty(), true );
204
205 urlList.append( url );
206 resultList = Amarok::recursiveUrlExpand( urlList );
207 QCOMPARE( resultList.isEmpty(), true );
208
209 url = KStandardDirs::installPath( "data" ) + "amarok/testdata/playlists/";
210 resultList = Amarok::recursiveUrlExpand( url );
211 QCOMPARE( resultList.size(), 1 );
212 QCOMPARE( resultList.at( 0 ).pathOrUrl(), url.pathOrUrl() + QString( "no-playlist.png" ) ); // only non-playlist file in that dir
213
214 url = KStandardDirs::installPath( "data" ) + "amarok/testdata/";
215 resultList = Amarok::recursiveUrlExpand( url );
216 QCOMPARE( resultList.size(), 1 );
217 QCOMPARE( resultList.at( 0 ).pathOrUrl(), url.pathOrUrl() + QString( "playlists/no-playlist.png" ) );
191218}
192219
193220void TestAmarok::testSaveLocation()
  
3838 void testEscapeHTMLAttr();
3939 void testExtension();
4040 void testManipulateThe();
41 void testRecursiveUrlExpand();
4142 void testSaveLocation();
4243 void testUnescapeHTMLAttr();
4344 void testVerboseTimeSince();
4445 void testVfatPath();
45 /*KUrl::List testRecursiveUrlExpand( const KUrl &url ); //defined in PlaylistHandler.cpp
46 KUrl::List testRecursiveUrlExpand( const KUrl::List &urls ); //defined in PlaylistHandler.cpp */
47 /* void testAlbumArtistTrackFromUrl( QString url, QString &artist, QString &album, QString &detail ); // TODO: needs testdata
48 */
4946 //KUrl testMostLocalURL( const KUrl &url );
5047
5148 /*
  
3232
3333void TestPlaylistManager::initTestCase()
3434{
35 m_testPlaylistPath = KStandardDirs::installPath( "data" ) + "/amarok/testdata/playlists/";
35 m_testPlaylistPath = KStandardDirs::installPath( "data" ) + "amarok/testdata/playlists/";
3636}
3737
3838void TestPlaylistManager::testGetFormat()