From e654398e46e37abf457b2b1122ab898d2c51c49f Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:43:15 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdemultimedia@1157644 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- noatun/library/titleproxy.cpp | 72 +++++++++++++++++++++---------------------- 1 file changed, 36 insertions(+), 36 deletions(-) (limited to 'noatun/library/titleproxy.cpp') diff --git a/noatun/library/titleproxy.cpp b/noatun/library/titleproxy.cpp index 7515a35a..ee62863c 100644 --- a/noatun/library/titleproxy.cpp +++ b/noatun/library/titleproxy.cpp @@ -21,8 +21,8 @@ email : markey@web.de #include #include -#include -#include +#include +#include #include "noatun/app.h" using namespace TitleProxy; @@ -32,7 +32,7 @@ static const uint MAX_PROXYPORT = 7777; static const int BUFSIZE = 32768; Proxy::Proxy( KURL url ) - : QObject() + : TQObject() , m_url( url ) , m_initSuccess( true ) , m_metaInt( 0 ) @@ -50,9 +50,9 @@ Proxy::Proxy( KURL url ) if ( m_url.port() < 1 ) m_url.setPort( 80 ); - connect( &m_sockRemote, SIGNAL( error( int ) ), this, SLOT( connectError() ) ); - connect( &m_sockRemote, SIGNAL( connected() ), this, SLOT( sendRequest() ) ); - connect( &m_sockRemote, SIGNAL( readyRead() ), this, SLOT( readRemote() ) ); + connect( &m_sockRemote, TQT_SIGNAL( error( int ) ), this, TQT_SLOT( connectError() ) ); + connect( &m_sockRemote, TQT_SIGNAL( connected() ), this, TQT_SLOT( sendRequest() ) ); + connect( &m_sockRemote, TQT_SIGNAL( readyRead() ), this, TQT_SLOT( readRemote() ) ); uint i = 0; Server* server = 0; @@ -74,7 +74,7 @@ Proxy::Proxy( KURL url ) return; } m_usedPort = i; - connect( server, SIGNAL( connected( int ) ), this, SLOT( accept( int ) ) ); + connect( server, TQT_SIGNAL( connected( int ) ), this, TQT_SLOT( accept( int ) ) ); } @@ -129,8 +129,8 @@ void Proxy::connectToHost() //SLOT } { //connect to server - QTimer::singleShot( KProtocolManager::connectTimeout() * 1000, - this, SLOT( connectError() ) ); + TQTimer::singleShot( KProtocolManager::connectTimeout() * 1000, + this, TQT_SLOT( connectError() ) ); kdDebug(66666) << k_funcinfo << "Connecting to " << m_url.host() << ":" << m_url.port() << endl; @@ -146,12 +146,12 @@ void Proxy::sendRequest() //SLOT { //kdDebug(66666) << "BEGIN " << k_funcinfo << endl; - QCString username = m_url.user().utf8(); - QCString password = m_url.pass().utf8(); - QCString authString = KCodecs::base64Encode( username + ":" + password ); + TQCString username = m_url.user().utf8(); + TQCString password = m_url.pass().utf8(); + TQCString authString = KCodecs::base64Encode( username + ":" + password ); bool auth = !( username.isEmpty() && password.isEmpty() ); - QString request = QString( "GET %1 HTTP/1.0\r\n" + TQString request = TQString( "GET %1 HTTP/1.0\r\n" "Host: %2\r\n" "User-Agent: Noatun/%5\r\n" "%3" @@ -159,8 +159,8 @@ void Proxy::sendRequest() //SLOT "\r\n" ) .arg( m_url.path( -1 ).isEmpty() ? "/" : m_url.path( -1 ) ) .arg( m_url.host() ) - .arg( m_icyMode ? QString( "Icy-MetaData:1\r\n" ) : QString::null ) - .arg( auth ? QString( "Authorization: Basic " ).append( authString ) : QString::null ) + .arg( m_icyMode ? TQString( "Icy-MetaData:1\r\n" ) : TQString::null ) + .arg( auth ? TQString( "Authorization: Basic " ).append( authString ) : TQString::null ) .arg( NOATUN_VERSION ); m_sockRemote.writeBlock( request.latin1(), request.length() ); @@ -257,7 +257,7 @@ bool Proxy::processHeader( Q_LONG &index, Q_LONG bytesRead ) "Got shoutcast header: '" << m_headerStr << "'" << endl;*/ // Handle redirection - QString loc( "Location: " ); + TQString loc( "Location: " ); int index = m_headerStr.find( loc ); if ( index >= 0 ) { @@ -276,31 +276,31 @@ bool Proxy::processHeader( Q_LONG &index, Q_LONG bytesRead ) if (m_headerStr.startsWith("ICY")) { - m_metaInt = m_headerStr.section( "icy-metaint:", 1, 1, QString::SectionCaseInsensitiveSeps ).section( "\r", 0, 0 ).toInt(); - m_bitRate = m_headerStr.section( "icy-br:", 1, 1, QString::SectionCaseInsensitiveSeps ).section( "\r", 0, 0 ); - m_streamName = m_headerStr.section( "icy-name:", 1, 1, QString::SectionCaseInsensitiveSeps ).section( "\r", 0, 0 ); - m_streamGenre = m_headerStr.section( "icy-genre:", 1, 1, QString::SectionCaseInsensitiveSeps ).section( "\r", 0, 0 ); - m_streamUrl = m_headerStr.section( "icy-url:", 1, 1, QString::SectionCaseInsensitiveSeps ).section( "\r", 0, 0 ); + m_metaInt = m_headerStr.section( "icy-metaint:", 1, 1, TQString::SectionCaseInsensitiveSeps ).section( "\r", 0, 0 ).toInt(); + m_bitRate = m_headerStr.section( "icy-br:", 1, 1, TQString::SectionCaseInsensitiveSeps ).section( "\r", 0, 0 ); + m_streamName = m_headerStr.section( "icy-name:", 1, 1, TQString::SectionCaseInsensitiveSeps ).section( "\r", 0, 0 ); + m_streamGenre = m_headerStr.section( "icy-genre:", 1, 1, TQString::SectionCaseInsensitiveSeps ).section( "\r", 0, 0 ); + m_streamUrl = m_headerStr.section( "icy-url:", 1, 1, TQString::SectionCaseInsensitiveSeps ).section( "\r", 0, 0 ); } else // not ShoutCast { - QString serverName = m_headerStr.section( "Server:", 1, 1, QString::SectionCaseInsensitiveSeps ).section( "\r", 0, 0 ); + TQString serverName = m_headerStr.section( "Server:", 1, 1, TQString::SectionCaseInsensitiveSeps ).section( "\r", 0, 0 ); kdDebug(66666) << k_funcinfo << "Server name: " << serverName << endl; if (serverName == "Icecast") { m_metaInt = 0; - m_streamName = m_headerStr.section( "ice-name:", 1, 1, QString::SectionCaseInsensitiveSeps ).section( "\r", 0, 0 ); - m_streamGenre = m_headerStr.section( "ice-genre:", 1, 1, QString::SectionCaseInsensitiveSeps ).section( "\r", 0, 0 ); - m_streamUrl = m_headerStr.section( "ice-url:", 1, 1, QString::SectionCaseInsensitiveSeps ).section( "\r", 0, 0 ); + m_streamName = m_headerStr.section( "ice-name:", 1, 1, TQString::SectionCaseInsensitiveSeps ).section( "\r", 0, 0 ); + m_streamGenre = m_headerStr.section( "ice-genre:", 1, 1, TQString::SectionCaseInsensitiveSeps ).section( "\r", 0, 0 ); + m_streamUrl = m_headerStr.section( "ice-url:", 1, 1, TQString::SectionCaseInsensitiveSeps ).section( "\r", 0, 0 ); } else if (serverName.startsWith("icecast/1.")) { m_metaInt = 0; - m_bitRate = m_headerStr.section( "x-audiocast-bitrate:", 1, 1, QString::SectionCaseInsensitiveSeps ).section( "\r", 0, 0 ); - m_streamName = m_headerStr.section( "x-audiocast-name:", 1, 1, QString::SectionCaseInsensitiveSeps ).section( "\r", 0, 0 ); - m_streamGenre = m_headerStr.section( "x-audiocast-genre:", 1, 1, QString::SectionCaseInsensitiveSeps ).section( "\r", 0, 0 ); - m_streamUrl = m_headerStr.section( "x-audiocast-url:", 1, 1, QString::SectionCaseInsensitiveSeps ).section( "\r", 0, 0 ); + m_bitRate = m_headerStr.section( "x-audiocast-bitrate:", 1, 1, TQString::SectionCaseInsensitiveSeps ).section( "\r", 0, 0 ); + m_streamName = m_headerStr.section( "x-audiocast-name:", 1, 1, TQString::SectionCaseInsensitiveSeps ).section( "\r", 0, 0 ); + m_streamGenre = m_headerStr.section( "x-audiocast-genre:", 1, 1, TQString::SectionCaseInsensitiveSeps ).section( "\r", 0, 0 ); + m_streamUrl = m_headerStr.section( "x-audiocast-url:", 1, 1, TQString::SectionCaseInsensitiveSeps ).section( "\r", 0, 0 ); } } @@ -316,8 +316,8 @@ bool Proxy::processHeader( Q_LONG &index, Q_LONG bytesRead ) return false; } - connect( &m_sockRemote, SIGNAL( connectionClosed() ), - this, SLOT( connectError() ) ); + connect( &m_sockRemote, TQT_SIGNAL( connectionClosed() ), + this, TQT_SLOT( connectError() ) ); return true; } } @@ -325,7 +325,7 @@ bool Proxy::processHeader( Q_LONG &index, Q_LONG bytesRead ) } -void Proxy::transmitData( const QString &data ) +void Proxy::transmitData( const TQString &data ) { /*kdDebug(66666) << k_funcinfo << " received new metadata: '" << data << "'" << endl;*/ @@ -339,8 +339,8 @@ void Proxy::transmitData( const QString &data ) emit metaData( m_streamName, m_streamGenre, m_streamUrl, m_bitRate, - extractStr(data, QString::fromLatin1("StreamTitle")), - extractStr(data, QString::fromLatin1("StreamUrl"))); + extractStr(data, TQString::fromLatin1("StreamTitle")), + extractStr(data, TQString::fromLatin1("StreamUrl"))); } @@ -358,12 +358,12 @@ void Proxy::error() } -QString Proxy::extractStr( const QString &str, const QString &key ) +TQString Proxy::extractStr( const TQString &str, const TQString &key ) { int index = str.find( key, 0, true ); if ( index == -1 ) { - return QString::null; + return TQString::null; } else { -- cgit v1.2.1