diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-08-20 06:53:52 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-08-20 06:53:52 +0000 |
commit | 3a09386ad170dafdce88c5dcd70275cc7d4081e9 (patch) | |
tree | 0f9544da38cdb9c5cc20ad9d695588413b4cd5f9 /amarok/src/playlistloader.cpp | |
parent | 36a9c1916513474b11c59a9060cbaf8770d1bbc0 (diff) | |
download | amarok-3a09386ad170dafdce88c5dcd70275cc7d4081e9.tar.gz amarok-3a09386ad170dafdce88c5dcd70275cc7d4081e9.zip |
Initial TQt conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/amarok@1165727 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'amarok/src/playlistloader.cpp')
-rw-r--r-- | amarok/src/playlistloader.cpp | 252 |
1 files changed, 126 insertions, 126 deletions
diff --git a/amarok/src/playlistloader.cpp b/amarok/src/playlistloader.cpp index b79ceba0..22cafbf3 100644 --- a/amarok/src/playlistloader.cpp +++ b/amarok/src/playlistloader.cpp @@ -28,13 +28,13 @@ #include "contextbrowser.h" #include "xspfplaylist.h" -#include <qdatetime.h> //::recurse() -#include <qeventloop.h> //::recurse() -#include <qfile.h> //::loadPlaylist() -#include <qlistview.h> -#include <qregexp.h> -#include <qstringlist.h> -#include <qtextstream.h> //::loadPlaylist() +#include <tqdatetime.h> //::recurse() +#include <tqeventloop.h> //::recurse() +#include <tqfile.h> //::loadPlaylist() +#include <tqlistview.h> +#include <tqregexp.h> +#include <tqstringlist.h> +#include <tqtextstream.h> //::loadPlaylist() #include <dcopref.h> #include <kapplication.h> @@ -54,10 +54,10 @@ struct XMLData XMLData(): queue(-1), stopafter(false), dynamicdisabled(false) { } }; -class TagsEvent : public QCustomEvent { +class TagsEvent : public TQCustomEvent { public: - TagsEvent( const QValueList<XMLData> &x ) : QCustomEvent( 1001 ), xml( QDeepCopy<QValueList<XMLData> >( x ) ) { } - TagsEvent( const BundleList &bees ) : QCustomEvent( 1000 ), bundles( QDeepCopy<BundleList>( bees ) ) { + TagsEvent( const TQValueList<XMLData> &x ) : TQCustomEvent( 1001 ), xml( TQDeepCopy<TQValueList<XMLData> >( x ) ) { } + TagsEvent( const BundleList &bees ) : TQCustomEvent( 1000 ), bundles( TQDeepCopy<BundleList>( bees ) ) { for( BundleList::Iterator it = bundles.begin(), end = bundles.end(); it != end; ++it ) { (*it).detach(); @@ -67,12 +67,12 @@ public: } } - QValueList<XMLData> xml; + TQValueList<XMLData> xml; BundleList bundles; }; -UrlLoader::UrlLoader( const KURL::List &urls, QListViewItem *after, int options ) +UrlLoader::UrlLoader( const KURL::List &urls, TQListViewItem *after, int options ) : ThreadManager::DependentJob( Playlist::instance(), "UrlLoader" ) , m_markerListViewItem( new PlaylistItem( Playlist::instance(), after ) ) , m_playFirstUrl( options & (Playlist::StartPlay | Playlist::DirectPlay) ) @@ -83,8 +83,8 @@ UrlLoader::UrlLoader( const KURL::List &urls, QListViewItem *after, int options , m_xmlSource( 0 ) { - connect( this, SIGNAL( queueChanged( const PLItemList &, const PLItemList & ) ), - Playlist::instance(), SIGNAL( queueChanged( const PLItemList &, const PLItemList & ) ) ); + connect( this, TQT_SIGNAL( queueChanged( const PLItemList &, const PLItemList & ) ), + Playlist::instance(), TQT_SIGNAL( queueChanged( const PLItemList &, const PLItemList & ) ) ); Playlist::instance()->lock(); // prevent user removing items as this could be bad @@ -95,12 +95,12 @@ UrlLoader::UrlLoader( const KURL::List &urls, QListViewItem *after, int options Amarok::StatusBar::instance()->newProgressOperation( this ) .setDescription( m_description ) .setStatus( i18n("Preparing") ) - .setAbortSlot( this, SLOT(abort()) ) + .setAbortSlot( this, TQT_SLOT(abort()) ) .setTotalSteps( 100 ); foreachType( KURL::List, urls ) { const KURL url = Amarok::detachedKURL(Amarok::mostLocalURL( *it )); - const QString protocol = url.protocol(); + const TQString protocol = url.protocol(); if( protocol == "seek" ) continue; @@ -119,7 +119,7 @@ UrlLoader::UrlLoader( const KURL::List &urls, QListViewItem *after, int options } else if( protocol == "file" ) { - if( QFileInfo( url.path() ).isDir() ) + if( TQFileInfo( url.path() ).isDir() ) m_URLs += recurse( url ); else m_URLs += url; @@ -129,24 +129,24 @@ UrlLoader::UrlLoader( const KURL::List &urls, QListViewItem *after, int options // it has been fixed for kde 3.5.3 else if( protocol == "media" || url.url().startsWith( "system:/media/" ) ) { - QString path = url.path( -1 ); + TQString path = url.path( -1 ); if( url.url().startsWith( "system:/media/" ) ) path = path.mid( 6 ); // url looks like media:/device/path DCOPRef mediamanager( "kded", "mediamanager" ); - QString device = path.mid( 1 ); // remove first slash + TQString device = path.mid( 1 ); // remove first slash const int slash = device.find( '/' ); - const QString filePath = device.mid( slash ); // extract relative path + const TQString filePath = device.mid( slash ); // extract relative path device = device.left( slash ); // extract device - DCOPReply reply = mediamanager.call( "properties(QString)", device ); + DCOPReply reply = mediamanager.call( "properties(TQString)", device ); if( reply.isValid() ) { - const QStringList properties = reply; + const TQStringList properties = reply; // properties[6] is the mount point KURL localUrl = KURL( properties[6] + filePath ); // add urls - if( QFileInfo( localUrl.path() ).isDir() ) + if( TQFileInfo( localUrl.path() ).isDir() ) m_URLs += recurse( localUrl ); else m_URLs += localUrl; @@ -207,7 +207,7 @@ UrlLoader::doJob() PlaylistFile playlist( url.path() ); if( !playlist.isError() ) - QApplication::postEvent( this, new TagsEvent( playlist.bundles()) ); + TQApplication::postEvent( this, new TagsEvent( playlist.bundles()) ); else m_badURLs += url; @@ -218,7 +218,7 @@ UrlLoader::doJob() } if( urls.count() == OPTIMUM_BUNDLE_COUNT || it == last ) { - QApplication::postEvent( this, new TagsEvent( CollectionDB::instance()->bundlesByUrls( urls ) ) ); + TQApplication::postEvent( this, new TagsEvent( CollectionDB::instance()->bundlesByUrls( urls ) ) ); urls.clear(); } } @@ -227,7 +227,7 @@ UrlLoader::doJob() } void -UrlLoader::customEvent( QCustomEvent *e) +UrlLoader::customEvent( TQCustomEvent *e) { //DEBUG_BLOCK #define e static_cast<TagsEvent*>(e) @@ -261,7 +261,7 @@ UrlLoader::customEvent( QCustomEvent *e) case 1001: { - foreachType( QValueList<XMLData>, e->xml ) + foreachType( TQValueList<XMLData>, e->xml ) { if( (*it).bundle.isEmpty() ) //safety continue; @@ -309,7 +309,7 @@ UrlLoader::completeJob() { DEBUG_BLOCK const PLItemList &newQueue = Playlist::instance()->m_nextTracks; - QPtrListIterator<PlaylistItem> it( newQueue ); + TQPtrListIterator<PlaylistItem> it( newQueue ); PLItemList added; for( it.toFirst(); *it; ++it ) if( !m_oldQueue.containsRef( *it ) ) @@ -319,14 +319,14 @@ UrlLoader::completeJob() emit queueChanged( added, PLItemList() ); if ( !m_badURLs.isEmpty() ) { - QString text = i18n("These media could not be loaded into the playlist: " ); + TQString text = i18n("These media could not be loaded into the playlist: " ); debug() << "The following urls were not suitable for the playlist:" << endl; for ( uint it = 0; it < m_badURLs.count(); it++ ) { if( it < 5 ) - text += QString("<br>%1").arg( m_badURLs[it].prettyURL() ); + text += TQString("<br>%1").arg( m_badURLs[it].prettyURL() ); else if( it == 5 ) - text += QString("<br>Plus %1 more").arg( m_badURLs.count() - it ); + text += TQString("<br>Plus %1 more").arg( m_badURLs.count() - it ); debug() << "\t" << m_badURLs[it] << endl; } @@ -338,13 +338,13 @@ UrlLoader::completeJob() Playlist::instance()->setDynamicMode( PlaylistBrowser::instance()->findDynamicModeByTitle( m_dynamicMode ) ); //synchronous, ie not using eventLoop - QApplication::sendEvent( dependent(), this ); + TQApplication::sendEvent( dependent(), this ); } KURL::List UrlLoader::recurse( const KURL &url ) { - typedef QMap<QString, KURL> FileMap; + typedef TQMap<TQString, KURL> FileMap; KDirLister lister( false ); lister.setAutoUpdate( false ); @@ -354,13 +354,13 @@ UrlLoader::recurse( const KURL &url ) // Fucking KDirLister sometimes hangs on remote media, so we add a timeout const int timeout = 3000; // ms - QTime watchdog; + TQTime watchdog; watchdog.start(); while( !lister.isFinished() && !isAborted() && watchdog.elapsed() < timeout ) - kapp->eventLoop()->processEvents( QEventLoop::ExcludeUserInput ); + kapp->eventLoop()->processEvents( TQEventLoop::ExcludeUserInput ); - KFileItemList items = lister.items(); //returns QPtrList, so we MUST only do it once! + KFileItemList items = lister.items(); //returns TQPtrList, so we MUST only do it once! KURL::List urls; FileMap files; for( KFileItem *item = items.first(); item; item = items.next() ) { @@ -385,9 +385,9 @@ namespace Amarok KURL::List recursiveUrlExpand( const KURL &url, int maxURLs ) { - typedef QMap<QString, KURL> FileMap; + typedef TQMap<TQString, KURL> FileMap; - if( url.protocol() != "file" || !QFileInfo( url.path() ).isDir() ) + if( url.protocol() != "file" || !TQFileInfo( url.path() ).isDir() ) return KURL::List( url ); MyDirLister lister( false ); @@ -398,13 +398,13 @@ recursiveUrlExpand( const KURL &url, int maxURLs ) // Fucking KDirLister sometimes hangs on remote media, so we add a timeout const int timeout = 3000; // ms - QTime watchdog; + TQTime watchdog; watchdog.start(); while( !lister.isFinished() && watchdog.elapsed() < timeout ) - kapp->eventLoop()->processEvents( QEventLoop::ExcludeUserInput ); + kapp->eventLoop()->processEvents( TQEventLoop::ExcludeUserInput ); - KFileItemList items = lister.items(); //returns QPtrList, so we MUST only do it once! + KFileItemList items = lister.items(); //returns TQPtrList, so we MUST only do it once! KURL::List urls; FileMap files; for( KFileItem *item = items.first(); item; item = items.next() ) { @@ -449,7 +449,7 @@ recursiveUrlExpand( const KURL::List &list, int maxURLs ) void UrlLoader::loadXml( const KURL &url ) { - QFile file( url.path() ); + TQFile file( url.path() ); if( !file.open( IO_ReadOnly ) ) { m_badURLs += url; return; @@ -457,16 +457,16 @@ UrlLoader::loadXml( const KURL &url ) m_currentURL = url; delete m_xmlSource; - m_xmlSource = new QXmlInputSource( file ); + m_xmlSource = new TQXmlInputSource( file ); MyXmlLoader loader; - connect( &loader, SIGNAL( newBundle( const MetaBundle&, const XmlAttributeList& ) ), - this, SLOT( slotNewBundle( const MetaBundle&, const XmlAttributeList& ) ) ); - connect( &loader, SIGNAL( playlistInfo( const QString&, const QString&, const QString& ) ), - this, SLOT( slotPlaylistInfo( const QString&, const QString&, const QString& ) ) ); + connect( &loader, TQT_SIGNAL( newBundle( const MetaBundle&, const XmlAttributeList& ) ), + this, TQT_SLOT( slotNewBundle( const MetaBundle&, const XmlAttributeList& ) ) ); + connect( &loader, TQT_SIGNAL( playlistInfo( const TQString&, const TQString&, const TQString& ) ), + this, TQT_SLOT( slotPlaylistInfo( const TQString&, const TQString&, const TQString& ) ) ); loader.load( m_xmlSource ); if( !m_xml.isEmpty() ) { - QApplication::postEvent( this, new TagsEvent( m_xml ) ); + TQApplication::postEvent( this, new TagsEvent( m_xml ) ); m_xml.clear(); } if( !loader.lastError().isEmpty() ) @@ -482,7 +482,7 @@ UrlLoader::loadXml( const KURL &url ) void UrlLoader::slotNewBundle( const MetaBundle &bundle, const XmlAttributeList &atts ) { XMLData data; - data.bundle = QDeepCopy<MetaBundle>( bundle ); + data.bundle = TQDeepCopy<MetaBundle>( bundle ); for( int i = 0, n = atts.count(); i < n; ++i ) { if( atts[i].first == "queue_index" ) @@ -501,12 +501,12 @@ void UrlLoader::slotNewBundle( const MetaBundle &bundle, const XmlAttributeList m_xml.append( data ); if( m_xml.count() == OPTIMUM_BUNDLE_COUNT ) { - QApplication::postEvent( this, new TagsEvent( m_xml ) ); + TQApplication::postEvent( this, new TagsEvent( m_xml ) ); m_xml.clear(); } } -void UrlLoader::slotPlaylistInfo( const QString &, const QString &version, const QString &dynamicMode ) +void UrlLoader::slotPlaylistInfo( const TQString &, const TQString &version, const TQString &dynamicMode ) { if( version != Amarok::xmlVersion() ) { @@ -515,7 +515,7 @@ void UrlLoader::slotPlaylistInfo( const QString &, const QString &version, const "and this version can no longer read it.\n" "You will have to create a new one.\n" "Sorry :(" ) ); - static_cast<MyXmlLoader*>( const_cast<QObject*>( sender() ) )->abort(); //HACK? + static_cast<MyXmlLoader*>( const_cast<TQObject*>( sender() ) )->abort(); //HACK? return; } else @@ -524,16 +524,16 @@ void UrlLoader::slotPlaylistInfo( const QString &, const QString &version, const /// @class PlaylistFile -PlaylistFile::PlaylistFile( const QString &path ) +PlaylistFile::PlaylistFile( const TQString &path ) : m_path( path ) { - QFile file( path ); + TQFile file( path ); if( !file.open( IO_ReadOnly ) ) { m_error = i18n( "Amarok could not open the file." ); return; } - QTextStream stream( &file ); + TQTextStream stream( &file ); switch( format( m_path ) ) { case M3U: loadM3u( stream ); break; @@ -556,17 +556,17 @@ PlaylistFile::PlaylistFile( const QString &path ) } bool -PlaylistFile::loadM3u( QTextStream &stream ) +PlaylistFile::loadM3u( TQTextStream &stream ) { - const QString directory = m_path.left( m_path.findRev( '/' ) + 1 ); + const TQString directory = m_path.left( m_path.findRev( '/' ) + 1 ); MetaBundle b; - for( QString line; !stream.atEnd(); ) + for( TQString line; !stream.atEnd(); ) { line = stream.readLine(); if( line.startsWith( "#EXTINF" ) ) { - const QString extinf = line.section( ':', 1 ); + const TQString extinf = line.section( ':', 1 ); const int length = extinf.section( ',', 0, 0 ).toInt(); b.setTitle( extinf.section( ',', 1 ) ); b.setLength( length <= 0 ? /*MetaBundle::Undetermined HACK*/ -2 : length ); @@ -575,7 +575,7 @@ PlaylistFile::loadM3u( QTextStream &stream ) else if( !line.startsWith( "#" ) && !line.isEmpty() ) { // KURL::isRelativeURL() expects absolute URLs to start with a protocol, so prepend it if missing - QString url = line; + TQString url = line; if( url.startsWith( "/" ) ) url.prepend( "file://" ); @@ -601,7 +601,7 @@ PlaylistFile::loadM3u( QTextStream &stream ) } bool -PlaylistFile::loadPls( QTextStream &stream ) +PlaylistFile::loadPls( TQTextStream &stream ) { // Counted number of "File#=" lines. unsigned int entryCnt = 0; @@ -609,15 +609,15 @@ PlaylistFile::loadPls( QTextStream &stream ) unsigned int numberOfEntries = 0; // Does the file have a "[playlist]" section? (as it's required by the standard) bool havePlaylistSection = false; - QString tmp; - QStringList lines; + TQString tmp; + TQStringList lines; - const QRegExp regExp_NumberOfEntries("^NumberOfEntries\\s*=\\s*\\d+$"); - const QRegExp regExp_File("^File\\d+\\s*="); - const QRegExp regExp_Title("^Title\\d+\\s*="); - const QRegExp regExp_Length("^Length\\d+\\s*=\\s*\\d+$"); - const QRegExp regExp_Version("^Version\\s*=\\s*\\d+$"); - const QString section_playlist("[playlist]"); + const TQRegExp regExp_NumberOfEntries("^NumberOfEntries\\s*=\\s*\\d+$"); + const TQRegExp regExp_File("^File\\d+\\s*="); + const TQRegExp regExp_Title("^Title\\d+\\s*="); + const TQRegExp regExp_Length("^Length\\d+\\s*=\\s*\\d+$"); + const TQRegExp regExp_Version("^Version\\s*=\\s*\\d+$"); + const TQString section_playlist("[playlist]"); /* Preprocess the input data. * Read the lines into a buffer; Cleanup the line strings; @@ -665,7 +665,7 @@ PlaylistFile::loadPls( QTextStream &stream ) /* Now iterate through all beautified lines in the buffer * and parse the playlist data. */ - QStringList::const_iterator i = lines.begin(), end = lines.end(); + TQStringList::const_iterator i = lines.begin(), end = lines.end(); for ( ; i != end; ++i) { if (!inPlaylistSection && havePlaylistSection) { /* The playlist begins with the "[playlist]" tag. @@ -724,7 +724,7 @@ PlaylistFile::loadPls( QTextStream &stream ) } bool -PlaylistFile::loadXSPF( QTextStream &stream ) +PlaylistFile::loadXSPF( TQTextStream &stream ) { XSPFPlaylist* doc = new XSPFPlaylist( stream ); @@ -733,11 +733,11 @@ PlaylistFile::loadXSPF( QTextStream &stream ) foreachType( XSPFtrackList, trackList ) { KURL location = (*it).location; - QString artist = (*it).creator; - QString title = (*it).title; - QString album = (*it).album; + TQString artist = (*it).creator; + TQString title = (*it).title; + TQString album = (*it).album; - if( location.isEmpty() || ( location.isLocalFile() && !QFile::exists( location.url() ) ) ) + if( location.isEmpty() || ( location.isLocalFile() && !TQFile::exists( location.url() ) ) ) { QueryBuilder qb; qb.addMatch( QueryBuilder::tabArtist, QueryBuilder::valName, artist ); @@ -746,7 +746,7 @@ PlaylistFile::loadXSPF( QTextStream &stream ) qb.addMatch( QueryBuilder::valName, album ); qb.addReturnValue( QueryBuilder::tabSong, QueryBuilder::valURL ); - QStringList values = qb.run(); + TQStringList values = qb.run(); if( values.isEmpty() ) continue; @@ -774,7 +774,7 @@ PlaylistFile::loadXSPF( QTextStream &stream ) } unsigned int -PlaylistFile::loadPls_extractIndex( const QString &str ) const +PlaylistFile::loadPls_extractIndex( const TQString &str ) const { /* Extract the index number out of a .pls line. * Example: @@ -782,18 +782,18 @@ PlaylistFile::loadPls_extractIndex( const QString &str ) const */ bool ok = false; unsigned int ret; - QString tmp(str.section('=', 0, 0)); - tmp.remove(QRegExp("^\\D*")); + TQString tmp(str.section('=', 0, 0)); + tmp.remove(TQRegExp("^\\D*")); ret = tmp.stripWhiteSpace().toUInt(&ok); Q_ASSERT(ok); return ret; } bool -PlaylistFile::loadRealAudioRam( QTextStream &stream ) +PlaylistFile::loadRealAudioRam( TQTextStream &stream ) { MetaBundle b; - QString url; + TQString url; //while loop adapted from Kaffeine 0.5 while (!stream.atEnd()) { @@ -812,21 +812,21 @@ PlaylistFile::loadRealAudioRam( QTextStream &stream ) } bool -PlaylistFile::loadASX( QTextStream &stream ) +PlaylistFile::loadASX( TQTextStream &stream ) { //adapted from Kaffeine 0.7 MetaBundle b; - QDomDocument doc; - QString errorMsg; + TQDomDocument doc; + TQString errorMsg; int errorLine, errorColumn; - stream.setEncoding( QTextStream::UnicodeUTF8 ); + stream.setEncoding( TQTextStream::UnicodeUTF8 ); - QString content = stream.read(); + TQString content = stream.read(); //ASX looks a lot like xml, but doesn't require tags to be case sensitive, //meaning we have to accept things like: <Abstract>...</abstract> //We use a dirty way to achieve this: we make all tags lower case - QRegExp ex("(<[/]?[^>]*[A-Z]+[^>]*>)"); + TQRegExp ex("(<[/]?[^>]*[A-Z]+[^>]*>)"); ex.setCaseSensitive(true); while ( (ex.search(content)) != -1 ) content.replace(ex.cap( 1 ), ex.cap( 1 ).lower()); @@ -839,26 +839,26 @@ PlaylistFile::loadASX( QTextStream &stream ) return false; } - QDomElement root = doc.documentElement(); + TQDomElement root = doc.documentElement(); - QString url; - QString title; - QString author; - QTime length; - QString duration; + TQString url; + TQString title; + TQString author; + TQTime length; + TQString duration; if (root.nodeName().lower() != "asx") return false; - QDomNode node = root.firstChild(); - QDomNode subNode; - QDomElement element; + TQDomNode node = root.firstChild(); + TQDomNode subNode; + TQDomElement element; while (!node.isNull()) { - url = QString::null; - title = QString::null; - author = QString::null; - length = QTime(); + url = TQString::null; + title = TQString::null; + author = TQString::null; + length = TQTime(); if (node.nodeName().lower() == "entry") { subNode = node.firstChild(); @@ -878,7 +878,7 @@ PlaylistFile::loadASX( QTextStream &stream ) } if ((subNode.nodeName().lower() == "duration") && (subNode.isElement())) { - duration = QString::null; + duration = TQString::null; element = subNode.toElement(); if (element.hasAttribute("value")) duration = element.attribute("value"); @@ -916,26 +916,26 @@ PlaylistFile::loadASX( QTextStream &stream ) } bool -PlaylistFile::loadSMIL( QTextStream &stream ) +PlaylistFile::loadSMIL( TQTextStream &stream ) { // adapted from Kaffeine 0.7 - QDomDocument doc; + TQDomDocument doc; if( !doc.setContent( stream.read() ) ) { debug() << "Could now read smil playlist" << endl; return false; } - QDomElement root = doc.documentElement(); - stream.setEncoding ( QTextStream::UnicodeUTF8 ); + TQDomElement root = doc.documentElement(); + stream.setEncoding ( TQTextStream::UnicodeUTF8 ); if( root.nodeName().lower() != "smil" ) return false; KURL kurl; - QString url; - QDomNodeList nodeList; - QDomNode node; - QDomElement element; + TQString url; + TQDomNodeList nodeList; + TQDomNode node; + TQDomElement element; //audio sources... nodeList = doc.elementsByTagName( "audio" ); @@ -943,7 +943,7 @@ PlaylistFile::loadSMIL( QTextStream &stream ) { MetaBundle b; node = nodeList.item(i); - url = QString::null; + url = TQString::null; if( (node.nodeName().lower() == "audio") && (node.isElement()) ) { element = node.toElement(); @@ -973,16 +973,16 @@ PlaylistFile::loadSMIL( QTextStream &stream ) #include <kio/job.h> #include <klocale.h> -RemotePlaylistFetcher::RemotePlaylistFetcher( const KURL &source, QListViewItem *after, int options ) - : QObject( Playlist::instance()->qscrollview() ) +RemotePlaylistFetcher::RemotePlaylistFetcher( const KURL &source, TQListViewItem *after, int options ) + : TQObject( Playlist::instance()->qscrollview() ) , m_source( source ) , m_after( after ) , m_playFirstUrl( options & (Playlist::StartPlay | Playlist::DirectPlay) ) , m_options( options ) { //We keep the extension so the UrlLoader knows what file type it is - const QString path = source.path(); - m_temp = new KTempFile( QString::null /*use default prefix*/, path.mid( path.findRev( '.' ) ) ); + const TQString path = source.path(); + m_temp = new KTempFile( TQString::null /*use default prefix*/, path.mid( path.findRev( '.' ) ) ); m_temp->setAutoDelete( true ); m_destination.setPath( m_temp->name() ); @@ -996,7 +996,7 @@ RemotePlaylistFetcher::RemotePlaylistFetcher( const KURL &source, QListViewItem Amarok::StatusBar::instance()->newProgressOperation( job ) .setDescription( i18n("Retrieving Playlist") ); - connect( job, SIGNAL(result( KIO::Job* )), SLOT(result( KIO::Job* )) ); + connect( job, TQT_SIGNAL(result( KIO::Job* )), TQT_SLOT(result( KIO::Job* )) ); Playlist::instance()->lock(); } @@ -1033,9 +1033,9 @@ RemotePlaylistFetcher::result( KIO::Job *job ) /// @class SqlLoader -SqlLoader::SqlLoader( const QString &sql, QListViewItem *after, int options ) +SqlLoader::SqlLoader( const TQString &sql, TQListViewItem *after, int options ) : UrlLoader( KURL::List(), after, options ) - , m_sql( QDeepCopy<QString>( sql ) ) + , m_sql( TQDeepCopy<TQString>( sql ) ) { // Ovy: just until we make sure every SQL query from dynamic playlists is handled // correctly @@ -1046,19 +1046,19 @@ bool SqlLoader::doJob() { DEBUG_BLOCK - const QStringList values = CollectionDB::instance()->query( m_sql ); + const TQStringList values = CollectionDB::instance()->query( m_sql ); setProgressTotalSteps( values.count() ); BundleList bundles; uint x = 0; - for( for_iterators( QStringList, values ); it != end && !isAborted(); ++it ) { + for( for_iterators( TQStringList, values ); it != end && !isAborted(); ++it ) { setProgress( x += QueryBuilder::dragFieldCount ); bundles += CollectionDB::instance()->bundleFromQuery( &it ); if( bundles.count() == OPTIMUM_BUNDLE_COUNT || it == last ) { - QApplication::postEvent( this, new TagsEvent( bundles ) ); + TQApplication::postEvent( this, new TagsEvent( bundles ) ); bundles.clear(); } } @@ -1068,27 +1068,27 @@ SqlLoader::doJob() return true; } -QTime PlaylistFile::stringToTime(const QString& timeString) +TQTime PlaylistFile::stringToTime(const TQString& timeString) { int sec = 0; bool ok = false; - QStringList tokens = QStringList::split(':',timeString); + TQStringList tokens = TQStringList::split(':',timeString); sec += tokens[0].toInt(&ok)*3600; //hours sec += tokens[1].toInt(&ok)*60; //minutes sec += tokens[2].toInt(&ok); //secs if (ok) - return QTime().addSecs(sec); + return TQTime().addSecs(sec); else - return QTime(); + return TQTime(); } -bool MyXmlLoader::startElement( const QString &a, const QString &name, const QString &b, const QXmlAttributes &atts ) +bool MyXmlLoader::startElement( const TQString &a, const TQString &name, const TQString &b, const TQXmlAttributes &atts ) { if( name == "playlist" ) { - QString product, version, dynamic; + TQString product, version, dynamic; for( int i = 0, n = atts.count(); i < n; ++i ) { if( atts.localName( i ) == "product" ) |