summaryrefslogtreecommitdiffstats
path: root/libk3b/cddb
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-27 19:21:21 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-27 19:21:21 +0000
commitd8cc8bdfa7fa624a526d5aa1626974e1444cb799 (patch)
treef295f1c545b319963d5357af79fe08991d8141d9 /libk3b/cddb
parent2a39a080579fb52a2599c02b2939795385b89093 (diff)
downloadk3b-d8cc8bdfa7fa624a526d5aa1626974e1444cb799.tar.gz
k3b-d8cc8bdfa7fa624a526d5aa1626974e1444cb799.zip
TQt4 port k3b
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/k3b@1233803 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libk3b/cddb')
-rw-r--r--libk3b/cddb/k3bcddb.cpp80
-rw-r--r--libk3b/cddb/k3bcddb.h25
-rw-r--r--libk3b/cddb/k3bcddbhttpquery.cpp48
-rw-r--r--libk3b/cddb/k3bcddbhttpquery.h29
-rw-r--r--libk3b/cddb/k3bcddblocalquery.cpp42
-rw-r--r--libk3b/cddb/k3bcddblocalquery.h15
-rw-r--r--libk3b/cddb/k3bcddblocalsubmit.cpp32
-rw-r--r--libk3b/cddb/k3bcddblocalsubmit.h9
-rw-r--r--libk3b/cddb/k3bcddbmultientriesdialog.cpp36
-rw-r--r--libk3b/cddb/k3bcddbmultientriesdialog.h7
-rw-r--r--libk3b/cddb/k3bcddbpquery.cpp66
-rw-r--r--libk3b/cddb/k3bcddbpquery.h27
-rw-r--r--libk3b/cddb/k3bcddbquery.cpp88
-rw-r--r--libk3b/cddb/k3bcddbquery.h35
-rw-r--r--libk3b/cddb/k3bcddbresult.h32
-rw-r--r--libk3b/cddb/k3bcddbsubmit.cpp10
-rw-r--r--libk3b/cddb/k3bcddbsubmit.h11
17 files changed, 300 insertions, 292 deletions
diff --git a/libk3b/cddb/k3bcddb.cpp b/libk3b/cddb/k3bcddb.cpp
index a0e4fe1..d0131e8 100644
--- a/libk3b/cddb/k3bcddb.cpp
+++ b/libk3b/cddb/k3bcddb.cpp
@@ -15,10 +15,10 @@
-#include <qstring.h>
-#include <qvaluelist.h>
-#include <qstringlist.h>
-#include <qtimer.h>
+#include <tqstring.h>
+#include <tqvaluelist.h>
+#include <tqstringlist.h>
+#include <tqtimer.h>
#include <klocale.h>
#include <kconfig.h>
@@ -36,8 +36,8 @@
#include "k3bcddbmultientriesdialog.h"
-K3bCddb::K3bCddb( QObject* parent, const char* name )
- : QObject( parent, name )
+K3bCddb::K3bCddb( TQObject* tqparent, const char* name )
+ : TQObject( tqparent, name )
{
m_httpQuery = 0;
m_cddbpQuery = 0;
@@ -61,8 +61,8 @@ void K3bCddb::readConfig( KConfig* c )
m_bLocalCddbQuery = c->readBoolEntry( "use local cddb query", false );
// old config <= 0.7.3
- QStringList cddbpServer = c->readListEntry( "cddbp server" );
- QStringList httpServer = c->readListEntry( "http server" );
+ TQStringList cddbpServer = c->readListEntry( "cddbp server" );
+ TQStringList httpServer = c->readListEntry( "http server" );
// new config
m_cddbServer = c->readListEntry( "cddb server" );
@@ -77,12 +77,12 @@ void K3bCddb::readConfig( KConfig* c )
// old config <= 0.7.3
if( !httpServer.isEmpty() ) {
- for( QStringList::iterator it = httpServer.begin(); it != httpServer.end(); ++it ) {
+ for( TQStringList::iterator it = httpServer.begin(); it != httpServer.end(); ++it ) {
m_cddbServer.append( "Http " + *it );
}
}
if( !cddbpServer.isEmpty() ) {
- for( QStringList::iterator it = cddbpServer.begin(); it != cddbpServer.end(); ++it ) {
+ for( TQStringList::iterator it = cddbpServer.begin(); it != cddbpServer.end(); ++it ) {
m_cddbServer.append( "Cddbp " + *it );
}
}
@@ -98,14 +98,14 @@ void K3bCddb::query( const K3bDevice::Toc& toc )
if( m_bLocalCddbQuery ) {
m_iCurrentQueriedLocalDir = 0;
- QTimer::singleShot( 0, this, SLOT(localQuery()) );
+ TQTimer::singleShot( 0, this, TQT_SLOT(localQuery()) );
}
else if( m_bRemoteCddbQuery ) {
m_iCurrentQueriedServer = 0;
- QTimer::singleShot( 0, this, SLOT(remoteQuery()) );
+ TQTimer::singleShot( 0, this, TQT_SLOT(remoteQuery()) );
}
else {
- QTimer::singleShot( 0, this, SLOT(slotNoEntry()) );
+ TQTimer::singleShot( 0, this, TQT_SLOT(slotNoEntry()) );
}
}
@@ -141,7 +141,7 @@ void K3bCddb::slotQueryFinished( K3bCddbQuery* query )
m_lastResult = m_lastUsedQuery->result();
// make sure the result has the requested discid since otherwise local saving does not make much sense
- m_lastResult.discid = QString::number( m_toc.discId(), 16 ).rightJustify( 8, '0' );
+ m_lastResult.discid = TQString::number( m_toc.discId(), 16 ).rightJustify( 8, '0' );
emit queryFinished( K3bCddbQuery::SUCCESS );
}
@@ -169,37 +169,37 @@ void K3bCddb::slotQueryFinished( K3bCddbQuery* query )
}
-K3bCddbQuery* K3bCddb::getQuery( const QString& s )
+K3bCddbQuery* K3bCddb::getQuery( const TQString& s )
{
- QStringList buf = QStringList::split( ":", s.mid( s.find(" ")+1 ) );
- QString server = buf[0];
+ TQStringList buf = TQStringList::split( ":", s.mid( s.tqfind(" ")+1 ) );
+ TQString server = buf[0];
int port = buf[1].toInt();
if( s.startsWith("Http") ) {
if( !m_httpQuery ) {
m_httpQuery = new K3bCddbHttpQuery( this );
- connect( m_httpQuery, SIGNAL(infoMessage(const QString&)),
- this, SIGNAL(infoMessage(const QString&)) );
- connect( m_httpQuery, SIGNAL(queryFinished(K3bCddbQuery*)),
- this, SLOT(slotQueryFinished(K3bCddbQuery*)) );
- connect( m_httpQuery, SIGNAL(inexactMatches(K3bCddbQuery*)),
- this, SLOT(slotMultibleMatches(K3bCddbQuery*)) );
+ connect( m_httpQuery, TQT_SIGNAL(infoMessage(const TQString&)),
+ this, TQT_SIGNAL(infoMessage(const TQString&)) );
+ connect( m_httpQuery, TQT_SIGNAL(queryFinished(K3bCddbQuery*)),
+ this, TQT_SLOT(slotQueryFinished(K3bCddbQuery*)) );
+ connect( m_httpQuery, TQT_SIGNAL(inexactMatches(K3bCddbQuery*)),
+ this, TQT_SLOT(slotMultibleMatches(K3bCddbQuery*)) );
}
m_httpQuery->setServer( server, port );
- m_httpQuery->setCgiPath( m_bUseManualCgiPath ? m_cgiPath : QString::fromLatin1("/~cddb/cddb.cgi") );
+ m_httpQuery->setCgiPath( m_bUseManualCgiPath ? m_cgiPath : TQString::tqfromLatin1("/~cddb/cddb.cgi") );
return m_httpQuery;
}
else {
if( !m_cddbpQuery ) {
m_cddbpQuery = new K3bCddbpQuery( this );
- connect( m_cddbpQuery, SIGNAL(infoMessage(const QString&)),
- this, SIGNAL(infoMessage(const QString&)) );
- connect( m_cddbpQuery, SIGNAL(queryFinished(K3bCddbQuery*)),
- this, SLOT(slotQueryFinished(K3bCddbQuery*)) );
- connect( m_cddbpQuery, SIGNAL(inexactMatches(K3bCddbQuery*)),
- this, SLOT(slotMultibleMatches(K3bCddbQuery*)) );
+ connect( m_cddbpQuery, TQT_SIGNAL(infoMessage(const TQString&)),
+ this, TQT_SIGNAL(infoMessage(const TQString&)) );
+ connect( m_cddbpQuery, TQT_SIGNAL(queryFinished(K3bCddbQuery*)),
+ this, TQT_SLOT(slotQueryFinished(K3bCddbQuery*)) );
+ connect( m_cddbpQuery, TQT_SIGNAL(inexactMatches(K3bCddbQuery*)),
+ this, TQT_SLOT(slotMultibleMatches(K3bCddbQuery*)) );
}
m_cddbpQuery->setServer( server, port );
@@ -213,12 +213,12 @@ void K3bCddb::localQuery()
{
if( !m_localQuery ) {
m_localQuery = new K3bCddbLocalQuery( this );
- connect( m_localQuery, SIGNAL(infoMessage(const QString&)),
- this, SIGNAL(infoMessage(const QString&)) );
- connect( m_localQuery, SIGNAL(queryFinished(K3bCddbQuery*)),
- this, SLOT(slotQueryFinished(K3bCddbQuery*)) );
- connect( m_localQuery, SIGNAL(inexactMatches(K3bCddbQuery*)),
- this, SLOT(slotMultibleMatches(K3bCddbQuery*)) );
+ connect( m_localQuery, TQT_SIGNAL(infoMessage(const TQString&)),
+ this, TQT_SIGNAL(infoMessage(const TQString&)) );
+ connect( m_localQuery, TQT_SIGNAL(queryFinished(K3bCddbQuery*)),
+ this, TQT_SLOT(slotQueryFinished(K3bCddbQuery*)) );
+ connect( m_localQuery, TQT_SIGNAL(inexactMatches(K3bCddbQuery*)),
+ this, TQT_SLOT(slotMultibleMatches(K3bCddbQuery*)) );
}
m_localQuery->setCddbDir( m_localCddbDirs[m_iCurrentQueriedLocalDir] );
@@ -227,7 +227,7 @@ void K3bCddb::localQuery()
}
-QString K3bCddb::errorString() const
+TQString K3bCddb::errorString() const
{
if( !m_lastUsedQuery )
return "no query";
@@ -241,7 +241,7 @@ QString K3bCddb::errorString() const
return i18n("Error while connecting to host.");
case K3bCddbQuery::WORKING:
return i18n("Working...");
- case K3bCddbQuery::QUERY_ERROR:
+ case K3bCddbQuery::TQUERY_ERROR:
case K3bCddbQuery::READ_ERROR:
case K3bCddbQuery::FAILURE:
default:
@@ -261,8 +261,8 @@ void K3bCddb::saveEntry( const K3bCddbResultEntry& entry )
{
if( !m_localSubmit ) {
m_localSubmit = new K3bCddbLocalSubmit( this );
- connect( m_localSubmit, SIGNAL(submitFinished(K3bCddbSubmit*)),
- this, SLOT(slotSubmitFinished(K3bCddbSubmit*)) );
+ connect( m_localSubmit, TQT_SIGNAL(submitFinished(K3bCddbSubmit*)),
+ this, TQT_SLOT(slotSubmitFinished(K3bCddbSubmit*)) );
}
m_localSubmit->setCddbDir( m_localCddbDirs[0] );
diff --git a/libk3b/cddb/k3bcddb.h b/libk3b/cddb/k3bcddb.h
index 86b67c5..b7e5a47 100644
--- a/libk3b/cddb/k3bcddb.h
+++ b/libk3b/cddb/k3bcddb.h
@@ -17,9 +17,9 @@
#ifndef K3BCDDB_H
#define K3BCDDB_H
-#include <qstring.h>
-#include <qstringlist.h>
-#include <qobject.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
+#include <tqobject.h>
#include <k3btoc.h>
@@ -35,15 +35,16 @@ class K3bCddbSubmit;
class K3bCddbLocalSubmit;
-class LIBK3B_EXPORT K3bCddb : public QObject
+class LIBK3B_EXPORT K3bCddb : public TQObject
{
Q_OBJECT
+ TQ_OBJECT
public:
- K3bCddb( QObject* parent = 0, const char* name = 0 );
+ K3bCddb( TQObject* tqparent = 0, const char* name = 0 );
~K3bCddb();
- QString errorString() const;
+ TQString errorString() const;
/**
* Do NOT call this before queryResult has
@@ -60,7 +61,7 @@ class LIBK3B_EXPORT K3bCddb : public QObject
signals:
void queryFinished( int error );
void submitFinished( bool success );
- void infoMessage( const QString& );
+ void infoMessage( const TQString& );
private slots:
void localQuery();
@@ -71,7 +72,7 @@ class LIBK3B_EXPORT K3bCddb : public QObject
void slotNoEntry();
private:
- K3bCddbQuery* getQuery( const QString& );
+ K3bCddbQuery* getQuery( const TQString& );
K3bCddbHttpQuery* m_httpQuery;
K3bCddbpQuery* m_cddbpQuery;
@@ -86,13 +87,13 @@ class LIBK3B_EXPORT K3bCddb : public QObject
K3bCddbResultEntry m_lastResult;
// config
- QStringList m_cddbServer;
- QString m_proxyServer;
+ TQStringList m_cddbServer;
+ TQString m_proxyServer;
int m_proxyPort;
- QString m_cgiPath;
+ TQString m_cgiPath;
bool m_bUseProxyServer;
bool m_bUseKdeSettings;
- QStringList m_localCddbDirs;
+ TQStringList m_localCddbDirs;
bool m_bSaveCddbEntriesLocally;
bool m_bUseManualCgiPath;
bool m_bRemoteCddbQuery;
diff --git a/libk3b/cddb/k3bcddbhttpquery.cpp b/libk3b/cddb/k3bcddbhttpquery.cpp
index a453c3e..c21460f 100644
--- a/libk3b/cddb/k3bcddbhttpquery.cpp
+++ b/libk3b/cddb/k3bcddbhttpquery.cpp
@@ -19,9 +19,9 @@
#include "k3bcddbresult.h"
-#include <qstringlist.h>
-#include <qregexp.h>
-#include <qtextstream.h>
+#include <tqstringlist.h>
+#include <tqregexp.h>
+#include <tqtextstream.h>
#include <klocale.h>
#include <kdebug.h>
@@ -29,8 +29,8 @@
#include <kio/job.h>
-K3bCddbHttpQuery::K3bCddbHttpQuery( QObject* parent, const char* name )
- : K3bCddbQuery( parent, name )
+K3bCddbHttpQuery::K3bCddbHttpQuery( TQObject* tqparent, const char* name )
+ : K3bCddbQuery( tqparent, name )
{
m_server = "freedb.org";
m_port = 80;
@@ -46,7 +46,7 @@ K3bCddbHttpQuery::~K3bCddbHttpQuery()
void K3bCddbHttpQuery::doQuery()
{
setError( WORKING );
- m_state = QUERY;
+ m_state = TQUERY;
performCommand( queryString() );
}
@@ -58,11 +58,11 @@ void K3bCddbHttpQuery::doMatchQuery()
m_state = READ;
m_parsingBuffer.truncate(0);
- performCommand( QString( "cddb read %1 %2").arg( header().category ).arg( header().discid ) );
+ performCommand( TQString( "cddb read %1 %2").tqarg( header().category ).tqarg( header().discid ) );
}
-void K3bCddbHttpQuery::performCommand( const QString& cmd )
+void K3bCddbHttpQuery::performCommand( const TQString& cmd )
{
KURL url;
url.setProtocol( "http" );
@@ -82,23 +82,23 @@ void K3bCddbHttpQuery::performCommand( const QString& cmd )
if( !job ) {
setError( CONNECTION_ERROR );
- emit infoMessage( i18n("Could not connect to host %1").arg(m_server) );
+ emit infoMessage( i18n("Could not connect to host %1").tqarg(m_server) );
emitQueryFinished();
return;
}
- connect( job, SIGNAL(data(KIO::Job*, const QByteArray&)),
- SLOT(slotData(KIO::Job*, const QByteArray&)) );
- connect( job, SIGNAL(result(KIO::Job*)),
- SLOT(slotResult(KIO::Job*)) );
+ connect( job, TQT_SIGNAL(data(KIO::Job*, const TQByteArray&)),
+ TQT_SLOT(slotData(KIO::Job*, const TQByteArray&)) );
+ connect( job, TQT_SIGNAL(result(KIO::Job*)),
+ TQT_SLOT(slotResult(KIO::Job*)) );
}
-void K3bCddbHttpQuery::slotData( KIO::Job*, const QByteArray& data )
+void K3bCddbHttpQuery::slotData( KIO::Job*, const TQByteArray& data )
{
if( data.size() ) {
- QDataStream stream( m_data, IO_WriteOnly | IO_Append );
+ TQDataStream stream( m_data, IO_WriteOnly | IO_Append );
stream.writeRawBytes( data.data(), data.size() );
}
}
@@ -113,16 +113,16 @@ void K3bCddbHttpQuery::slotResult( KIO::Job* job )
return;
}
- QStringList lines = QStringList::split( "\n", QString::fromUtf8( m_data.data(), m_data.size() ) );
+ TQStringList lines = TQStringList::split( "\n", TQString::fromUtf8( m_data.data(), m_data.size() ) );
- for( QStringList::const_iterator it = lines.begin(); it != lines.end(); ++it ) {
- QString line = *it;
+ for( TQStringList::const_iterator it = lines.begin(); it != lines.end(); ++it ) {
+ TQString line = *it;
// kdDebug() << "(K3bCddbHttpQuery) line: " << line << endl;
switch( m_state ) {
- case QUERY:
+ case TQUERY:
if( getCode( line ) == 200 ) {
// parse exact match and send a read command
K3bCddbResultHeader header;
@@ -137,7 +137,7 @@ void K3bCddbHttpQuery::slotResult( KIO::Job* job )
emit infoMessage( i18n("Found multiple exact matches") );
- m_state = QUERY_DATA;
+ m_state = TQUERY_DATA;
}
else if( getCode( line ) == 211 ) {
@@ -145,7 +145,7 @@ void K3bCddbHttpQuery::slotResult( KIO::Job* job )
emit infoMessage( i18n("Found inexact matches") );
- m_state = QUERY_DATA;
+ m_state = TQUERY_DATA;
}
else if( getCode( line ) == 202 ) {
@@ -160,14 +160,14 @@ void K3bCddbHttpQuery::slotResult( KIO::Job* job )
else {
kdDebug() << "(K3bCddbHttpQuery) Error while querying: " << line << endl;
emit infoMessage( i18n("Error while querying") );
- setError(QUERY_ERROR);
+ setError(TQUERY_ERROR);
m_state = FINISHED;
emitQueryFinished();
return;
}
break;
- case QUERY_DATA:
+ case TQUERY_DATA:
if( line.startsWith( "." ) ) {
// finished query
// go on reading
@@ -212,7 +212,7 @@ void K3bCddbHttpQuery::slotResult( KIO::Job* job )
kdDebug() << "(K3bCddbHttpQuery query finished." << endl;
- QTextStream strStream( m_parsingBuffer, IO_ReadOnly );
+ TQTextStream strStream( m_parsingBuffer, IO_ReadOnly );
parseEntry( strStream, result() );
setError(SUCCESS);
diff --git a/libk3b/cddb/k3bcddbhttpquery.h b/libk3b/cddb/k3bcddbhttpquery.h
index b1e544e..12a275e 100644
--- a/libk3b/cddb/k3bcddbhttpquery.h
+++ b/libk3b/cddb/k3bcddbhttpquery.h
@@ -14,13 +14,13 @@
*/
-#ifndef K3BCDDB_HTTP_QUERY_H
-#define K3BCDDB_HTTP_QUERY_H
+#ifndef K3BCDDB_HTTP_TQUERY_H
+#define K3BCDDB_HTTP_TQUERY_H
#include "k3bcddbquery.h"
#include "k3bcddbresult.h"
-#include <qvaluelist.h>
+#include <tqvaluelist.h>
namespace KIO {
class Job;
@@ -29,35 +29,36 @@ namespace KIO {
class K3bCddbHttpQuery : public K3bCddbQuery
{
Q_OBJECT
+ TQ_OBJECT
public:
- K3bCddbHttpQuery( QObject* parent = 0, const char* name = 0 );
+ K3bCddbHttpQuery( TQObject* tqparent = 0, const char* name = 0 );
~K3bCddbHttpQuery();
public slots:
- void setServer( const QString& s, int port = 80 ) { m_server = s; m_port = port; }
- void setCgiPath( const QString& p ) { m_cgiPath = p; }
+ void setServer( const TQString& s, int port = 80 ) { m_server = s; m_port = port; }
+ void setCgiPath( const TQString& p ) { m_cgiPath = p; }
protected slots:
void doQuery();
void doMatchQuery();
void slotResult( KIO::Job* );
- void slotData( KIO::Job*, const QByteArray& data );
+ void slotData( KIO::Job*, const TQByteArray& data );
private:
- void performCommand( const QString& );
+ void performCommand( const TQString& );
- enum State { QUERY, QUERY_DATA, READ, READ_DATA, FINISHED };
+ enum State { TQUERY, TQUERY_DATA, READ, READ_DATA, FINISHED };
int m_state;
- QString m_server;
+ TQString m_server;
int m_port;
- QString m_cgiPath;
+ TQString m_cgiPath;
- QString m_currentlyConnectingServer;
+ TQString m_currentlyConnectingServer;
- QByteArray m_data;
- QString m_parsingBuffer;
+ TQByteArray m_data;
+ TQString m_parsingBuffer;
};
#endif
diff --git a/libk3b/cddb/k3bcddblocalquery.cpp b/libk3b/cddb/k3bcddblocalquery.cpp
index b3a1264..f70b6d8 100644
--- a/libk3b/cddb/k3bcddblocalquery.cpp
+++ b/libk3b/cddb/k3bcddblocalquery.cpp
@@ -16,17 +16,17 @@
#include "k3bcddblocalquery.h"
-#include <qdir.h>
-#include <qfile.h>
-#include <qtextstream.h>
+#include <tqdir.h>
+#include <tqfile.h>
+#include <tqtextstream.h>
#include <kapplication.h>
#include <klocale.h>
#include <kdebug.h>
-K3bCddbLocalQuery::K3bCddbLocalQuery( QObject* parent , const char* name )
- : K3bCddbQuery( parent, name )
+K3bCddbLocalQuery::K3bCddbLocalQuery( TQObject* tqparent , const char* name )
+ : K3bCddbQuery( tqparent, name )
{
}
@@ -38,33 +38,33 @@ K3bCddbLocalQuery::~K3bCddbLocalQuery()
void K3bCddbLocalQuery::doQuery()
{
- emit infoMessage( i18n("Searching entry in %1").arg( m_cddbDir ) );
+ emit infoMessage( i18n("Searching entry in %1").tqarg( m_cddbDir ) );
kapp->processEvents(); //BAD!
- QString path = preparePath( m_cddbDir );
+ TQString path = preparePath( m_cddbDir );
kdDebug() << "(K3bCddbLocalQuery) searching in dir " << path << " for "
- << QString::number( toc().discId(), 16 ).rightJustify( 8, '0' ) << endl;
+ << TQString::number( toc().discId(), 16 ).rightJustify( 8, '0' ) << endl;
- for( QStringList::const_iterator it = categories().begin();
+ for( TQStringList::const_iterator it = categories().begin();
it != categories().end(); ++it ) {
- QString file = path + *it + "/" + QString::number( toc().discId(), 16 ).rightJustify( 8, '0' );
+ TQString file = path + *it + "/" + TQString::number( toc().discId(), 16 ).rightJustify( 8, '0' );
- if( QFile::exists( file ) ) {
+ if( TQFile::exists( file ) ) {
// found file
- QFile f( file );
+ TQFile f( file );
if( !f.open( IO_ReadOnly ) ) {
kdDebug() << "(K3bCddbLocalQuery) Could not open file" << endl;
}
else {
- QTextStream t( &f );
+ TQTextStream t( &f );
K3bCddbResultEntry entry;
parseEntry( t, entry );
K3bCddbResultHeader header;
- header.discid = QString::number( toc().discId(), 16 ).rightJustify( 8, '0' );
+ header.discid = TQString::number( toc().discId(), 16 ).rightJustify( 8, '0' );
header.category = *it;
header.title = entry.cdTitle;
header.artist = entry.cdArtist;
@@ -94,15 +94,15 @@ void K3bCddbLocalQuery::doQuery()
void K3bCddbLocalQuery::doMatchQuery()
{
- QString path = preparePath( m_cddbDir ) + header().category + "/" + header().discid;
+ TQString path = preparePath( m_cddbDir ) + header().category + "/" + header().discid;
- QFile f( path );
+ TQFile f( path );
if( !f.open( IO_ReadOnly ) ) {
kdDebug() << "(K3bCddbLocalQuery) Could not open file" << endl;
setError( READ_ERROR );
}
else {
- QTextStream t( &f );
+ TQTextStream t( &f );
parseEntry( t, result() );
result().discid = header().discid;
@@ -113,13 +113,13 @@ void K3bCddbLocalQuery::doMatchQuery()
}
-QString K3bCddbLocalQuery::preparePath( const QString& p )
+TQString K3bCddbLocalQuery::preparePath( const TQString& p )
{
- QString path = p;
+ TQString path = p;
if( path.startsWith( "~" ) )
- path.replace( 0, 1, QDir::homeDirPath() );
+ path.tqreplace( 0, 1, TQDir::homeDirPath() );
else if( !path.startsWith( "/" ) )
- path.prepend( QDir::homeDirPath() );
+ path.prepend( TQDir::homeDirPath() );
if( path[path.length()-1] != '/' )
path.append( "/" );
diff --git a/libk3b/cddb/k3bcddblocalquery.h b/libk3b/cddb/k3bcddblocalquery.h
index d68d379..f373698 100644
--- a/libk3b/cddb/k3bcddblocalquery.h
+++ b/libk3b/cddb/k3bcddblocalquery.h
@@ -15,34 +15,35 @@
-#ifndef K3BCDDB_LOCAL_QUERY_H
-#define K3BCDDB_LOCAL_QUERY_H
+#ifndef K3BCDDB_LOCAL_TQUERY_H
+#define K3BCDDB_LOCAL_TQUERY_H
#include "k3bcddbquery.h"
#include "k3bcddbresult.h"
-#include <qstring.h>
+#include <tqstring.h>
class K3bCddbLocalQuery : public K3bCddbQuery
{
Q_OBJECT
+ TQ_OBJECT
public:
- K3bCddbLocalQuery( QObject* parent = 0, const char* name = 0 );
+ K3bCddbLocalQuery( TQObject* tqparent = 0, const char* name = 0 );
~K3bCddbLocalQuery();
public slots:
- void setCddbDir( const QString& dir ) { m_cddbDir = dir; }
+ void setCddbDir( const TQString& dir ) { m_cddbDir = dir; }
protected:
void doQuery();
void doMatchQuery();
private:
- QString preparePath( const QString& p );
+ TQString preparePath( const TQString& p );
- QString m_cddbDir;
+ TQString m_cddbDir;
};
#endif
diff --git a/libk3b/cddb/k3bcddblocalsubmit.cpp b/libk3b/cddb/k3bcddblocalsubmit.cpp
index f2d1e69..ed1fdcb 100644
--- a/libk3b/cddb/k3bcddblocalsubmit.cpp
+++ b/libk3b/cddb/k3bcddblocalsubmit.cpp
@@ -17,16 +17,16 @@
#include "k3bcddblocalsubmit.h"
-#include <qdir.h>
-#include <qfile.h>
-#include <qtextstream.h>
+#include <tqdir.h>
+#include <tqfile.h>
+#include <tqtextstream.h>
#include <kdebug.h>
#include <klocale.h>
-K3bCddbLocalSubmit::K3bCddbLocalSubmit( QObject* parent, const char* name )
- : K3bCddbSubmit( parent, name )
+K3bCddbLocalSubmit::K3bCddbLocalSubmit( TQObject* tqparent, const char* name )
+ : K3bCddbSubmit( tqparent, name )
{
}
@@ -38,29 +38,29 @@ K3bCddbLocalSubmit::~K3bCddbLocalSubmit()
void K3bCddbLocalSubmit::doSubmit()
{
- QString path = m_cddbDir;
+ TQString path = m_cddbDir;
if( path.startsWith( "~" ) )
- path.replace( 0, 1, QDir::homeDirPath() + "/" );
+ path.tqreplace( 0, 1, TQDir::homeDirPath() + "/" );
else if( !path.startsWith( "/" ) )
- path.prepend( QDir::homeDirPath() + "/" );
+ path.prepend( TQDir::homeDirPath() + "/" );
if( path[path.length()-1] != '/' )
path.append( "/" );
- if( !QFile::exists( path ) && !QDir().mkdir( path ) ) {
+ if( !TQFile::exists( path ) && !TQDir().mkdir( path ) ) {
kdDebug() << "(K3bCddbLocalSubmit) could not create directory: " << path << endl;
setError( IO_ERROR );
emit submitFinished( this );
return;
}
- if( QFile::exists( path ) ) {
+ if( TQFile::exists( path ) ) {
// if the category dir does not exists
// create it
path += resultEntry().category;
- if( !QFile::exists( path ) ) {
- if( !QDir().mkdir( path ) ) {
+ if( !TQFile::exists( path ) ) {
+ if( !TQDir().mkdir( path ) ) {
kdDebug() << "(K3bCddbLocalSubmit) could not create directory: " << path << endl;
setError( IO_ERROR );
emit submitFinished( this );
@@ -70,7 +70,7 @@ void K3bCddbLocalSubmit::doSubmit()
// we always overwrite existing entries
path += "/" + resultEntry().discid;
- QFile entryFile( path );
+ TQFile entryFile( path );
if( entryFile.exists() ) {
kdDebug() << "(K3bCddbLocalSubmit) file already exists: " << path << endl;
}
@@ -82,8 +82,8 @@ void K3bCddbLocalSubmit::doSubmit()
}
else {
kdDebug() << "(K3bCddbLocalSubmit) creating file: " << path << endl;
- QTextStream entryStream( &entryFile );
- entryStream.setEncoding( QTextStream::UnicodeUTF8 );
+ TQTextStream entryStream( &entryFile );
+ entryStream.setEncoding( TQTextStream::UnicodeUTF8 );
entryStream << resultEntry().rawData;
entryFile.close();
@@ -94,7 +94,7 @@ void K3bCddbLocalSubmit::doSubmit()
else {
kdDebug() << "(K3bCddbLocalSubmit) could not find directory: " << path << endl;
setError( IO_ERROR );
- emit infoMessage( i18n("Could not find directory: %1").arg(path) );
+ emit infoMessage( i18n("Could not find directory: %1").tqarg(path) );
emit submitFinished( this );
}
}
diff --git a/libk3b/cddb/k3bcddblocalsubmit.h b/libk3b/cddb/k3bcddblocalsubmit.h
index 8b7ea91..88f127c 100644
--- a/libk3b/cddb/k3bcddblocalsubmit.h
+++ b/libk3b/cddb/k3bcddblocalsubmit.h
@@ -19,25 +19,26 @@
#include "k3bcddbsubmit.h"
-#include <qstring.h>
+#include <tqstring.h>
class K3bCddbLocalSubmit : public K3bCddbSubmit
{
Q_OBJECT
+ TQ_OBJECT
public:
- K3bCddbLocalSubmit( QObject* parent = 0, const char* name = 0 );
+ K3bCddbLocalSubmit( TQObject* tqparent = 0, const char* name = 0 );
~K3bCddbLocalSubmit();
public slots:
- void setCddbDir( const QString& dir ) { m_cddbDir = dir; }
+ void setCddbDir( const TQString& dir ) { m_cddbDir = dir; }
protected slots:
void doSubmit();
private:
- QString m_cddbDir;
+ TQString m_cddbDir;
};
#endif
diff --git a/libk3b/cddb/k3bcddbmultientriesdialog.cpp b/libk3b/cddb/k3bcddbmultientriesdialog.cpp
index 094176a..df5a938 100644
--- a/libk3b/cddb/k3bcddbmultientriesdialog.cpp
+++ b/libk3b/cddb/k3bcddbmultientriesdialog.cpp
@@ -16,42 +16,42 @@
#include "k3bcddbmultientriesdialog.h"
-#include <qlayout.h>
-#include <qframe.h>
-#include <qlabel.h>
+#include <tqlayout.h>
+#include <tqframe.h>
+#include <tqlabel.h>
#include <klistbox.h>
#include <klocale.h>
-K3bCddbMultiEntriesDialog::K3bCddbMultiEntriesDialog( QWidget* parent, const char* name )
- : KDialogBase( Plain, i18n("CDDB Database Entry"), Ok|Cancel, Ok, parent, name )
+K3bCddbMultiEntriesDialog::K3bCddbMultiEntriesDialog( TQWidget* tqparent, const char* name )
+ : KDialogBase( Plain, i18n("CDDB Database Entry"), Ok|Cancel, Ok, tqparent, name )
{
- QFrame* frame = plainPage();
- QVBoxLayout* layout = new QVBoxLayout( frame );
- layout->setAutoAdd( true );
- layout->setSpacing( spacingHint() );
- layout->setMargin( 0 );
+ TQFrame* frame = plainPage();
+ TQVBoxLayout* tqlayout = new TQVBoxLayout( frame );
+ tqlayout->setAutoAdd( true );
+ tqlayout->setSpacing( spacingHint() );
+ tqlayout->setMargin( 0 );
- QLabel* infoLabel = new QLabel( i18n("K3b found multiple inexact CDDB entries. Please select one."), frame );
- infoLabel->setAlignment( WordBreak );
+ TQLabel* infoLabel = new TQLabel( i18n("K3b found multiple inexact CDDB entries. Please select one."), frame );
+ infoLabel->tqsetAlignment( WordBreak );
m_listBox = new KListBox( frame, "list_box");
setMinimumSize( 280, 200 );
}
-K3bCddbResultHeader K3bCddbMultiEntriesDialog::selectCddbEntry( K3bCddbQuery* query, QWidget* parent )
+K3bCddbResultHeader K3bCddbMultiEntriesDialog::selectCddbEntry( K3bCddbQuery* query, TQWidget* tqparent )
{
- K3bCddbMultiEntriesDialog d( parent );
+ K3bCddbMultiEntriesDialog d( tqparent );
- const QValueList<K3bCddbResultHeader> headers = query->getInexactMatches();
+ const TQValueList<K3bCddbResultHeader> headers = query->getInexactMatches();
int i = 1;
- for( QValueListConstIterator<K3bCddbResultHeader> it = headers.begin();
+ for( TQValueListConstIterator<K3bCddbResultHeader> it = headers.begin();
it != headers.end(); ++it ) {
- d.m_listBox->insertItem( QString::number(i) + " " +
+ d.m_listBox->insertItem( TQString::number(i) + " " +
(*it).artist + " - " +
(*it).title + " (" +
(*it).category + ")" );
@@ -60,7 +60,7 @@ K3bCddbResultHeader K3bCddbMultiEntriesDialog::selectCddbEntry( K3bCddbQuery* qu
d.m_listBox->setSelected( 0, true );
- if( d.exec() == QDialog::Accepted )
+ if( d.exec() == TQDialog::Accepted )
return headers[ d.m_listBox->currentItem() >= 0 ? d.m_listBox->currentItem() : 0 ];
else
return K3bCddbResultHeader();
diff --git a/libk3b/cddb/k3bcddbmultientriesdialog.h b/libk3b/cddb/k3bcddbmultientriesdialog.h
index 15cc6f8..43c409e 100644
--- a/libk3b/cddb/k3bcddbmultientriesdialog.h
+++ b/libk3b/cddb/k3bcddbmultientriesdialog.h
@@ -23,7 +23,7 @@
#include "k3bcddbresult.h"
-class QStringList;
+class TQStringList;
class KListBox;
/**
@@ -32,14 +32,15 @@ class KListBox;
class K3bCddbMultiEntriesDialog : public KDialogBase
{
Q_OBJECT
+ TQ_OBJECT
public:
~K3bCddbMultiEntriesDialog();
- static K3bCddbResultHeader selectCddbEntry( K3bCddbQuery* query, QWidget* parent = 0 );
+ static K3bCddbResultHeader selectCddbEntry( K3bCddbQuery* query, TQWidget* tqparent = 0 );
protected:
- K3bCddbMultiEntriesDialog( QWidget* parent = 0, const char* name = 0);
+ K3bCddbMultiEntriesDialog( TQWidget* tqparent = 0, const char* name = 0);
private:
KListBox *m_listBox;
diff --git a/libk3b/cddb/k3bcddbpquery.cpp b/libk3b/cddb/k3bcddbpquery.cpp
index fefc8e4..15f3e18 100644
--- a/libk3b/cddb/k3bcddbpquery.cpp
+++ b/libk3b/cddb/k3bcddbpquery.cpp
@@ -15,9 +15,9 @@
#include "k3bcddbpquery.h"
-#include <qstringlist.h>
-#include <qsocket.h>
-#include <qtextstream.h>
+#include <tqstringlist.h>
+#include <tqsocket.h>
+#include <tqtextstream.h>
#include <klocale.h>
#include <kdebug.h>
@@ -25,18 +25,18 @@
-K3bCddbpQuery::K3bCddbpQuery( QObject* parent, const char* name )
- :K3bCddbQuery( parent, name )
+K3bCddbpQuery::K3bCddbpQuery( TQObject* tqparent, const char* name )
+ :K3bCddbQuery( tqparent, name )
{
- m_socket = new QSocket( this );
+ m_socket = new TQSocket( this );
m_stream.setDevice( m_socket );
- m_stream.setEncoding( QTextStream::UnicodeUTF8 );
+ m_stream.setEncoding( TQTextStream::UnicodeUTF8 );
- connect( m_socket, SIGNAL(connected()), this, SLOT(slotConnected()) );
- connect( m_socket, SIGNAL(hostFound()), this, SLOT(slotHostFound()) );
- connect( m_socket, SIGNAL(connectionClosed()), this, SLOT(slotConnectionClosed()) );
- connect( m_socket, SIGNAL(error(int)), this, SLOT(slotError(int)) );
- connect( m_socket, SIGNAL(readyRead()), this, SLOT(slotReadyRead()) );
+ connect( m_socket, TQT_SIGNAL(connected()), this, TQT_SLOT(slotConnected()) );
+ connect( m_socket, TQT_SIGNAL(hostFound()), this, TQT_SLOT(slotHostFound()) );
+ connect( m_socket, TQT_SIGNAL(connectionClosed()), this, TQT_SLOT(slotConnectionClosed()) );
+ connect( m_socket, TQT_SIGNAL(error(int)), this, TQT_SLOT(slotError(int)) );
+ connect( m_socket, TQT_SIGNAL(readyRead()), this, TQT_SLOT(slotReadyRead()) );
}
@@ -54,7 +54,7 @@ void K3bCddbpQuery::doQuery()
// connect to the server
m_socket->connectToHost( m_server, m_port );
- emit infoMessage( i18n("Searching %1 on port %2").arg(m_server).arg(m_port) );
+ emit infoMessage( i18n("Searching %1 on port %2").tqarg(m_server).tqarg(m_port) );
}
@@ -63,7 +63,7 @@ void K3bCddbpQuery::doMatchQuery()
// we should still be connected
// TODO: check this
- QString read = QString( "cddb read %1 %2").arg( header().category ).arg( header().discid );
+ TQString read = TQString( "cddb read %1 %2").tqarg( header().category ).tqarg( header().discid );
m_state = READ;
m_parsingBuffer = "";
@@ -95,7 +95,7 @@ void K3bCddbpQuery::slotConnectionClosed()
void K3bCddbpQuery::cddbpQuit()
{
- m_state = QUIT;
+ m_state = TQUIT;
m_stream << "quit" << endl << flush;
}
@@ -103,7 +103,7 @@ void K3bCddbpQuery::cddbpQuit()
void K3bCddbpQuery::slotReadyRead()
{
while( m_socket->canReadLine() ) {
- QString line = m_stream.readLine();
+ TQString line = m_stream.readLine();
// kdDebug() << "(K3bCddbpQuery) line: " << line << endl;
@@ -146,13 +146,13 @@ void K3bCddbpQuery::slotReadyRead()
}
// just ignore the reply since it's not important for the functionality
- m_state = QUERY;
+ m_state = TQUERY;
m_stream << queryString() << endl << flush;
break;
}
- case QUERY:
+ case TQUERY:
if( getCode( line ) == 200 ) {
// parse exact match and send a read command
K3bCddbResultHeader header;
@@ -169,7 +169,7 @@ void K3bCddbpQuery::slotReadyRead()
emit infoMessage( i18n("Found multiple exact matches") );
- m_state = QUERY_DATA;
+ m_state = TQUERY_DATA;
}
else if( getCode( line ) == 211 ) {
@@ -177,7 +177,7 @@ void K3bCddbpQuery::slotReadyRead()
emit infoMessage( i18n("Found inexact matches") );
- m_state = QUERY_DATA;
+ m_state = TQUERY_DATA;
}
else if( getCode( line ) == 202 ) {
@@ -190,12 +190,12 @@ void K3bCddbpQuery::slotReadyRead()
else {
kdDebug() << "(K3bCddbpQuery) Error while querying: " << line << endl;
emit infoMessage( i18n("Error while querying") );
- setError( QUERY_ERROR );
+ setError( TQUERY_ERROR );
cddbpQuit();
}
break;
- case QUERY_DATA:
+ case TQUERY_DATA:
if( line.startsWith( "." ) ) {
// finished query
// go on reading
@@ -234,7 +234,7 @@ void K3bCddbpQuery::slotReadyRead()
kdDebug() << "(K3bCddbpQuery) query finished." << endl;
- QTextStream strStream( m_parsingBuffer, IO_ReadOnly );
+ TQTextStream strStream( m_parsingBuffer, IO_ReadOnly );
parseEntry( strStream, result() );
setError( SUCCESS );
@@ -246,7 +246,7 @@ void K3bCddbpQuery::slotReadyRead()
}
break;
- case QUIT:
+ case TQUIT:
// no parsing needed
break;
}
@@ -257,17 +257,17 @@ void K3bCddbpQuery::slotReadyRead()
void K3bCddbpQuery::slotError( int e )
{
switch(e) {
- case QSocket::ErrConnectionRefused:
- kdDebug() << i18n("Connection to %1 refused").arg( m_server ) << endl;
- emit infoMessage( i18n("Connection to %1 refused").arg( m_server ) );
+ case TQSocket::ErrConnectionRefused:
+ kdDebug() << i18n("Connection to %1 refused").tqarg( m_server ) << endl;
+ emit infoMessage( i18n("Connection to %1 refused").tqarg( m_server ) );
break;
- case QSocket::ErrHostNotFound:
- kdDebug() << i18n("Could not find host %1").arg( m_server ) << endl;
- emit infoMessage( i18n("Could not find host %1").arg( m_server ) );
+ case TQSocket::ErrHostNotFound:
+ kdDebug() << i18n("Could not find host %1").tqarg( m_server ) << endl;
+ emit infoMessage( i18n("Could not find host %1").tqarg( m_server ) );
break;
- case QSocket::ErrSocketRead:
- kdDebug() << i18n("Error while reading from %1").arg( m_server ) << endl;
- emit infoMessage( i18n("Error while reading from %1").arg( m_server ) );
+ case TQSocket::ErrSocketRead:
+ kdDebug() << i18n("Error while reading from %1").tqarg( m_server ) << endl;
+ emit infoMessage( i18n("Error while reading from %1").tqarg( m_server ) );
break;
}
diff --git a/libk3b/cddb/k3bcddbpquery.h b/libk3b/cddb/k3bcddbpquery.h
index 78fe5df..423cad1 100644
--- a/libk3b/cddb/k3bcddbpquery.h
+++ b/libk3b/cddb/k3bcddbpquery.h
@@ -13,28 +13,29 @@
*/
-#ifndef K3BCDDBP_QUERY_H
-#define K3BCDDBP_QUERY_H
+#ifndef K3BCDDBP_TQUERY_H
+#define K3BCDDBP_TQUERY_H
#include "k3bcddbquery.h"
#include "k3bcddbresult.h"
-#include <qstring.h>
-#include <qvaluelist.h>
-#include <qtextstream.h>
+#include <tqstring.h>
+#include <tqvaluelist.h>
+#include <tqtextstream.h>
-class QSocket;
+class TQSocket;
class K3bCddbpQuery : public K3bCddbQuery
{
Q_OBJECT
+ TQ_OBJECT
public:
- K3bCddbpQuery( QObject* parent = 0, const char* name = 0 );
+ K3bCddbpQuery( TQObject* tqparent = 0, const char* name = 0 );
~K3bCddbpQuery();
public slots:
- void setServer( const QString& s, int port = 8080 ) { m_server = s; m_port = port; }
+ void setServer( const TQString& s, int port = 8080 ) { m_server = s; m_port = port; }
protected slots:
void slotHostFound();
@@ -47,16 +48,16 @@ class K3bCddbpQuery : public K3bCddbQuery
private:
void cddbpQuit();
- enum State { GREETING, HANDSHAKE, PROTO, QUERY, QUERY_DATA, READ, READ_DATA, QUIT };
+ enum State { GREETING, HANDSHAKE, PROTO, TQUERY, TQUERY_DATA, READ, READ_DATA, TQUIT };
int m_state;
- QString m_server;
+ TQString m_server;
int m_port;
- QSocket* m_socket;
- QTextStream m_stream;
+ TQSocket* m_socket;
+ TQTextStream m_stream;
- QString m_parsingBuffer;
+ TQString m_parsingBuffer;
};
#endif
diff --git a/libk3b/cddb/k3bcddbquery.cpp b/libk3b/cddb/k3bcddbquery.cpp
index 783f9a4..6cf8eb0 100644
--- a/libk3b/cddb/k3bcddbquery.cpp
+++ b/libk3b/cddb/k3bcddbquery.cpp
@@ -25,18 +25,18 @@
#include <klocale.h>
-#include <qtextstream.h>
-#include <qstringlist.h>
-#include <qregexp.h>
-#include <qtimer.h>
+#include <tqtextstream.h>
+#include <tqstringlist.h>
+#include <tqregexp.h>
+#include <tqtimer.h>
#include <stdlib.h>
-K3bCddbQuery::K3bCddbQuery( QObject* parent, const char* name )
- : QObject(parent, name)
+K3bCddbQuery::K3bCddbQuery( TQObject* tqparent, const char* name )
+ : TQObject(tqparent, name)
{
m_bQueryFinishedEmited = false;
}
@@ -53,7 +53,7 @@ void K3bCddbQuery::query( const K3bDevice::Toc& toc )
m_toc = toc;
m_inexactMatches.clear();
- QTimer::singleShot( 0, this, SLOT(doQuery()) );
+ TQTimer::singleShot( 0, this, TQT_SLOT(doQuery()) );
}
@@ -64,26 +64,26 @@ void K3bCddbQuery::queryMatch( const K3bCddbResultHeader& header )
m_result.category = header.category;
m_result.discid = header.discid;
- QTimer::singleShot( 0, this, SLOT(doMatchQuery()) );
+ TQTimer::singleShot( 0, this, TQT_SLOT(doMatchQuery()) );
}
-const QStringList& K3bCddbQuery::categories()
+const TQStringList& K3bCddbQuery::categories()
{
- static QStringList s_cat = QStringList::split( ",", "rock,blues,misc,classical,"
+ static TQStringList s_cat = TQStringList::split( ",", "rock,blues,misc,classical,"
"country,data,folk,jazz,newage,reggae,soundtrack" );
return s_cat;
}
-bool K3bCddbQuery::parseEntry( QTextStream& stream, K3bCddbResultEntry& entry )
+bool K3bCddbQuery::parseEntry( TQTextStream& stream, K3bCddbResultEntry& entry )
{
entry.rawData = "";
- stream.setEncoding( QTextStream::UnicodeUTF8 );
+ stream.setEncoding( TQTextStream::UnicodeUTF8 );
// parse data
- QString line;
+ TQString line;
while( !(line = stream.readLine()).isNull() ) {
entry.rawData.append(line + "\n");
@@ -94,7 +94,7 @@ bool K3bCddbQuery::parseEntry( QTextStream& stream, K3bCddbResultEntry& entry )
}
else if( line.startsWith( "DYEAR" ) ) {
- QString year = line.mid( 6 );
+ TQString year = line.mid( 6 );
if( year.length() == 4 )
entry.year = year.toInt();
}
@@ -108,7 +108,7 @@ bool K3bCddbQuery::parseEntry( QTextStream& stream, K3bCddbResultEntry& entry )
}
else if( line.startsWith( "TTITLE" ) ) {
- int eqSgnPos = line.find( "=" );
+ int eqSgnPos = line.tqfind( "=" );
bool ok;
uint trackNum = (uint)line.mid( 6, eqSgnPos - 6 ).toInt( &ok );
if( !ok )
@@ -129,7 +129,7 @@ bool K3bCddbQuery::parseEntry( QTextStream& stream, K3bCddbResultEntry& entry )
}
else if( line.startsWith( "EXTT" ) ) {
- int eqSgnPos = line.find( "=" );
+ int eqSgnPos = line.tqfind( "=" );
bool ok;
uint trackNum = (uint)line.mid( 4, eqSgnPos - 4 ).toInt( &ok );
if( !ok )
@@ -157,8 +157,8 @@ bool K3bCddbQuery::parseEntry( QTextStream& stream, K3bCddbResultEntry& entry )
// now split the titles in the last added match
// if no " / " delimiter is present title and artist are the same
// -------------------------------------------------------------------
- QString fullTitle = entry.cdTitle;
- int splitPos = fullTitle.find( " / " );
+ TQString fullTitle = entry.cdTitle;
+ int splitPos = fullTitle.tqfind( " / " );
if( splitPos < 0 )
entry.cdArtist = fullTitle;
else {
@@ -168,10 +168,10 @@ bool K3bCddbQuery::parseEntry( QTextStream& stream, K3bCddbResultEntry& entry )
}
- for( QStringList::iterator it = entry.titles.begin();
+ for( TQStringList::iterator it = entry.titles.begin();
it != entry.titles.end(); ++it ) {
- QString fullTitle = *it;
- int splitPos = fullTitle.find( " / " );
+ TQString fullTitle = *it;
+ int splitPos = fullTitle.tqfind( " / " );
if( splitPos < 0 )
entry.artists.append( entry.cdArtist );
else {
@@ -183,31 +183,31 @@ bool K3bCddbQuery::parseEntry( QTextStream& stream, K3bCddbResultEntry& entry )
// replace all "\\n" with "\n"
- for( QStringList::iterator it = entry.titles.begin();
+ for( TQStringList::iterator it = entry.titles.begin();
it != entry.titles.end(); ++it ) {
- (*it).replace( "\\\\\\\\n", "\\n" );
+ (*it).tqreplace( "\\\\\\\\n", "\\n" );
}
- for( QStringList::iterator it = entry.artists.begin();
+ for( TQStringList::iterator it = entry.artists.begin();
it != entry.artists.end(); ++it ) {
- (*it).replace( "\\\\\\\\n", "\\n" );
+ (*it).tqreplace( "\\\\\\\\n", "\\n" );
}
- for( QStringList::iterator it = entry.extInfos.begin();
+ for( TQStringList::iterator it = entry.extInfos.begin();
it != entry.extInfos.end(); ++it ) {
- (*it).replace( "\\\\\\\\n", "\\n" );
+ (*it).tqreplace( "\\\\\\\\n", "\\n" );
}
- entry.cdTitle.replace( "\\\\\\\\n", "\\n" );
- entry.cdArtist.replace( "\\\\\\\\n", "\\n" );
- entry.cdExtInfo.replace( "\\\\\\\\n", "\\n" );
- entry.genre.replace( "\\\\\\\\n", "\\n" );
+ entry.cdTitle.tqreplace( "\\\\\\\\n", "\\n" );
+ entry.cdArtist.tqreplace( "\\\\\\\\n", "\\n" );
+ entry.cdExtInfo.tqreplace( "\\\\\\\\n", "\\n" );
+ entry.genre.tqreplace( "\\\\\\\\n", "\\n" );
return true;
}
-int K3bCddbQuery::getCode( const QString& line )
+int K3bCddbQuery::getCode( const TQString& line )
{
bool ok;
int code = line.left( 3 ).toInt( &ok );
@@ -217,44 +217,44 @@ int K3bCddbQuery::getCode( const QString& line )
}
-QString K3bCddbQuery::handshakeString() const
+TQString K3bCddbQuery::handshakeString() const
{
- QString user( getenv("USER") );
- QString host( getenv("HOST") );
+ TQString user( getenv("USER") );
+ TQString host( getenv("HOST") );
if( user.isEmpty() )
user = "kde-user";
if( host.isEmpty() )
host = "kde-host";
- return QString("%1 %2 K3b %3").arg(user).arg(host).arg(kapp->aboutData()->version());
+ return TQString("%1 %2 K3b %3").tqarg(user).tqarg(host).tqarg(kapp->aboutData()->version());
}
-QString K3bCddbQuery::queryString() const
+TQString K3bCddbQuery::queryString() const
{
- QString query = "cddb query "
- + QString::number( m_toc.discId(), 16 ).rightJustify( 8, '0' )
+ TQString query = "cddb query "
+ + TQString::number( m_toc.discId(), 16 ).rightJustify( 8, '0' )
+ " "
- + QString::number( (unsigned int)m_toc.count() );
+ + TQString::number( (unsigned int)m_toc.count() );
for( K3bDevice::Toc::const_iterator it = m_toc.begin(); it != m_toc.end(); ++it ) {
- query.append( QString( " %1" ).arg( (*it).firstSector().lba() ) );
+ query.append( TQString( " %1" ).tqarg( (*it).firstSector().lba() ) );
}
- query.append( QString( " %1" ).arg( m_toc.length().lba() / 75 ) );
+ query.append( TQString( " %1" ).tqarg( m_toc.length().lba() / 75 ) );
return query;
}
-bool K3bCddbQuery::parseMatchHeader( const QString& line, K3bCddbResultHeader& header )
+bool K3bCddbQuery::parseMatchHeader( const TQString& line, K3bCddbResultHeader& header )
{
// format: category id title
// where title could be artist and title splitted with a /
header.category = line.section( ' ', 0, 0 );
header.discid = line.section( ' ', 1, 1 );
header.title = line.mid( header.category.length() + header.discid.length() + 2 );
- int slashPos = header.title.find( "/" );
+ int slashPos = header.title.tqfind( "/" );
if( slashPos > 0 ) {
header.artist = header.title.left(slashPos).stripWhiteSpace();
header.title = header.title.mid( slashPos+1 ).stripWhiteSpace();
diff --git a/libk3b/cddb/k3bcddbquery.h b/libk3b/cddb/k3bcddbquery.h
index 569e882..eebc4cb 100644
--- a/libk3b/cddb/k3bcddbquery.h
+++ b/libk3b/cddb/k3bcddbquery.h
@@ -14,12 +14,12 @@
*/
-#ifndef K3BCDDB_QUERY_H
-#define K3BCDDB_QUERY_H
+#ifndef K3BCDDB_TQUERY_H
+#define K3BCDDB_TQUERY_H
-#include <qobject.h>
-#include <qstring.h>
-#include <qtextstream.h>
+#include <tqobject.h>
+#include <tqstring.h>
+#include <tqtextstream.h>
#include "k3bcddbresult.h"
@@ -27,12 +27,13 @@
#include "k3b_export.h"
-class LIBK3B_EXPORT K3bCddbQuery : public QObject
+class LIBK3B_EXPORT K3bCddbQuery : public TQObject
{
Q_OBJECT
+ TQ_OBJECT
public:
- K3bCddbQuery( QObject* parent = 0, const char* name = 0 );
+ K3bCddbQuery( TQObject* tqparent = 0, const char* name = 0 );
virtual ~K3bCddbQuery();
void query( const K3bDevice::Toc& );
@@ -48,15 +49,15 @@ class LIBK3B_EXPORT K3bCddbQuery : public QObject
* After emitting the signal inexactMatches one has to choose one
* of these entries and query it with queryInexactMatch
*/
- const QValueList<K3bCddbResultHeader>& getInexactMatches() const { return m_inexactMatches; }
+ const TQValueList<K3bCddbResultHeader>& getInexactMatches() const { return m_inexactMatches; }
- static const QStringList& categories();
+ static const TQStringList& categories();
enum Error { SUCCESS = 0,
CANCELED,
NO_ENTRY_FOUND,
CONNECTION_ERROR,
- QUERY_ERROR,
+ TQUERY_ERROR,
READ_ERROR,
FAILURE,
WORKING };
@@ -76,7 +77,7 @@ class LIBK3B_EXPORT K3bCddbQuery : public QObject
*/
void inexactMatches( K3bCddbQuery* );
- void infoMessage( const QString& );
+ void infoMessage( const TQString& );
protected slots:
virtual void doQuery() = 0;
@@ -88,11 +89,11 @@ class LIBK3B_EXPORT K3bCddbQuery : public QObject
K3bCddbResultEntry& result() { return m_result; }
void setError( int e ) { m_error = e; }
- bool parseEntry( QTextStream&, K3bCddbResultEntry& );
- int getCode( const QString& );
- QString handshakeString() const;
- QString queryString() const;
- bool parseMatchHeader( const QString& line, K3bCddbResultHeader& header );
+ bool parseEntry( TQTextStream&, K3bCddbResultEntry& );
+ int getCode( const TQString& );
+ TQString handshakeString() const;
+ TQString queryString() const;
+ bool parseMatchHeader( const TQString& line, K3bCddbResultHeader& header );
/**
* since I'm not quite sure when the socket will emit connectionClosed
@@ -101,7 +102,7 @@ class LIBK3B_EXPORT K3bCddbQuery : public QObject
*/
void emitQueryFinished();
- QValueList<K3bCddbResultHeader> m_inexactMatches;
+ TQValueList<K3bCddbResultHeader> m_inexactMatches;
private:
K3bDevice::Toc m_toc;
diff --git a/libk3b/cddb/k3bcddbresult.h b/libk3b/cddb/k3bcddbresult.h
index 46dcb9a..9486bff 100644
--- a/libk3b/cddb/k3bcddbresult.h
+++ b/libk3b/cddb/k3bcddbresult.h
@@ -19,17 +19,17 @@
#define K3B_CDDB_RESULT_H
-#include <qstringlist.h>
+#include <tqstringlist.h>
#include "k3b_export.h"
class LIBK3B_EXPORT K3bCddbResultHeader
{
public:
- QString category;
- QString title;
- QString artist;
- QString discid;
+ TQString category;
+ TQString title;
+ TQString artist;
+ TQString discid;
};
@@ -42,20 +42,20 @@ class LIBK3B_EXPORT K3bCddbResultEntry
year(0) {
}
- QStringList titles;
- QStringList artists;
- QStringList extInfos;
+ TQStringList titles;
+ TQStringList artists;
+ TQStringList extInfos;
- QString cdTitle;
- QString cdArtist;
- QString cdExtInfo;
+ TQString cdTitle;
+ TQString cdArtist;
+ TQString cdExtInfo;
- QString genre;
- QString category;
+ TQString genre;
+ TQString category;
int year;
- QString discid;
+ TQString discid;
- QString rawData;
+ TQString rawData;
};
@@ -71,7 +71,7 @@ class LIBK3B_EXPORT K3bCddbResult
int foundEntries() const;
private:
- QValueList<K3bCddbResultEntry> m_entries;
+ TQValueList<K3bCddbResultEntry> m_entries;
K3bCddbResultEntry m_emptyEntry;
};
diff --git a/libk3b/cddb/k3bcddbsubmit.cpp b/libk3b/cddb/k3bcddbsubmit.cpp
index a04dbcb..01aa7f8 100644
--- a/libk3b/cddb/k3bcddbsubmit.cpp
+++ b/libk3b/cddb/k3bcddbsubmit.cpp
@@ -16,11 +16,11 @@
#include "k3bcddbsubmit.h"
-#include <qtimer.h>
+#include <tqtimer.h>
-K3bCddbSubmit::K3bCddbSubmit( QObject* parent, const char* name )
- : QObject( parent, name )
+K3bCddbSubmit::K3bCddbSubmit( TQObject* tqparent, const char* name )
+ : TQObject( tqparent, name )
{
}
@@ -37,7 +37,7 @@ void K3bCddbSubmit::submit( const K3bCddbResultEntry& entry )
if( m_resultEntry.rawData.isEmpty() )
createDataStream( m_resultEntry );
- QTimer::singleShot( 0, this, SLOT(doSubmit()) );
+ TQTimer::singleShot( 0, this, TQT_SLOT(doSubmit()) );
}
@@ -45,7 +45,7 @@ void K3bCddbSubmit::createDataStream( K3bCddbResultEntry& entry )
{
entry.rawData.truncate(0);
- QTextStream ts( &entry.rawData, IO_WriteOnly );
+ TQTextStream ts( &entry.rawData, IO_WriteOnly );
ts << "#" << endl
<< "# Submitted via: K3b" << endl
diff --git a/libk3b/cddb/k3bcddbsubmit.h b/libk3b/cddb/k3bcddbsubmit.h
index ff57101..cb9906f 100644
--- a/libk3b/cddb/k3bcddbsubmit.h
+++ b/libk3b/cddb/k3bcddbsubmit.h
@@ -17,19 +17,20 @@
#ifndef K3BCDDB_SUBMIT_H
#define K3BCDDB_SUBMIT_H
-#include <qobject.h>
-#include <qstring.h>
+#include <tqobject.h>
+#include <tqstring.h>
#include "k3bcddbresult.h"
-class K3bCddbSubmit : public QObject
+class K3bCddbSubmit : public TQObject
{
Q_OBJECT
+ TQ_OBJECT
public:
- K3bCddbSubmit( QObject* parent = 0, const char* name = 0 );
+ K3bCddbSubmit( TQObject* tqparent = 0, const char* name = 0 );
virtual ~K3bCddbSubmit();
int error() const { return m_error; }
@@ -40,7 +41,7 @@ class K3bCddbSubmit : public QObject
void submit( const K3bCddbResultEntry& );
signals:
- void infoMessage( const QString& );
+ void infoMessage( const TQString& );
void submitFinished( K3bCddbSubmit* );
protected slots: