From d8cc8bdfa7fa624a526d5aa1626974e1444cb799 Mon Sep 17 00:00:00 2001 From: tpearson Date: Fri, 27 May 2011 19:21:21 +0000 Subject: 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 --- libk3bdevice/k3bcdtext.cpp | 100 ++++++++++++------------ libk3bdevice/k3bcdtext.h | 120 ++++++++++++++--------------- libk3bdevice/k3bcrc.cpp | 8 +- libk3bdevice/k3bcrc.h | 6 +- libk3bdevice/k3bdebug.cpp | 4 +- libk3bdevice/k3bdebug.h | 6 +- libk3bdevice/k3bdevice.cpp | 118 ++++++++++++++-------------- libk3bdevice/k3bdevice.h | 58 +++++++------- libk3bdevice/k3bdevice_mmc.cpp | 30 ++++---- libk3bdevice/k3bdeviceglobals.cpp | 16 ++-- libk3bdevice/k3bdeviceglobals.h | 14 ++-- libk3bdevice/k3bdevicemanager.cpp | 150 ++++++++++++++++++------------------ libk3bdevice/k3bdevicemanager.h | 67 ++++++++-------- libk3bdevice/k3bdiskinfo.cpp | 2 +- libk3bdevice/k3bdiskinfo.h | 6 +- libk3bdevice/k3bhalconnection.cpp | 88 ++++++++++----------- libk3bdevice/k3bhalconnection.h | 31 ++++---- libk3bdevice/k3bmmc.h | 6 +- libk3bdevice/k3bmsf.cpp | 14 ++-- libk3bdevice/k3bmsf.h | 10 +-- libk3bdevice/k3bscsicommand.cpp | 20 ++--- libk3bdevice/k3bscsicommand.h | 10 +-- libk3bdevice/k3bscsicommand_bsd.cpp | 10 +-- libk3bdevice/k3btoc.cpp | 14 ++-- libk3bdevice/k3btoc.h | 14 ++-- libk3bdevice/k3btrack.h | 14 ++-- 26 files changed, 469 insertions(+), 467 deletions(-) (limited to 'libk3bdevice') diff --git a/libk3bdevice/k3bcdtext.cpp b/libk3bdevice/k3bcdtext.cpp index 713f7dd..774c59e 100644 --- a/libk3bdevice/k3bcdtext.cpp +++ b/libk3bdevice/k3bcdtext.cpp @@ -20,7 +20,7 @@ #include -#include +#include #include @@ -64,30 +64,30 @@ namespace K3bDevice { cdtext_pack* pack = (cdtext_pack*)data; for( int i = 0; i < dataLen/18; ++i ) { - QString s; - s += QString( " %1 |" ).arg( pack[i].id1, 6, 16 ); - s += QString( " %1 |" ).arg( pack[i].id2, 6 ); - s += QString( " %1 |" ).arg( pack[i].id3, 6 ); - s += QString( " %1 |" ).arg( pack[i].charpos, 6 ); - s += QString( " %1 |" ).arg( pack[i].blocknum, 6 ); - s += QString( " %1 |" ).arg( pack[i].dbcc, 4 ); + TQString s; + s += TQString( " %1 |" ).tqarg( pack[i].id1, 6, 16 ); + s += TQString( " %1 |" ).tqarg( pack[i].id2, 6 ); + s += TQString( " %1 |" ).tqarg( pack[i].id3, 6 ); + s += TQString( " %1 |" ).tqarg( pack[i].charpos, 6 ); + s += TQString( " %1 |" ).tqarg( pack[i].blocknum, 6 ); + s += TQString( " %1 |" ).tqarg( pack[i].dbcc, 4 ); // char str[12]; // sprintf( str, "%c%c%c%c%c%c%c%c%c%c%c%c", -// pack[i].data[0] == '\0' ? '°' : pack[i].data[0], -// pack[i].data[1] == '\0' ? '°' : pack[i].data[1], -// pack[i].data[2] == '\0' ? '°' : pack[i].data[2], -// pack[i].data[3] == '\0' ? '°' : pack[i].data[3], -// pack[i].data[4] == '\0' ? '°' : pack[i].data[4], -// pack[i].data[5] == '\0' ? '°' : pack[i].data[5], -// pack[i].data[6] == '\0' ? '°' : pack[i].data[6], -// pack[i].data[7] == '\0' ? '°' : pack[i].data[7], -// pack[i].data[8] == '\0' ? '°' : pack[i].data[8], -// pack[i].data[9] == '\0' ? '°' : pack[i].data[9], -// pack[i].data[10] == '\0' ? '°' : pack[i].data[10], -// pack[i].data[11] == '\0' ? '°' : pack[i].data[11] ); -// s += QString( " %1 |" ).arg( "'" + QCString(str,13) + "'", 14 ); -// Q_UINT16 crc = pack[i].crc[0]<<8|pack[i].crc[1]; -// s += QString( " %1 |" ).arg( crc ); +// pack[i].data[0] == '\0' ? '�' : pack[i].data[0], +// pack[i].data[1] == '\0' ? '�' : pack[i].data[1], +// pack[i].data[2] == '\0' ? '�' : pack[i].data[2], +// pack[i].data[3] == '\0' ? '�' : pack[i].data[3], +// pack[i].data[4] == '\0' ? '�' : pack[i].data[4], +// pack[i].data[5] == '\0' ? '�' : pack[i].data[5], +// pack[i].data[6] == '\0' ? '�' : pack[i].data[6], +// pack[i].data[7] == '\0' ? '�' : pack[i].data[7], +// pack[i].data[8] == '\0' ? '�' : pack[i].data[8], +// pack[i].data[9] == '\0' ? '�' : pack[i].data[9], +// pack[i].data[10] == '\0' ? '�' : pack[i].data[10], +// pack[i].data[11] == '\0' ? '�' : pack[i].data[11] ); +// s += TQString( " %1 |" ).tqarg( "'" + TQCString(str,13) + "'", 14 ); +// TQ_UINT16 crc = pack[i].crc[0]<<8|pack[i].crc[1]; +// s += TQString( " %1 |" ).tqarg( crc ); k3bDebug() << s << endl; } } @@ -102,7 +102,7 @@ K3bDevice::CdText::CdText() K3bDevice::CdText::CdText( const K3bDevice::CdText& text ) - : QValueVector( text ), + : TQValueVector( text ), m_title( text.title() ), m_performer( text.performer() ), m_songwriter( text.songwriter() ), @@ -121,7 +121,7 @@ K3bDevice::CdText::CdText( const unsigned char* data, int len ) } -K3bDevice::CdText::CdText( const QByteArray& b ) +K3bDevice::CdText::CdText( const TQByteArray& b ) { setRawPackData( b ); } @@ -135,7 +135,7 @@ K3bDevice::CdText::CdText( int size ) void K3bDevice::CdText::clear() { - QValueVector::clear(); + TQValueVector::clear(); m_title.setLength(0); m_performer.setLength(0); @@ -175,7 +175,7 @@ void K3bDevice::CdText::setRawPackData( const unsigned char* data, int len ) pack[i].crc[0] ^= 0xff; pack[i].crc[1] ^= 0xff; - Q_UINT16 crc = calcX25( reinterpret_cast(&pack[i]), 18 ); + TQ_UINT16 crc = calcX25( reinterpret_cast(&pack[i]), 18 ); pack[i].crc[0] ^= 0xff; pack[i].crc[1] ^= 0xff; @@ -200,11 +200,11 @@ void K3bDevice::CdText::setRawPackData( const unsigned char* data, int len ) resize( trackNo ); char* nextNullPos = (char*)::memchr( nullPos+1, '\0', 11 - (nullPos - (char*)pack[i].data) ); - QString txtstr; + TQString txtstr; if( nextNullPos ) // take all chars up to the next null - txtstr = QString::fromLatin1( (char*)nullPos+1, nextNullPos - nullPos - 1 ); + txtstr = TQString::tqfromLatin1( (char*)nullPos+1, nextNullPos - nullPos - 1 ); else // take all chars to the end of the pack data (12 bytes) - txtstr = QString::fromLatin1( (char*)nullPos+1, 11 - (nullPos - (char*)pack[i].data) ); + txtstr = TQString::tqfromLatin1( (char*)nullPos+1, 11 - (nullPos - (char*)pack[i].data) ); // // a tab character means to use the same as for the previous track @@ -293,12 +293,12 @@ void K3bDevice::CdText::setRawPackData( const unsigned char* data, int len ) } -void K3bDevice::CdText::setRawPackData( const QByteArray& b ) +void K3bDevice::CdText::setRawPackData( const TQByteArray& b ) { setRawPackData( reinterpret_cast(b.data()), b.size() ); } -QByteArray K3bDevice::CdText::rawPackData() const +TQByteArray K3bDevice::CdText::rawPackData() const { // FIXME: every pack block may only consist of up to 255 packs. @@ -321,7 +321,7 @@ QByteArray K3bDevice::CdText::rawPackData() const // // create the CD-Text packs // - QByteArray data(0); + TQByteArray data(0); for( int i = 0; i <= 6; ++i ) { if( textLengthForPackType( 0x80 | i ) ) { appendByteArray( data, createPackData( 0x80 | i, pc ) ); @@ -358,7 +358,7 @@ QByteArray K3bDevice::CdText::rawPackData() const // // add MMC header // - QByteArray a( 4 ); + TQByteArray a( 4 ); a[0] = (data.size()+2)>>8 & 0xff; a[1] = (data.size()+2) & 0xff; a[2] = a[3] = 0; @@ -368,7 +368,7 @@ QByteArray K3bDevice::CdText::rawPackData() const } -void K3bDevice::CdText::appendByteArray( QByteArray& a, const QByteArray& b ) const +void K3bDevice::CdText::appendByteArray( TQByteArray& a, const TQByteArray& b ) const { unsigned int oldSize = a.size(); a.resize( oldSize + b.size() ); @@ -377,11 +377,11 @@ void K3bDevice::CdText::appendByteArray( QByteArray& a, const QByteArray& b ) co // this method also creates completely empty packs -QByteArray K3bDevice::CdText::createPackData( int packType, unsigned int& packCount ) const +TQByteArray K3bDevice::CdText::createPackData( int packType, unsigned int& packCount ) const { - QByteArray data; + TQByteArray data; unsigned int dataFill = 0; - QCString text = encodeCdText( textForPackType( packType, 0 ) ); + TQCString text = encodeCdText( textForPackType( packType, 0 ) ); unsigned int currentTrack = 0; unsigned int textPos = 0; unsigned int packPos = 0; @@ -401,7 +401,7 @@ QByteArray K3bDevice::CdText::createPackData( int packType, unsigned int& packCo // // Copy as many bytes as possible into the pack // - int copyBytes = QMIN( 12-packPos, text.length()-textPos ); + int copyBytes = TQMIN( 12-packPos, text.length()-textPos ); ::memcpy( reinterpret_cast(&pack.data[packPos]), &text.data()[textPos], copyBytes ); textPos += copyBytes; packPos += copyBytes; @@ -457,10 +457,10 @@ QByteArray K3bDevice::CdText::createPackData( int packType, unsigned int& packCo } -void K3bDevice::CdText::savePack( cdtext_pack* pack, QByteArray& data, unsigned int& dataFill ) const +void K3bDevice::CdText::savePack( cdtext_pack* pack, TQByteArray& data, unsigned int& dataFill ) const { // create CRC - Q_UINT16 crc = calcX25( reinterpret_cast(pack), sizeof(cdtext_pack)-2 ); + TQ_UINT16 crc = calcX25( reinterpret_cast(pack), sizeof(cdtext_pack)-2 ); // invert for Redbook compliance crc ^= 0xffff; @@ -471,7 +471,7 @@ void K3bDevice::CdText::savePack( cdtext_pack* pack, QByteArray& data, unsigned // append the pack to data if( data.size() < dataFill + sizeof(cdtext_pack) ) - data.resize( dataFill + sizeof(cdtext_pack), QGArray::SpeedOptim ); + data.tqresize( dataFill + sizeof(cdtext_pack), TQGArray::SpeedOptim ); ::memcpy( &data.data()[dataFill], reinterpret_cast( pack ), sizeof(cdtext_pack) ); @@ -480,7 +480,7 @@ void K3bDevice::CdText::savePack( cdtext_pack* pack, QByteArray& data, unsigned // track 0 means global cdtext -const QString& K3bDevice::CdText::textForPackType( int packType, unsigned int track ) const +const TQString& K3bDevice::CdText::textForPackType( int packType, unsigned int track ) const { switch( packType ) { default: @@ -524,7 +524,7 @@ const QString& K3bDevice::CdText::textForPackType( int packType, unsigned int tr if( track == 0 ) return discId(); else - return QString::null; + return TQString(); // case 0x87: // if( track == 0 ) @@ -551,19 +551,19 @@ unsigned int K3bDevice::CdText::textLengthForPackType( int packType ) const } -QCString K3bDevice::encodeCdText( const QString& s, bool* illegalChars ) +TQCString K3bDevice::encodeCdText( const TQString& s, bool* illegalChars ) { if( illegalChars ) *illegalChars = false; // TODO: do this without QT - QTextCodec* codec = QTextCodec::codecForName("ISO8859-1"); + TQTextCodec* codec = TQTextCodec::codecForName("ISO8859-1"); if( codec ) { - QCString encoded = codec->fromUnicode( s ); + TQCString encoded = codec->fromUnicode( s ); return encoded; } else { - QCString r(s.length()+1); + TQCString r(s.length()+1); for( unsigned int i = 0; i < s.length(); ++i ) { if( s[i].latin1() == 0 ) { // non-ASCII character @@ -580,7 +580,7 @@ QCString K3bDevice::encodeCdText( const QString& s, bool* illegalChars ) } -bool K3bDevice::CdText::checkCrc( const QByteArray& rawData ) +bool K3bDevice::CdText::checkCrc( const TQByteArray& rawData ) { return checkCrc( reinterpret_cast(rawData.data()), rawData.size() ); } @@ -675,7 +675,7 @@ bool K3bDevice::CdText::operator==( const K3bDevice::CdText& other ) const m_message == other.m_message && m_discId == other.m_discId && m_upcEan == other.m_upcEan && - QValueVector::operator==( other ) ); + TQValueVector::operator==( other ) ); } diff --git a/libk3bdevice/k3bcdtext.h b/libk3bdevice/k3bcdtext.h index 10f6c82..dd78d5e 100644 --- a/libk3bdevice/k3bcdtext.h +++ b/libk3bdevice/k3bcdtext.h @@ -17,8 +17,8 @@ #ifndef _K3B_CDTEXT_H_ #define _K3B_CDTEXT_H_ -#include -#include +#include +#include #include "k3bdevice_export.h" namespace K3bDevice @@ -43,22 +43,22 @@ namespace K3bDevice m_isrc.truncate(0); } - const QString& title() const { return m_title; } - const QString& performer() const { return m_performer; } - const QString& songwriter() const { return m_songwriter; } - const QString& composer() const { return m_composer; } - const QString& arranger() const { return m_arranger; } - const QString& message() const { return m_message; } - const QString& isrc() const { return m_isrc; } + const TQString& title() const { return m_title; } + const TQString& performer() const { return m_performer; } + const TQString& songwriter() const { return m_songwriter; } + const TQString& composer() const { return m_composer; } + const TQString& arranger() const { return m_arranger; } + const TQString& message() const { return m_message; } + const TQString& isrc() const { return m_isrc; } // TODO: use the real CD-TEXT charset (a modified ISO8859-1) - void setTitle( const QString& s ) { m_title = s; fixup(m_title); } - void setPerformer( const QString& s ) { m_performer = s; fixup(m_performer); } - void setSongwriter( const QString& s ) { m_songwriter = s; fixup(m_songwriter); } - void setComposer( const QString& s ) { m_composer = s; fixup(m_composer); } - void setArranger( const QString& s ) { m_arranger = s; fixup(m_arranger); } - void setMessage( const QString& s ) { m_message = s; fixup(m_message); } - void setIsrc( const QString& s ) { m_isrc = s; fixup(m_isrc); } + void setTitle( const TQString& s ) { m_title = s; fixup(m_title); } + void setPerformer( const TQString& s ) { m_performer = s; fixup(m_performer); } + void setSongwriter( const TQString& s ) { m_songwriter = s; fixup(m_songwriter); } + void setComposer( const TQString& s ) { m_composer = s; fixup(m_composer); } + void setArranger( const TQString& s ) { m_arranger = s; fixup(m_arranger); } + void setMessage( const TQString& s ) { m_message = s; fixup(m_message); } + void setIsrc( const TQString& s ) { m_isrc = s; fixup(m_isrc); } bool isEmpty() const { if( !m_title.isEmpty() ) @@ -84,34 +84,34 @@ namespace K3bDevice private: // TODO: remove this (see above) - void fixup( QString& s ) { s.replace( '/', "_" ); s.replace( '\"', "_" ); } + void fixup( TQString& s ) { s.tqreplace( '/', "_" ); s.tqreplace( '\"', "_" ); } - QString m_title; - QString m_performer; - QString m_songwriter; - QString m_composer; - QString m_arranger; - QString m_message; - QString m_isrc; + TQString m_title; + TQString m_performer; + TQString m_songwriter; + TQString m_composer; + TQString m_arranger; + TQString m_message; + TQString m_isrc; friend class CdText; }; - class LIBK3BDEVICE_EXPORT CdText : public QValueVector + class LIBK3BDEVICE_EXPORT CdText : public TQValueVector { friend class Device; public: CdText(); CdText( const unsigned char* data, int len ); - CdText( const QByteArray& ); + CdText( const TQByteArray& ); CdText( int size ); CdText( const CdText& ); void setRawPackData( const unsigned char*, int ); - void setRawPackData( const QByteArray& ); + void setRawPackData( const TQByteArray& ); - QByteArray rawPackData() const; + TQByteArray rawPackData() const; bool empty() const { if( !m_title.isEmpty() ) @@ -144,24 +144,24 @@ namespace K3bDevice void clear(); - const QString& title() const { return m_title; } - const QString& performer() const { return m_performer; } - const QString& songwriter() const { return m_songwriter; } - const QString& composer() const { return m_composer; } - const QString& arranger() const { return m_arranger; } - const QString& message() const { return m_message; } - const QString& discId() const { return m_discId; } - const QString& upcEan() const { return m_upcEan; } + const TQString& title() const { return m_title; } + const TQString& performer() const { return m_performer; } + const TQString& songwriter() const { return m_songwriter; } + const TQString& composer() const { return m_composer; } + const TQString& arranger() const { return m_arranger; } + const TQString& message() const { return m_message; } + const TQString& discId() const { return m_discId; } + const TQString& upcEan() const { return m_upcEan; } // TODO: use the real CD-TEXT charset (a modified ISO8859-1) - void setTitle( const QString& s ) { m_title = s; fixup(m_title); } - void setPerformer( const QString& s ) { m_performer = s; fixup(m_performer); } - void setSongwriter( const QString& s ) { m_songwriter = s; fixup(m_songwriter); } - void setComposer( const QString& s ) { m_composer = s; fixup(m_composer); } - void setArranger( const QString& s ) { m_arranger = s; fixup(m_arranger); } - void setMessage( const QString& s ) { m_message = s; fixup(m_message); } - void setDiscId( const QString& s ) { m_discId = s; fixup(m_discId); } - void setUpcEan( const QString& s ) { m_upcEan = s; fixup(m_upcEan); } + void setTitle( const TQString& s ) { m_title = s; fixup(m_title); } + void setPerformer( const TQString& s ) { m_performer = s; fixup(m_performer); } + void setSongwriter( const TQString& s ) { m_songwriter = s; fixup(m_songwriter); } + void setComposer( const TQString& s ) { m_composer = s; fixup(m_composer); } + void setArranger( const TQString& s ) { m_arranger = s; fixup(m_arranger); } + void setMessage( const TQString& s ) { m_message = s; fixup(m_message); } + void setDiscId( const TQString& s ) { m_discId = s; fixup(m_discId); } + void setUpcEan( const TQString& s ) { m_upcEan = s; fixup(m_upcEan); } void debug() const; @@ -170,32 +170,32 @@ namespace K3bDevice * wrong length. */ static bool checkCrc( const unsigned char*, int ); - static bool checkCrc( const QByteArray& ); + static bool checkCrc( const TQByteArray& ); bool operator==( const CdText& ) const; bool operator!=( const CdText& ) const; private: // TODO: remove this (see above) - void fixup( QString& s ) { s.replace( '/', "_" ); s.replace( '\"', "_" ); } + void fixup( TQString& s ) { s.tqreplace( '/', "_" ); s.tqreplace( '\"', "_" ); } - const QString& textForPackType( int packType, unsigned int track ) const; + const TQString& textForPackType( int packType, unsigned int track ) const; unsigned int textLengthForPackType( int packType ) const; - QByteArray createPackData( int packType, unsigned int& ) const; - void savePack( cdtext_pack* pack, QByteArray& data, unsigned int& dataFill ) const; - void appendByteArray( QByteArray& a, const QByteArray& b ) const; - - QString m_title; - QString m_performer; - QString m_songwriter; - QString m_composer; - QString m_arranger; - QString m_message; - QString m_discId; - QString m_upcEan; + TQByteArray createPackData( int packType, unsigned int& ) const; + void savePack( cdtext_pack* pack, TQByteArray& data, unsigned int& dataFill ) const; + void appendByteArray( TQByteArray& a, const TQByteArray& b ) const; + + TQString m_title; + TQString m_performer; + TQString m_songwriter; + TQString m_composer; + TQString m_arranger; + TQString m_message; + TQString m_discId; + TQString m_upcEan; }; - QCString encodeCdText( const QString& s, bool* illegalChars = 0 ); + TQCString encodeCdText( const TQString& s, bool* illegalChars = 0 ); } #endif diff --git a/libk3bdevice/k3bcrc.cpp b/libk3bdevice/k3bcrc.cpp index f533ae7..e382f9b 100644 --- a/libk3bdevice/k3bcrc.cpp +++ b/libk3bdevice/k3bcrc.cpp @@ -18,7 +18,7 @@ #include -static Q_UINT16 g_x25Table[1<<8] = { +static TQ_UINT16 g_x25Table[1<<8] = { 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7, 0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef, 0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6, @@ -54,7 +54,7 @@ static Q_UINT16 g_x25Table[1<<8] = { }; -Q_UINT16 K3bDevice::calcX25( unsigned char* message, unsigned int len, Q_UINT16 crc ) +TQ_UINT16 K3bDevice::calcX25( unsigned char* message, unsigned int len, TQ_UINT16 crc ) { while( len-- ) { crc = (crc<<8) ^ g_x25Table[(crc>>8) ^ (*message++)]; @@ -64,13 +64,13 @@ Q_UINT16 K3bDevice::calcX25( unsigned char* message, unsigned int len, Q_UINT16 } -bool K3bDevice::checkQCrc( unsigned char* subdata ) +bool K3bDevice::checkTQCrc( unsigned char* subdata ) { // Red Book for some reason inverts the CRC bytes subdata[10] ^= 0xff; subdata[11] ^= 0xff; - Q_UINT16 crc = calcX25( subdata, 12 ); + TQ_UINT16 crc = calcX25( subdata, 12 ); // correct the data subdata[10] ^= 0xff; diff --git a/libk3bdevice/k3bcrc.h b/libk3bdevice/k3bcrc.h index ee7d6a6..a352db3 100644 --- a/libk3bdevice/k3bcrc.h +++ b/libk3bdevice/k3bcrc.h @@ -16,7 +16,7 @@ #ifndef _K3B_CRC_H_ #define _K3B_CRC_H_ -#include +#include namespace K3bDevice { @@ -24,12 +24,12 @@ namespace K3bDevice // bool check( unsigned char* message, unsigned int len, unsigned char* crc, unsigned int crcLen ); - Q_UINT16 calcX25( unsigned char* message, unsigned int len, Q_UINT16 start = 0x0000 ); + TQ_UINT16 calcX25( unsigned char* message, unsigned int len, TQ_UINT16 start = 0x0000 ); /** * subdata is 12 bytes in long. */ - bool checkQCrc( unsigned char* subdata ); + bool checkTQCrc( unsigned char* subdata ); }; #endif diff --git a/libk3bdevice/k3bdebug.cpp b/libk3bdevice/k3bdebug.cpp index 40774aa..56dc1a0 100644 --- a/libk3bdevice/k3bdebug.cpp +++ b/libk3bdevice/k3bdebug.cpp @@ -84,14 +84,14 @@ K3bDebug& K3bDebug::operator<<( double d ) } -K3bDebug& K3bDebug::operator<<( const QString& s ) +K3bDebug& K3bDebug::operator<<( const TQString& s ) { fprintf( stderr, "%s", s.utf8().data() ); return *this; } -K3bDebug& K3bDebug::operator<<( const QCString& s ) +K3bDebug& K3bDebug::operator<<( const TQCString& s ) { fprintf( stderr, "%s", s.data() ); return *this; diff --git a/libk3bdevice/k3bdebug.h b/libk3bdevice/k3bdebug.h index 8bdd374..a1500ff 100644 --- a/libk3bdevice/k3bdebug.h +++ b/libk3bdevice/k3bdebug.h @@ -17,7 +17,7 @@ #ifndef _K3B_DEBUG_H_ #define _K3B_DEBUG_H_ -#include +#include #include #include @@ -44,8 +44,8 @@ class LIBK3BDEVICE_EXPORT K3bDebug K3bDebug& operator<<( char ); K3bDebug& operator<<( float ); K3bDebug& operator<<( double ); - K3bDebug& operator<<( const QString& ); - K3bDebug& operator<<( const QCString& ); + K3bDebug& operator<<( const TQString& ); + K3bDebug& operator<<( const TQCString& ); K3bDebug& operator<<( const char* ); K3bDebug& operator<<( const K3b::Msf& ); diff --git a/libk3bdevice/k3bdevice.cpp b/libk3bdevice/k3bdevice.cpp index 45ba7bf..29e7dbe 100644 --- a/libk3bdevice/k3bdevice.cpp +++ b/libk3bdevice/k3bdevice.cpp @@ -25,11 +25,11 @@ #include "k3bscsicommand.h" #include "k3bcrc.h" -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include @@ -162,7 +162,7 @@ public: int readCapabilities; int writeCapabilities; int supportedProfiles; - QStringList allNodes; + TQStringList allNodes; #ifdef Q_OS_LINUX int deviceFd; #endif @@ -175,12 +175,12 @@ public: bool openedReadWrite; bool burnfree; - QMutex mutex; - QMutex openCloseMutex; + TQMutex mutex; + TQMutex openCloseMutex; }; -K3bDevice::Device::Device( const QString& devname ) +K3bDevice::Device::Device( const TQString& devname ) : m_bus(-1), m_target(-1), m_lun(-1), @@ -231,7 +231,7 @@ bool K3bDevice::Device::init( bool bCheckWritingModes ) cmd.clear(); ::memset( buf, 0, sizeof(buf) ); struct inquiry* inq = (struct inquiry*)buf; - cmd[0] = MMC_INQUIRY; + cmd[0] = MMC_INTQUIRY; cmd[4] = sizeof(buf); cmd[5] = 0; if( cmd.transport( TR_DIR_READ, buf, sizeof(buf) ) ) { @@ -240,9 +240,9 @@ bool K3bDevice::Device::init( bool bCheckWritingModes ) return false; } else { - m_vendor = QString::fromLatin1( (char*)(inq->vendor), 8 ).stripWhiteSpace(); - m_description = QString::fromLatin1( (char*)(inq->product), 16 ).stripWhiteSpace(); - m_version = QString::fromLatin1( (char*)(inq->revision), 4 ).stripWhiteSpace(); + m_vendor = TQString::tqfromLatin1( (char*)(inq->vendor), 8 ).stripWhiteSpace(); + m_description = TQString::tqfromLatin1( (char*)(inq->product), 16 ).stripWhiteSpace(); + m_version = TQString::tqfromLatin1( (char*)(inq->revision), 4 ).stripWhiteSpace(); } if( m_vendor.isEmpty() ) @@ -555,15 +555,15 @@ int K3bDevice::Device::writeCapabilities() const } -const QString& K3bDevice::Device::devicename() const +const TQString& K3bDevice::Device::devicename() const { return blockDeviceName(); } -QString K3bDevice::Device::busTargetLun() const +TQString K3bDevice::Device::busTargetLun() const { - return QString("%1,%2,%3").arg(m_bus).arg(m_target).arg(m_lun); + return TQString("%1,%2,%3").tqarg(m_bus).tqarg(m_target).tqarg(m_lun); } @@ -843,7 +843,7 @@ K3bDevice::Toc K3bDevice::Device::readToc() const void K3bDevice::Device::readIsrcMcn( K3bDevice::Toc& toc ) const { // read MCN and ISRC of all tracks - QCString mcn; + TQCString mcn; if( readMcn( mcn ) ) { toc.setMcn( mcn ); k3bDebug() << "(K3bDevice::Device) found MCN: " << mcn << endl; @@ -852,7 +852,7 @@ void K3bDevice::Device::readIsrcMcn( K3bDevice::Toc& toc ) const k3bDebug() << "(K3bDevice::Device) no MCN found." << endl; for( unsigned int i = 1; i <= toc.count(); ++i ) { - QCString isrc; + TQCString isrc; if( toc[i-1].type() == Track::AUDIO ) { if( readIsrc( i, isrc ) ) { k3bDebug() << "(K3bDevice::Device) found ISRC for track " << i << ": " << isrc << endl; @@ -1055,19 +1055,19 @@ bool K3bDevice::Device::readRawToc( K3bDevice::Toc& toc ) const // k3bDebug() << "Session | ADR | CONTROL| TNO | POINT | Min | Sec | Frame | Zero | PMIN | PSEC | PFRAME |" << endl; for( unsigned int i = 0; i < (dataLen-4)/(int)sizeof(toc_raw_track_descriptor); ++i ) { - QString s; - s += QString( " %1 |" ).arg( (int)tr[i].session_number, 6 ); - s += QString( " %1 |" ).arg( (int)tr[i].adr, 6 ); - s += QString( " %1 |" ).arg( (int)tr[i].control, 6 ); - s += QString( " %1 |" ).arg( (int)tr[i].tno, 6 ); - s += QString( " %1 |" ).arg( (int)tr[i].point, 6, 16 ); - s += QString( " %1 |" ).arg( (int)tr[i].min, 6 ); - s += QString( " %1 |" ).arg( (int)tr[i].sec, 6 ); - s += QString( " %1 |" ).arg( (int)tr[i].frame, 6 ); - s += QString( " %1 |" ).arg( (int)tr[i].zero, 6, 16 ); - s += QString( " %1 |" ).arg( (int)tr[i].p_min, 6 ); - s += QString( " %1 |" ).arg( (int)tr[i].p_sec, 6 ); - s += QString( " %1 |" ).arg( (int)tr[i].p_frame, 6 ); + TQString s; + s += TQString( " %1 |" ).tqarg( (int)tr[i].session_number, 6 ); + s += TQString( " %1 |" ).tqarg( (int)tr[i].adr, 6 ); + s += TQString( " %1 |" ).tqarg( (int)tr[i].control, 6 ); + s += TQString( " %1 |" ).tqarg( (int)tr[i].tno, 6 ); + s += TQString( " %1 |" ).tqarg( (int)tr[i].point, 6, 16 ); + s += TQString( " %1 |" ).tqarg( (int)tr[i].min, 6 ); + s += TQString( " %1 |" ).tqarg( (int)tr[i].sec, 6 ); + s += TQString( " %1 |" ).tqarg( (int)tr[i].frame, 6 ); + s += TQString( " %1 |" ).tqarg( (int)tr[i].zero, 6, 16 ); + s += TQString( " %1 |" ).tqarg( (int)tr[i].p_min, 6 ); + s += TQString( " %1 |" ).tqarg( (int)tr[i].p_sec, 6 ); + s += TQString( " %1 |" ).tqarg( (int)tr[i].p_frame, 6 ); k3bDebug() << s << endl; } @@ -1649,14 +1649,14 @@ bool K3bDevice::Device::setAutoEjectEnabled( bool enabled ) const } -void K3bDevice::Device::addDeviceNode( const QString& n ) +void K3bDevice::Device::addDeviceNode( const TQString& n ) { - if( !d->allNodes.contains( n ) ) + if( !d->allNodes.tqcontains( n ) ) d->allNodes.append( n ); } -const QStringList& K3bDevice::Device::deviceNodes() const +const TQStringList& K3bDevice::Device::deviceNodes() const { return d->allNodes; } @@ -1677,7 +1677,7 @@ bool K3bDevice::Device::open( bool write ) const if( d->openedReadWrite != write ) close(); - QMutexLocker ml( &d->openCloseMutex ); + TQMutexLocker ml( &d->openCloseMutex ); d->openedReadWrite = write; @@ -1692,7 +1692,7 @@ bool K3bDevice::Device::open( bool write ) const #endif #if defined(Q_OS_LINUX) || defined(Q_OS_NETBSD) if( d->deviceFd == -1 ) - d->deviceFd = openDevice( QFile::encodeName(devicename()), write ); + d->deviceFd = openDevice( TQFile::encodeName(devicename()), write ); return ( d->deviceFd != -1 ); #endif @@ -1701,7 +1701,7 @@ bool K3bDevice::Device::open( bool write ) const void K3bDevice::Device::close() const { - QMutexLocker ml( &d->openCloseMutex ); + TQMutexLocker ml( &d->openCloseMutex ); #ifdef Q_OS_FREEBSD if( d->cam ) { @@ -1967,24 +1967,24 @@ K3bDevice::DiskInfo K3bDevice::Device::diskInfo() const ea0 = ( data[4+13]<<16 | data[4+14] << 8 | data[4+15] ); k3bDebug() << "First sec data area: " << sda.toString() - << " (LBA " << QString::number(sda.lba()) - << ") (" << QString::number(sda.mode1Bytes()) << endl; + << " (LBA " << TQString::number(sda.lba()) + << ") (" << TQString::number(sda.mode1Bytes()) << endl; k3bDebug() << "Last sec data area: " << eda.toString() - << " (LBA " << QString::number(eda.lba()) - << ") (" << QString::number(eda.mode1Bytes()) << " Bytes)" << endl; + << " (LBA " << TQString::number(eda.lba()) + << ") (" << TQString::number(eda.mode1Bytes()) << " Bytes)" << endl; k3bDebug() << "Last sec layer 1: " << ea0.toString() - << " (LBA " << QString::number(ea0.lba()) - << ") (" << QString::number(ea0.mode1Bytes()) << " Bytes)" << endl; + << " (LBA " << TQString::number(ea0.lba()) + << ") (" << TQString::number(ea0.mode1Bytes()) << " Bytes)" << endl; K3b::Msf da0 = ea0 - sda + 1; K3b::Msf da1 = eda - ea0; k3bDebug() << "Layer 1 length: " << da0.toString() - << " (LBA " << QString::number(da0.lba()) - << ") (" << QString::number(da0.mode1Bytes()) << " Bytes)" << endl; + << " (LBA " << TQString::number(da0.lba()) + << ") (" << TQString::number(da0.mode1Bytes()) << " Bytes)" << endl; k3bDebug() << "Layer 2 length: " << da1.toString() - << " (LBA " << QString::number(da1.lba()) - << ") (" << QString::number(da1.mode1Bytes()) << " Bytes)" << endl; + << " (LBA " << TQString::number(da1.lba()) + << ") (" << TQString::number(da1.mode1Bytes()) << " Bytes)" << endl; inf.m_numLayers = ((data[6]&0x60) == 0 ? 1 : 2); @@ -2294,7 +2294,7 @@ int K3bDevice::Device::mediaType() const case 0xA0: m = MEDIA_DVD_PLUS_R; break; case 0xE0: m = MEDIA_DVD_PLUS_R_DL; break; default: - k3bDebug() << "(K3bDevice::Device) unknown dvd media type: " << QString::number(data[4]&0xF0, 8) << endl; + k3bDebug() << "(K3bDevice::Device) unknown dvd media type: " << TQString::number(data[4]&0xF0, 8) << endl; break; // unknown } @@ -3089,10 +3089,10 @@ int K3bDevice::Device::determineMaximalWriteSpeed() const } } - QValueList list = determineSupportedWriteSpeeds(); + TQValueList list = determineSupportedWriteSpeeds(); if( !list.isEmpty() ) { - for( QValueList::const_iterator it = list.constBegin(); it != list.constEnd(); ++it ) - ret = QMAX( ret, *it ); + for( TQValueList::const_iterator it = list.constBegin(); it != list.constEnd(); ++it ) + ret = TQMAX( ret, *it ); } if( ret > 0 ) @@ -3102,9 +3102,9 @@ int K3bDevice::Device::determineMaximalWriteSpeed() const } -QValueList K3bDevice::Device::determineSupportedWriteSpeeds() const +TQValueList K3bDevice::Device::determineSupportedWriteSpeeds() const { - QValueList ret; + TQValueList ret; if( burner() ) { // @@ -3148,7 +3148,7 @@ QValueList K3bDevice::Device::determineSupportedWriteSpeeds() const } -bool K3bDevice::Device::getSupportedWriteSpeedsVia2A( QValueList& list, bool dvd ) const +bool K3bDevice::Device::getSupportedWriteSpeedsVia2A( TQValueList& list, bool dvd ) const { unsigned char* data = 0; unsigned int dataLen = 0; @@ -3194,7 +3194,7 @@ bool K3bDevice::Device::getSupportedWriteSpeedsVia2A( QValueList& list, boo s = fixupDvdWritingSpeed( s ); // sort the list - QValueList::iterator it = list.begin(); + TQValueList::iterator it = list.begin(); while( it != list.end() && *it < s ) ++it; list.insert( it, s ); @@ -3209,7 +3209,7 @@ bool K3bDevice::Device::getSupportedWriteSpeedsVia2A( QValueList& list, boo } -bool K3bDevice::Device::getSupportedWriteSpeedsViaGP( QValueList& list, bool dvd ) const +bool K3bDevice::Device::getSupportedWriteSpeedsViaGP( TQValueList& list, bool dvd ) const { unsigned char* data = 0; unsigned int dataLen = 0; @@ -3243,7 +3243,7 @@ bool K3bDevice::Device::getSupportedWriteSpeedsViaGP( QValueList& list, boo if( dvd ) s = fixupDvdWritingSpeed( s ); - QValueList::iterator it = list.begin(); + TQValueList::iterator it = list.begin(); while( it != list.end() && *it < s ) ++it; // the speed might already have been found in the 2a modepage @@ -3578,9 +3578,9 @@ int K3bDevice::Device::nextWritableAddress() const } -QCString K3bDevice::Device::mediaId( int mediaType ) const +TQCString K3bDevice::Device::mediaId( int mediaType ) const { - QCString id; + TQCString id; if( mediaType & MEDIA_CD_ALL ) { // FIXME: diff --git a/libk3bdevice/k3bdevice.h b/libk3bdevice/k3bdevice.h index 1dcd863..9f564ee 100644 --- a/libk3bdevice/k3bdevice.h +++ b/libk3bdevice/k3bdevice.h @@ -17,9 +17,9 @@ #ifndef K3BDEVICE_H #define K3BDEVICE_H -#include -#include -#include +#include +#include +#include #include #include @@ -95,17 +95,17 @@ namespace K3bDevice /** * \return Vendor string as reported by the device's firmware. */ - const QString& vendor() const { return m_vendor; } + const TQString& vendor() const { return m_vendor; } /** * \return Description string as reported by the device's firmware. */ - const QString& description() const { return m_description; } + const TQString& description() const { return m_description; } /** * \return Version string as reported by the device's firmware. */ - const QString& version() const { return m_version; } + const TQString& version() const { return m_version; } /** * Shortcut for \code writesCd() || writesDvd() \endcode @@ -207,13 +207,13 @@ namespace K3bDevice /** * @return the corresponding device name. */ - const QString& devicename() const; + const TQString& devicename() const; /** * for SCSI devices this should be something like /dev/scd0 or /dev/sr0 * for IDE device this should be something like /dev/hdb1 */ - const QString& blockDeviceName() const { return m_blockDevice; } + const TQString& blockDeviceName() const { return m_blockDevice; } /** * This is only valid for SCSI devices. Without devfs it's something @@ -222,24 +222,24 @@ namespace K3bDevice * This is not needed in K3b at all. But cdrecord and cdrdao use the sg devices and * we need it to fixup it's permissions in K3bSetup. */ - const QString& genericDevice() const { return m_genericDevice; } + const TQString& genericDevice() const { return m_genericDevice; } /** * \return All device nodes for this drive. */ - const QStringList& deviceNodes() const; + const TQStringList& deviceNodes() const; /** * \see K3bDevice::Device::deviceNodes() */ - void addDeviceNode( const QString& ); + void addDeviceNode( const TQString& ); /** * Makes only sense to use with scsi devices * @return a string for use with the cdrtools * @deprecated */ - QString busTargetLun() const; + TQString busTargetLun() const; int scsiBus() const { return m_bus; } int scsiId() const { return m_target; } @@ -250,7 +250,7 @@ namespace K3bDevice /** * \deprecated the cdrdao driver has no place in this library. It will be removed. */ - const QString& cdrdaoDriver() const { return m_cdrdaoDriver; } + const TQString& cdrdaoDriver() const { return m_cdrdaoDriver; } /** * returns: 0 auto (no cdrdao-driver selected) @@ -281,7 +281,7 @@ namespace K3bDevice * Use this if cdrdao is not able to autodetect the nessessary driver. * \deprecated the cdrdao driver has no place in this library. It will be removed. */ - void setCdrdaoDriver( const QString& d ) { m_cdrdaoDriver = d; } + void setCdrdaoDriver( const TQString& d ) { m_cdrdaoDriver = d; } /** * Only used if the cdrdao-driver is NOT set to "auto". @@ -443,7 +443,7 @@ namespace K3bDevice * * This only works with MMC3 compliant drives. */ - QValueList determineSupportedWriteSpeeds() const; + TQValueList determineSupportedWriteSpeeds() const; /** * @returnes the speed in kb/s or 0 on failure. @@ -558,7 +558,7 @@ namespace K3bDevice * if true is returned dataLen specifies the actual length of *data which needs to be * deleted after using. */ - bool mechanismStatus( unsigned char** data, unsigned int& dataLen ) const; + bool mechanismtqStatus( unsigned char** data, unsigned int& dataLen ) const; /** * Read a single feature. @@ -669,9 +669,9 @@ namespace K3bDevice unsigned int subchannelParam, unsigned int trackNumber ) const; - bool readIsrc( unsigned int track, QCString& isrc ) const; + bool readIsrc( unsigned int track, TQCString& isrc ) const; - bool readMcn( QCString& mcn ) const; + bool readMcn( TQCString& mcn ) const; /** * MMC command Read Buffer Capacity @@ -761,7 +761,7 @@ namespace K3bDevice /** * A Device can only be constructed the the DeviceManager. */ - Device( const QString& devname ); + Device( const TQString& devname ); /** * Determines the device's capabilities. This needs to be called once before @@ -787,15 +787,15 @@ namespace K3bDevice */ int rawTocDataWithBcdValues( unsigned char* data, unsigned int dataLen ) const; - bool getSupportedWriteSpeedsVia2A( QValueList& list, bool dvd ) const; - bool getSupportedWriteSpeedsViaGP( QValueList& list, bool dvd ) const; + bool getSupportedWriteSpeedsVia2A( TQValueList& list, bool dvd ) const; + bool getSupportedWriteSpeedsViaGP( TQValueList& list, bool dvd ) const; - QCString mediaId( int mediaType ) const; + TQCString mediaId( int mediaType ) const; - QString m_vendor; - QString m_description; - QString m_version; - QString m_cdrdaoDriver; + TQString m_vendor; + TQString m_description; + TQString m_version; + TQString m_cdrdaoDriver; int m_cdTextCapable; int m_maxReadSpeed; int m_maxWriteSpeed; @@ -813,9 +813,9 @@ namespace K3bDevice int m_writeModes; // only needed on FreeBSD - QString m_passDevice; - QString m_blockDevice; - QString m_genericDevice; + TQString m_passDevice; + TQString m_blockDevice; + TQString m_genericDevice; class Private; Private* d; diff --git a/libk3bdevice/k3bdevice_mmc.cpp b/libk3bdevice/k3bdevice_mmc.cpp index 77db530..f4258ae 100644 --- a/libk3bdevice/k3bdevice_mmc.cpp +++ b/libk3bdevice/k3bdevice_mmc.cpp @@ -74,7 +74,7 @@ bool K3bDevice::Device::getFeature( unsigned char** data, unsigned int& dataLen, cmd[7] = dataLen>>8; cmd[8] = dataLen; if( cmd.transport( TR_DIR_READ, *data, dataLen ) == 0 ) { - dataLen = QMIN( dataLen, from4Byte( *data ) + 4 ); + dataLen = TQMIN( dataLen, from4Byte( *data ) + 4 ); return true; } else { @@ -105,7 +105,7 @@ int K3bDevice::Device::featureCurrent( unsigned int feature ) const } -bool K3bDevice::Device::readIsrc( unsigned int track, QCString& isrc ) const +bool K3bDevice::Device::readIsrc( unsigned int track, TQCString& isrc ) const { unsigned char* data = 0; unsigned int dataLen = 0; @@ -117,7 +117,7 @@ bool K3bDevice::Device::readIsrc( unsigned int track, QCString& isrc ) const isrcValid = (data[8+4]>>7 & 0x1); if( isrcValid ) { - isrc = QCString( reinterpret_cast(data[8+5]), 13 ); + isrc = TQCString( reinterpret_cast(data[8+5]), 13 ); // TODO: check the range of the chars @@ -133,7 +133,7 @@ bool K3bDevice::Device::readIsrc( unsigned int track, QCString& isrc ) const } -bool K3bDevice::Device::readMcn( QCString& mcn ) const +bool K3bDevice::Device::readMcn( TQCString& mcn ) const { unsigned char* data = 0; unsigned int dataLen = 0; @@ -145,7 +145,7 @@ bool K3bDevice::Device::readMcn( QCString& mcn ) const mcnValid = (data[8+4]>>7 & 0x1); if( mcnValid ) - mcn = QCString( reinterpret_cast(data[8+5]), 14 ); + mcn = TQCString( reinterpret_cast(data[8+5]), 14 ); } delete [] data; @@ -227,7 +227,7 @@ bool K3bDevice::Device::getPerformance( unsigned char** data, unsigned int& data if( cmd.transport( TR_DIR_READ, *data, dataLen ) == 0 ) { k3bDebug() << "(K3bDevice::Device) " << blockDeviceName() << ": GET PERFORMANCE successful with reported length: " << from4Byte( *data ) << endl; - dataLen = QMIN( dataLen, from4Byte( *data ) + 4 ); + dataLen = TQMIN( dataLen, from4Byte( *data ) + 4 ); return true; } else { @@ -326,7 +326,7 @@ bool K3bDevice::Device::readTrackInformation( unsigned char** data, unsigned int cmd[7] = dataLen>>8; cmd[8] = dataLen; if( cmd.transport( TR_DIR_READ, *data, dataLen ) == 0 ) { - dataLen = QMIN( dataLen, from2Byte( *data ) + 2u ); + dataLen = TQMIN( dataLen, from2Byte( *data ) + 2u ); return true; } else { @@ -526,7 +526,7 @@ bool K3bDevice::Device::readSubChannel( unsigned char** data, unsigned int& data cmd[7] = dataLen>>8; cmd[8] = dataLen; if( cmd.transport( TR_DIR_READ, *data, dataLen ) == 0 ) { - dataLen = QMIN( dataLen, from2Byte( (*data)+2 ) + 4u ); + dataLen = TQMIN( dataLen, from2Byte( (*data)+2 ) + 4u ); return true; } else { @@ -606,7 +606,7 @@ bool K3bDevice::Device::readTocPmaAtip( unsigned char** data, unsigned int& data cmd[7] = dataLen>>8; cmd[8] = dataLen; if( cmd.transport( TR_DIR_READ, *data, dataLen ) == 0 ) { - dataLen = QMIN( dataLen, from2Byte( *data ) + 2u ); + dataLen = TQMIN( dataLen, from2Byte( *data ) + 2u ); if( (dataLen-4) % descLen || dataLen < 4+descLen ) { // useless length delete [] *data; @@ -626,7 +626,7 @@ bool K3bDevice::Device::readTocPmaAtip( unsigned char** data, unsigned int& data } -bool K3bDevice::Device::mechanismStatus( unsigned char** data, unsigned int& dataLen ) const +bool K3bDevice::Device::mechanismtqStatus( unsigned char** data, unsigned int& dataLen ) const { unsigned char header[2048]; ::memset( header, 0, 2048 ); @@ -663,7 +663,7 @@ bool K3bDevice::Device::mechanismStatus( unsigned char** data, unsigned int& dat cmd[8] = dataLen>>8; cmd[9] = dataLen; if( cmd.transport( TR_DIR_READ, *data, dataLen ) == 0 ) { - dataLen = QMIN( dataLen, from4Byte( (*data)+6 ) + 8 ); + dataLen = TQMIN( dataLen, from4Byte( (*data)+6 ) + 8 ); return true; } else { @@ -712,7 +712,7 @@ bool K3bDevice::Device::modeSense( unsigned char** pageData, unsigned int& pageL cmd[7] = pageLen>>8; cmd[8] = pageLen; if( cmd.transport( TR_DIR_READ, *pageData, pageLen ) == 0 ) { - pageLen = QMIN( pageLen, from2Byte( *pageData ) + 2u ); + pageLen = TQMIN( pageLen, from2Byte( *pageData ) + 2u ); return true; } else { @@ -811,7 +811,7 @@ bool K3bDevice::Device::readFormatCapacity( int wantedFormat, K3b::Msf& r, if( format == wantedFormat ) { // found the descriptor - r = QMAX( (int)from4Byte( &buffer[i] ), r.lba() ); + r = TQMAX( (int)from4Byte( &buffer[i] ), r.lba() ); success = true; } } @@ -849,7 +849,7 @@ bool K3bDevice::Device::readDiscInformation( unsigned char** data, unsigned int& cmd[7] = dataLen>>8; cmd[8] = dataLen; if( cmd.transport( TR_DIR_READ, *data, dataLen ) == 0 ) { - dataLen = QMIN( dataLen, from2Byte( *data ) + 2u ); + dataLen = TQMIN( dataLen, from2Byte( *data ) + 2u ); return true; } else { @@ -905,7 +905,7 @@ bool K3bDevice::Device::readDiscStructure( unsigned char** data, unsigned int& d cmd[8] = dataLen>>8; cmd[9] = dataLen; if( cmd.transport( TR_DIR_READ, *data, dataLen ) == 0 ) { - dataLen = QMIN( dataLen, from2Byte( *data ) + 2u ); + dataLen = TQMIN( dataLen, from2Byte( *data ) + 2u ); return true; } else { diff --git a/libk3bdevice/k3bdeviceglobals.cpp b/libk3bdevice/k3bdeviceglobals.cpp index c778130..4d36916 100644 --- a/libk3bdevice/k3bdeviceglobals.cpp +++ b/libk3bdevice/k3bdeviceglobals.cpp @@ -20,12 +20,12 @@ #include #include -#include +#include -QString K3bDevice::deviceTypeString( int t ) +TQString K3bDevice::deviceTypeString( int t ) { - QStringList s; + TQStringList s; if( t & K3bDevice::DEVICE_CD_R ) s += i18n("CD-R"); if( t & K3bDevice::DEVICE_CD_RW ) @@ -68,9 +68,9 @@ QString K3bDevice::deviceTypeString( int t ) } -QString K3bDevice::writingModeString( int m ) +TQString K3bDevice::writingModeString( int m ) { - QStringList s; + TQStringList s; if( m & K3bDevice::WRITINGMODE_SAO ) s += i18n("SAO"); if( m & K3bDevice::WRITINGMODE_TAO ) @@ -108,12 +108,12 @@ QString K3bDevice::writingModeString( int m ) } -QString K3bDevice::mediaTypeString( int m, bool simple ) +TQString K3bDevice::mediaTypeString( int m, bool simple ) { if( m == K3bDevice::MEDIA_UNKNOWN ) return i18n("Unknown"); - QStringList s; + TQStringList s; if( m & MEDIA_NONE ) s += i18n("No media"); if( m & MEDIA_DVD_ROM ) @@ -183,7 +183,7 @@ QString K3bDevice::mediaTypeString( int m, bool simple ) void K3bDevice::debugBitfield( unsigned char* data, long len ) { for( int i = 0; i < len; ++i ) { - QString index, bitString; + TQString index, bitString; index.sprintf( "%4i", i ); for( int bp = 7; bp >= 0; --bp ) bitString[7-bp] = ( data[i] & (1< +#include #include #include "k3bdevice_export.h" namespace K3bDevice { - typedef Q_UINT8 uint8; - typedef Q_UINT16 uint16; - typedef Q_UINT32 uint32; + typedef TQ_UINT8 uint8; + typedef TQ_UINT16 uint16; + typedef TQ_UINT32 uint32; class Device; - LIBK3BDEVICE_EXPORT QString deviceTypeString( int ); - LIBK3BDEVICE_EXPORT QString writingModeString( int ); + LIBK3BDEVICE_EXPORT TQString deviceTypeString( int ); + LIBK3BDEVICE_EXPORT TQString writingModeString( int ); /** * @param simplyfied if true the formatting state of DVD media is left out. */ - LIBK3BDEVICE_EXPORT QString mediaTypeString( int, bool simplyfied = false ); + LIBK3BDEVICE_EXPORT TQString mediaTypeString( int, bool simplyfied = false ); LIBK3BDEVICE_EXPORT void debugBitfield( unsigned char* data, long len ); LIBK3BDEVICE_EXPORT uint16 from2Byte( unsigned char* ); diff --git a/libk3bdevice/k3bdevicemanager.cpp b/libk3bdevice/k3bdevicemanager.cpp index b7c04d0..fcf5bfc 100644 --- a/libk3bdevice/k3bdevicemanager.cpp +++ b/libk3bdevice/k3bdevicemanager.cpp @@ -22,12 +22,12 @@ #include "k3bmmc.h" #include "k3bdebug.h" -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include @@ -106,21 +106,21 @@ typedef unsigned char u8; class K3bDevice::DeviceManager::Private { public: - QPtrList allDevices; - QPtrList cdReader; - QPtrList cdWriter; - QPtrList dvdReader; - QPtrList dvdWriter; - QPtrList bdReader; - QPtrList bdWriter; + TQPtrList allDevices; + TQPtrList cdReader; + TQPtrList cdWriter; + TQPtrList dvdReader; + TQPtrList dvdWriter; + TQPtrList bdReader; + TQPtrList bdWriter; bool checkWritingModes; }; -K3bDevice::DeviceManager::DeviceManager( QObject* parent, const char* name ) - : QObject( parent, name ) +K3bDevice::DeviceManager::DeviceManager( TQObject* tqparent, const char* name ) + : TQObject( tqparent, name ) { d = new Private; } @@ -139,7 +139,7 @@ void K3bDevice::DeviceManager::setCheckWritingModes( bool b ) } -K3bDevice::Device* K3bDevice::DeviceManager::deviceByName( const QString& name ) +K3bDevice::Device* K3bDevice::DeviceManager::deviceByName( const TQString& name ) { return findDevice( name ); } @@ -147,7 +147,7 @@ K3bDevice::Device* K3bDevice::DeviceManager::deviceByName( const QString& name ) K3bDevice::Device* K3bDevice::DeviceManager::findDevice( int bus, int id, int lun ) { - QPtrListIterator it( d->allDevices ); + TQPtrListIterator it( d->allDevices ); while( it.current() ) { if( it.current()->scsiBus() == bus && @@ -162,15 +162,15 @@ K3bDevice::Device* K3bDevice::DeviceManager::findDevice( int bus, int id, int lu } -K3bDevice::Device* K3bDevice::DeviceManager::findDevice( const QString& devicename ) +K3bDevice::Device* K3bDevice::DeviceManager::findDevice( const TQString& devicename ) { if( devicename.isEmpty() ) { k3bDebug() << "(K3bDevice::DeviceManager) request for empty device!" << endl; return 0; } - QPtrListIterator it( d->allDevices ); + TQPtrListIterator it( d->allDevices ); while( it.current() ) { - if( it.current()->deviceNodes().contains(devicename) ) + if( it.current()->deviceNodes().tqcontains(devicename) ) return it.current(); ++it; @@ -180,49 +180,49 @@ K3bDevice::Device* K3bDevice::DeviceManager::findDevice( const QString& devicena } -const QPtrList& K3bDevice::DeviceManager::cdWriter() const +const TQPtrList& K3bDevice::DeviceManager::cdWriter() const { return d->cdWriter; } -const QPtrList& K3bDevice::DeviceManager::cdReader() const +const TQPtrList& K3bDevice::DeviceManager::cdReader() const { return d->cdReader; } -const QPtrList& K3bDevice::DeviceManager::dvdWriter() const +const TQPtrList& K3bDevice::DeviceManager::dvdWriter() const { return d->dvdWriter; } -const QPtrList& K3bDevice::DeviceManager::dvdReader() const +const TQPtrList& K3bDevice::DeviceManager::dvdReader() const { return d->dvdReader; } -const QPtrList& K3bDevice::DeviceManager::blueRayReader() const +const TQPtrList& K3bDevice::DeviceManager::blueRayReader() const { return d->bdReader; } -const QPtrList& K3bDevice::DeviceManager::blueRayWriters() const +const TQPtrList& K3bDevice::DeviceManager::blueRayWriters() const { return d->bdWriter; } -const QPtrList& K3bDevice::DeviceManager::burningDevices() const +const TQPtrList& K3bDevice::DeviceManager::burningDevices() const { return cdWriter(); } -const QPtrList& K3bDevice::DeviceManager::readingDevices() const +const TQPtrList& K3bDevice::DeviceManager::readingDevices() const { return cdReader(); } -const QPtrList& K3bDevice::DeviceManager::allDevices() const +const TQPtrList& K3bDevice::DeviceManager::allDevices() const { return d->allDevices; } @@ -263,19 +263,19 @@ void K3bDevice::DeviceManager::LinuxDeviceScan() } #endif - QFile info("/proc/sys/dev/cdrom/info"); - QString line,devstring; + TQFile info("/proc/sys/dev/cdrom/info"); + TQString line,devstring; if( info.open(IO_ReadOnly) ) { info.readLine(line,80); // CD-ROM information, Id: cdrom.c 3.12 2000/10/18 info.readLine(line,80); // - QRegExp re("[\t\n:]+"); + TQRegExp re("[\t\n:]+"); while( info.readLine( line, 80 ) > 0 ) { - if( line.contains("drive name") > 0 ) { + if( line.tqcontains("drive name") > 0 ) { int i = 1; - QString dev; + TQString dev; while( !(dev = line.section(re, i, i)).isEmpty() ) { - if( addDevice( QString("/dev/%1").arg(dev) ) ) { + if( addDevice( TQString("/dev/%1").tqarg(dev) ) ) { devstring += dev + "|"; } // according to the LINUX ALLOCATED DEVICES document (http://www.lanana.org/docs/device-list/), @@ -285,7 +285,7 @@ void K3bDevice::DeviceManager::LinuxDeviceScan() // each physical device the next line should be better // else if ( dev.startsWith("sr") ) if ( dev.startsWith("sr") ) { - if( addDevice(QString("/dev/%1").arg(dev.replace(QRegExp("r"),"cd"))) ) + if( addDevice(TQString("/dev/%1").tqarg(dev.tqreplace(TQRegExp("r"),"cd"))) ) devstring += dev + "|"; } ++i; @@ -304,7 +304,7 @@ void K3bDevice::DeviceManager::LinuxDeviceScan() // k3bDebug() << "(K3bDevice::DeviceManager) SCANNING FOR GENERIC DEVICES." << endl; for( int i = 0; i < 16; i++ ) { - QString sgDev = resolveSymLink( QString("/dev/sg%1").arg(i) ); + TQString sgDev = resolveSymLink( TQString("/dev/sg%1").tqarg(i) ); int bus = -1, id = -1, lun = -1; if( determineBusIdLun( sgDev, bus, id, lun ) ) { if( Device* dev = findDevice( bus, id, lun ) ) { @@ -324,7 +324,7 @@ void K3bDevice::DeviceManager::NetBSDDeviceScan() int i; - // Whole disk mask (According to cd(4), the AMD64, i386 and BeBox ports use + // Whole disk tqmask (According to cd(4), the AMD64, i386 and BeBox ports use // 'd' as whole-disk partition, the rest uses 'c'.) #if defined(__i386__) || defined (__amd64__) || defined (__bebox__) @@ -338,7 +338,7 @@ void K3bDevice::DeviceManager::NetBSDDeviceScan() for (i = 0; i < 10; i++ ) // cd(4) claims there are max. 10 CD devices. { snprintf(devicename,11,"/dev/rcd%d%c",i, slicename); - addDevice(QString(devicename)); + addDevice(TQString(devicename)); } } @@ -357,7 +357,7 @@ void K3bDevice::DeviceManager::BSDDeviceScan() int need_close = 0; int skip_device = 0; int bus, target, lun; - QString dev1, dev2; + TQString dev1, dev2; if ((fd = open(XPT_DEVICE, O_RDWR)) == -1) { @@ -380,7 +380,7 @@ void K3bDevice::DeviceManager::BSDDeviceScan() break; } - if ((ccb.ccb_h.status != CAM_REQ_CMP) + if ((ccb.ccb_h.status != CAM_RETQ_CMP) || ((ccb.cdm.status != CAM_DEV_MATCH_LAST) && (ccb.cdm.status != CAM_DEV_MATCH_MORE))) { k3bDebug() << "(BSDDeviceScan) got CAM error " << ccb.ccb_h.status << ", CDM error %d" << ccb.cdm.status << endl; break; @@ -400,8 +400,8 @@ void K3bDevice::DeviceManager::BSDDeviceScan() skip_device = 0; if (need_close) { - QString pass = dev1; - QString dev = "/dev/" + dev2; + TQString pass = dev1; + TQString dev = "/dev/" + dev2; if (dev2.startsWith("pass")) { pass = dev2; @@ -439,9 +439,9 @@ void K3bDevice::DeviceManager::BSDDeviceScan() break; if (need_close > 1) - dev1 = periph_result->periph_name + QString::number(periph_result->unit_number); + dev1 = periph_result->periph_name + TQString::number(periph_result->unit_number); else - dev2 = periph_result->periph_name + QString::number(periph_result->unit_number); + dev2 = periph_result->periph_name + TQString::number(periph_result->unit_number); need_close++; break; @@ -454,13 +454,13 @@ void K3bDevice::DeviceManager::BSDDeviceScan() } } - } while ((ccb.ccb_h.status == CAM_REQ_CMP) + } while ((ccb.ccb_h.status == CAM_RETQ_CMP) && (ccb.cdm.status == CAM_DEV_MATCH_MORE)); if (need_close) { - QString pass = dev1; - QString dev = "/dev/" + dev2; + TQString pass = dev1; + TQString dev = "/dev/" + dev2; if (dev2.startsWith("pass")) { pass = dev2; @@ -489,7 +489,7 @@ void K3bDevice::DeviceManager::printDevices() { k3bDebug() << "Devices:" << endl << "------------------------------" << endl; - QPtrListIterator it( allDevices() ); + TQPtrListIterator it( allDevices() ); for( ; *it; ++it ) { Device* dev = *it; k3bDebug() << "Blockdevice: " << dev->blockDeviceName() << endl @@ -520,7 +520,7 @@ void K3bDevice::DeviceManager::clear() // to make sure no one crashes lets keep the devices around until the changed // signals return - QPtrList tmp = d->allDevices; + TQPtrList tmp = d->allDevices; tmp.setAutoDelete( true ); d->allDevices.clear(); @@ -542,19 +542,19 @@ bool K3bDevice::DeviceManager::readConfig( KConfig* c ) c->setGroup( "Devices" ); - QStringList deviceSearchPath = c->readListEntry( "device_search_path" ); - for( QStringList::const_iterator it = deviceSearchPath.constBegin(); + TQStringList deviceSearchPath = c->readListEntry( "device_search_path" ); + for( TQStringList::const_iterator it = deviceSearchPath.constBegin(); it != deviceSearchPath.constEnd(); ++it ) addDevice( *it ); // // Iterate over all devices and check if we have a config entry // - for( QPtrListIterator it( d->allDevices ); *it; ++it ) { + for( TQPtrListIterator it( d->allDevices ); *it; ++it ) { K3bDevice::Device* dev = *it; - QString configEntryName = dev->vendor() + " " + dev->description(); - QStringList list = c->readListEntry( configEntryName ); + TQString configEntryName = dev->vendor() + " " + dev->description(); + TQStringList list = c->readListEntry( configEntryName ); if( !list.isEmpty() ) { k3bDebug() << "(K3bDevice::DeviceManager) found config entry for devicetype: " << configEntryName << endl; @@ -587,25 +587,25 @@ bool K3bDevice::DeviceManager::saveConfig( KConfig* c ) // c->setGroup( "Devices" ); - QStringList deviceSearchPath = c->readListEntry( "device_search_path" ); + TQStringList deviceSearchPath = c->readListEntry( "device_search_path" ); // remove duplicate entries (caused by buggy old implementations) - QStringList saveDeviceSearchPath; - for( QStringList::const_iterator it = deviceSearchPath.constBegin(); it != deviceSearchPath.constEnd(); ++it ) - if( !saveDeviceSearchPath.contains( *it ) ) + TQStringList saveDeviceSearchPath; + for( TQStringList::const_iterator it = deviceSearchPath.constBegin(); it != deviceSearchPath.constEnd(); ++it ) + if( !saveDeviceSearchPath.tqcontains( *it ) ) saveDeviceSearchPath.append( *it ); - for( QPtrListIterator it( d->allDevices ); *it; ++it ) { + for( TQPtrListIterator it( d->allDevices ); *it; ++it ) { K3bDevice::Device* dev = *it; // update device search path - if( !saveDeviceSearchPath.contains( dev->blockDeviceName() ) ) + if( !saveDeviceSearchPath.tqcontains( dev->blockDeviceName() ) ) saveDeviceSearchPath.append( dev->blockDeviceName() ); // save the device type settings - QString configEntryName = dev->vendor() + " " + dev->description(); - QStringList list; - list << QString::number(dev->maxReadSpeed()) - << QString::number(dev->maxWriteSpeed()) + TQString configEntryName = dev->vendor() + " " + dev->description(); + TQStringList list; + list << TQString::number(dev->maxReadSpeed()) + << TQString::number(dev->maxWriteSpeed()) << dev->cdrdaoDriver(); if( dev->cdrdaoDriver() != "auto" ) @@ -624,7 +624,7 @@ bool K3bDevice::DeviceManager::saveConfig( KConfig* c ) } -bool K3bDevice::DeviceManager::testForCdrom( const QString& devicename ) +bool K3bDevice::DeviceManager::testForCdrom( const TQString& devicename ) { #ifdef Q_OS_FREEBSD Q_UNUSED(devicename); @@ -659,7 +659,7 @@ bool K3bDevice::DeviceManager::testForCdrom( const QString& devicename ) ::memset( buf, 0, sizeof(buf) ); ScsiCommand cmd( cdromfd ); - cmd[0] = MMC_INQUIRY; + cmd[0] = MMC_INTQUIRY; cmd[4] = sizeof(buf); cmd[5] = 0; @@ -680,7 +680,7 @@ bool K3bDevice::DeviceManager::testForCdrom( const QString& devicename ) #endif } -K3bDevice::Device* K3bDevice::DeviceManager::addDevice( const QString& devicename ) +K3bDevice::Device* K3bDevice::DeviceManager::addDevice( const TQString& devicename ) { #ifdef Q_OS_FREEBSD return 0; @@ -689,7 +689,7 @@ K3bDevice::Device* K3bDevice::DeviceManager::addDevice( const QString& devicenam K3bDevice::Device* device = 0; // resolve all symlinks - QString resolved = resolveSymLink( devicename ); + TQString resolved = resolveSymLink( devicename ); k3bDebug() << devicename << " resolved to " << resolved << endl; if ( K3bDevice::Device* oldDev = findDevice(resolved) ) { @@ -735,7 +735,7 @@ K3bDevice::Device* K3bDevice::DeviceManager::addDevice( const QString& devicenam K3bDevice::Device* K3bDevice::DeviceManager::addDevice( K3bDevice::Device* device ) { - const QString devicename = device->devicename(); + const TQString devicename = device->devicename(); if( !device->init() ) { k3bDebug() << "Could not initialize device " << devicename << endl; @@ -777,7 +777,7 @@ K3bDevice::Device* K3bDevice::DeviceManager::addDevice( K3bDevice::Device* devic } -void K3bDevice::DeviceManager::removeDevice( const QString& dev ) +void K3bDevice::DeviceManager::removeDevice( const TQString& dev ) { if( Device* device = findDevice( dev ) ) { d->cdReader.removeRef( device ); @@ -796,7 +796,7 @@ void K3bDevice::DeviceManager::removeDevice( const QString& dev ) } -bool K3bDevice::DeviceManager::determineBusIdLun( const QString& dev, int& bus, int& id, int& lun ) +bool K3bDevice::DeviceManager::determineBusIdLun( const TQString& dev, int& bus, int& id, int& lun ) { #ifdef Q_OS_FREEBSD Q_UNUSED(dev); @@ -887,16 +887,16 @@ bool K3bDevice::DeviceManager::determineBusIdLun( const QString& dev, int& bus, } -QString K3bDevice::DeviceManager::resolveSymLink( const QString& path ) +TQString K3bDevice::DeviceManager::resolveSymLink( const TQString& path ) { char resolved[PATH_MAX]; - if( !realpath( QFile::encodeName(path), resolved ) ) + if( !realpath( TQFile::encodeName(path), resolved ) ) { k3bDebug() << "Could not resolve " << path << endl; return path; } - return QString::fromLatin1( resolved ); + return TQString::tqfromLatin1( resolved ); } diff --git a/libk3bdevice/k3bdevicemanager.h b/libk3bdevice/k3bdevicemanager.h index 4656538..258afa2 100644 --- a/libk3bdevice/k3bdevicemanager.h +++ b/libk3bdevice/k3bdevicemanager.h @@ -17,11 +17,11 @@ #ifndef K3BDEVICEMANAGER_H #define K3BDEVICEMANAGER_H -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include "k3bdevice_export.h" #include @@ -47,15 +47,16 @@ namespace K3bDevice { * K3bDevice::Device* dev = manager->findDevice( "/dev/cdrom" ); * \endcode */ - class LIBK3BDEVICE_EXPORT DeviceManager : public QObject + class LIBK3BDEVICE_EXPORT DeviceManager : public TQObject { Q_OBJECT + TQ_OBJECT public: /** * Creates a new DeviceManager */ - DeviceManager( QObject* parent = 0, const char* name = 0 ); + DeviceManager( TQObject* tqparent = 0, const char* name = 0 ); virtual ~DeviceManager(); /** @@ -72,15 +73,15 @@ namespace K3bDevice { void setCheckWritingModes( bool b ); /** - * \deprecated use findDevice( const QString& ) + * \deprecated use findDevice( const TQString& ) */ - Device* deviceByName( const QString& ); + Device* deviceByName( const TQString& ); /** * Search an SCSI device by SCSI bus, id, and lun. * * \note This method does not initialize new devices. - * Devices cannot be found until they have been added via addDevice(const QString&) + * Devices cannot be found until they have been added via addDevice(const TQString&) * or scanBus(). * * \return The corresponding device or 0 if there is no such device. @@ -91,81 +92,81 @@ namespace K3bDevice { * Search a device by blockdevice name. * * \note This method does not initialize new devices. - * Devices cannot be found until they have been added via addDevice(const QString&) + * Devices cannot be found until they have been added via addDevice(const TQString&) * or scanBus(). * * \return The corresponding device or 0 if there is no such device. */ - Device* findDevice( const QString& devicename ); + Device* findDevice( const TQString& devicename ); /** * Before getting the devices do a @ref scanBus(). * \return List of all cd writer devices. * \deprecated use cdWriter() */ - const QPtrList& burningDevices() const; + const TQPtrList& burningDevices() const; /** * \return List of all reader devices without writer devices. * \deprecated use cdReader() **/ - const QPtrList& readingDevices() const; + const TQPtrList& readingDevices() const; /** * Before getting the devices do a @ref scanBus() or add - * devices via addDevice( const QString& ). + * devices via addDevice( const TQString& ). * * \return List of all devices. */ - const QPtrList& allDevices() const; + const TQPtrList& allDevices() const; /** * Before getting the devices do a @ref scanBus() or add - * devices via addDevice( const QString& ). + * devices via addDevice( const TQString& ). * * \return List of all cd writer devices. */ - const QPtrList& cdWriter() const; + const TQPtrList& cdWriter() const; /** * Before getting the devices do a @ref scanBus() or add - * devices via addDevice( const QString& ). + * devices via addDevice( const TQString& ). * * \return List of all cd reader devices. */ - const QPtrList& cdReader() const; + const TQPtrList& cdReader() const; /** * Before getting the devices do a @ref scanBus() or add - * devices via addDevice( const QString& ). + * devices via addDevice( const TQString& ). * * \return List of all DVD writer devices. */ - const QPtrList& dvdWriter() const; + const TQPtrList& dvdWriter() const; /** * Before getting the devices do a @ref scanBus() or add - * devices via addDevice( const QString& ). + * devices via addDevice( const TQString& ). * * \return List of all DVD reader devices. */ - const QPtrList& dvdReader() const; + const TQPtrList& dvdReader() const; /** * Before getting the devices do a @ref scanBus() or add - * devices via addDevice( const QString& ). + * devices via addDevice( const TQString& ). * * \return List of all Blue Ray reader devices. */ - const QPtrList& blueRayReader() const; + const TQPtrList& blueRayReader() const; /** * Before getting the devices do a @ref scanBus() or add - * devices via addDevice( const QString& ). + * devices via addDevice( const TQString& ). * * \return List of all Blue Ray writer devices. */ - const QPtrList& blueRayWriters() const; + const TQPtrList& blueRayWriters() const; /** * Reads the device information from the config file. @@ -209,14 +210,14 @@ namespace K3bDevice { * * \return The device if it could be found or 0 otherwise. */ - virtual Device* addDevice( const QString& dev ); + virtual Device* addDevice( const TQString& dev ); /** * Remove a device from the device manager. Basicly this method * only makes sense in combination with the HalConnection. Connect * it to the deviceRemoved signal. */ - virtual void removeDevice( const QString& dev ); + virtual void removeDevice( const TQString& dev ); signals: /** @@ -226,9 +227,9 @@ namespace K3bDevice { void changed(); private: - bool testForCdrom( const QString& ); - bool determineBusIdLun( const QString &dev, int& bus, int& id, int& lun ); - QString resolveSymLink( const QString& path ); + bool testForCdrom( const TQString& ); + bool determineBusIdLun( const TQString &dev, int& bus, int& id, int& lun ); + TQString resolveSymLink( const TQString& path ); class Private; Private* d; diff --git a/libk3bdevice/k3bdiskinfo.cpp b/libk3bdevice/k3bdiskinfo.cpp index 6c91d19..534e74b 100644 --- a/libk3bdevice/k3bdiskinfo.cpp +++ b/libk3bdevice/k3bdiskinfo.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include K3bDevice::DiskInfo::DiskInfo() diff --git a/libk3bdevice/k3bdiskinfo.h b/libk3bdevice/k3bdiskinfo.h index ed7c382..d653852 100644 --- a/libk3bdevice/k3bdiskinfo.h +++ b/libk3bdevice/k3bdiskinfo.h @@ -23,7 +23,7 @@ #include #include "k3bdevice_export.h" -#include +#include class kdbgstream; @@ -148,7 +148,7 @@ namespace K3bDevice */ K3b::Msf firstLayerSize() const; - const QCString& mediaId() const { return m_mediaId; } + const TQCString& mediaId() const { return m_mediaId; } void debug() const; @@ -171,7 +171,7 @@ namespace K3bDevice K3b::Msf m_usedCapacity; K3b::Msf m_firstLayerSize; - QCString m_mediaId; + TQCString m_mediaId; friend class Device; }; diff --git a/libk3bdevice/k3bhalconnection.cpp b/libk3bdevice/k3bhalconnection.cpp index 2b0877b..d57b346 100644 --- a/libk3bdevice/k3bhalconnection.cpp +++ b/libk3bdevice/k3bhalconnection.cpp @@ -19,7 +19,7 @@ #include #include -#include +#include // We acknowledge the the dbus API is unstable #define DBUS_API_SUBJECT_TO_CHANGE @@ -28,7 +28,7 @@ #include -static char** qstringListToArray( const QStringList& s ) +static char** qstringListToArray( const TQStringList& s ) { char** a = new char*[s.count()]; for( unsigned int i = 0; i < s.count(); ++i ) { @@ -72,20 +72,20 @@ class K3bDevice::HalConnection::Private public: Private() : halContext(0), - dBusQtConnection(0), + dBusTQtConnection(0), bOpen(false) { } LibHalContext* halContext; DBusConnection* connection; - DBusQt::Connection* dBusQtConnection; + DBusTQt::Connection* dBusTQtConnection; bool bOpen; - QMap udiDeviceMap; - QMap deviceUdiMap; + TQMap udiDeviceMap; + TQMap deviceUdiMap; - QMap deviceMediumUdiMap; + TQMap deviceMediumUdiMap; }; @@ -101,8 +101,8 @@ K3bDevice::HalConnection* K3bDevice::HalConnection::instance() } -K3bDevice::HalConnection::HalConnection( QObject* parent, const char* name ) - : QObject( parent, name ) +K3bDevice::HalConnection::HalConnection( TQObject* tqparent, const char* name ) + : TQObject( tqparent, name ) { d = new Private(); } @@ -142,7 +142,7 @@ bool K3bDevice::HalConnection::open() return false; } - setupDBusQtConnection( d->connection ); + setupDBusTQtConnection( d->connection ); libhal_ctx_set_dbus_connection( d->halContext, d->connection ); @@ -181,18 +181,18 @@ void K3bDevice::HalConnection::close() libhal_ctx_free( d->halContext ); // delete the connection (may be 0 if open() failed) - delete d->dBusQtConnection; + delete d->dBusTQtConnection; d->halContext = 0; - d->dBusQtConnection = 0; + d->dBusTQtConnection = 0; d->bOpen = false; } } -QStringList K3bDevice::HalConnection::devices() const +TQStringList K3bDevice::HalConnection::devices() const { - return QStringList( d->udiDeviceMap.values() ); + return TQStringList( d->udiDeviceMap.values() ); } @@ -205,7 +205,7 @@ void K3bDevice::HalConnection::addDevice( const char* udi ) if( libhal_device_query_capability( d->halContext, udi, "storage.cdrom", 0 ) ) { char* dev = libhal_device_get_property_string( d->halContext, udi, "block.device", 0 ); if( dev ) { - QString s( dev ); + TQString s( dev ); libhal_free_string( dev ); if( !s.isEmpty() ) { @@ -220,15 +220,15 @@ void K3bDevice::HalConnection::addDevice( const char* udi ) if( libhal_device_property_exists( d->halContext, udi, "block.storage_device", 0 ) ) { char* deviceUdi = libhal_device_get_property_string( d->halContext, udi, "block.storage_device", 0 ); if( deviceUdi ) { - QCString du( deviceUdi ); + TQCString du( deviceUdi ); libhal_free_string( deviceUdi ); - if( d->udiDeviceMap.contains( du ) ) { + if( d->udiDeviceMap.tqcontains( du ) ) { // // A new medium has been inserted. Save this medium's udi so we can reuse it later // on for the mount/unmount/eject methods // - d->deviceMediumUdiMap[du] = QCString( udi ); + d->deviceMediumUdiMap[du] = TQCString( udi ); emit mediumChanged( d->udiDeviceMap[du] ); } } @@ -239,7 +239,7 @@ void K3bDevice::HalConnection::addDevice( const char* udi ) void K3bDevice::HalConnection::removeDevice( const char* udi ) { - QMapIterator it = d->udiDeviceMap.find( udi ); + TQMapIterator it = d->udiDeviceMap.tqfind( udi ); if( it != d->udiDeviceMap.end() ) { k3bDebug() << "Unmapping udi " << udi << " from device " << it.data() << endl; emit deviceRemoved( it.data() ); @@ -250,10 +250,10 @@ void K3bDevice::HalConnection::removeDevice( const char* udi ) if( libhal_device_property_exists( d->halContext, udi, "block.storage_device", 0 ) ) { char* deviceUdi = libhal_device_get_property_string( d->halContext, udi, "block.storage_device", 0 ); if( deviceUdi ) { - QCString du( deviceUdi ); + TQCString du( deviceUdi ); libhal_free_string( deviceUdi ); - if( d->udiDeviceMap.contains( du ) ) { + if( d->udiDeviceMap.tqcontains( du ) ) { // // A medium has been removed/ejected. // @@ -276,11 +276,11 @@ int K3bDevice::HalConnection::lock( Device* dev ) DBusMessage* reply = 0; DBusError error; - if( !d->deviceUdiMap.contains( dev->blockDeviceName() ) ) { + if( !d->deviceUdiMap.tqcontains( dev->blockDeviceName() ) ) { return org_freedesktop_Hal_Device_Volume_NoSuchDevice; } - QCString udi = d->deviceUdiMap[dev->blockDeviceName()]; + TQCString udi = d->deviceUdiMap[dev->blockDeviceName()]; if( !( dmesg = dbus_message_new_method_call( "org.freedesktop.Hal", udi.data(), "org.freedesktop.Hal.Device", @@ -335,11 +335,11 @@ int K3bDevice::HalConnection::unlock( Device* dev ) DBusMessage* reply = 0; DBusError error; - if( !d->deviceUdiMap.contains( dev->blockDeviceName() ) ) { + if( !d->deviceUdiMap.tqcontains( dev->blockDeviceName() ) ) { return org_freedesktop_Hal_Device_Volume_NoSuchDevice; } - QCString udi = d->deviceUdiMap[dev->blockDeviceName()]; + TQCString udi = d->deviceUdiMap[dev->blockDeviceName()]; if( !( dmesg = dbus_message_new_method_call( "org.freedesktop.Hal", udi.data(), "org.freedesktop.Hal.Device", @@ -382,9 +382,9 @@ int K3bDevice::HalConnection::unlock( Device* dev ) int K3bDevice::HalConnection::mount( K3bDevice::Device* dev, - const QString& mountPoint, - const QString& fstype, - const QStringList& options ) + const TQString& mountPoint, + const TQString& fstype, + const TQStringList& options ) { // // The code below is based on the code from kioslave/media/mediamanager/halbackend.cpp in the kdebase package @@ -394,13 +394,13 @@ int K3bDevice::HalConnection::mount( K3bDevice::Device* dev, DBusMessage* reply = 0; DBusError error; - if( !d->deviceUdiMap.contains( dev->blockDeviceName() ) ) + if( !d->deviceUdiMap.tqcontains( dev->blockDeviceName() ) ) return org_freedesktop_Hal_NoSuchDevice; - if( !d->deviceMediumUdiMap.contains( d->deviceUdiMap[dev->blockDeviceName()] ) ) + if( !d->deviceMediumUdiMap.tqcontains( d->deviceUdiMap[dev->blockDeviceName()] ) ) return org_freedesktop_Hal_Device_Volume_NoSuchDevice; - QCString mediumUdi = d->deviceMediumUdiMap[d->deviceUdiMap[dev->blockDeviceName()]]; + TQCString mediumUdi = d->deviceMediumUdiMap[d->deviceUdiMap[dev->blockDeviceName()]]; if( !( dmesg = dbus_message_new_method_call( "org.freedesktop.Hal", mediumUdi.data(), "org.freedesktop.Hal.Device.Volume", @@ -411,8 +411,8 @@ int K3bDevice::HalConnection::mount( K3bDevice::Device* dev, char** poptions = qstringListToArray( options ); - QByteArray strMountPoint = mountPoint.local8Bit(); - QByteArray strFstype = fstype.local8Bit(); + TQByteArray strMountPoint = mountPoint.local8Bit(); + TQByteArray strFstype = fstype.local8Bit(); if( !dbus_message_append_args( dmesg, DBUS_TYPE_STRING, strMountPoint.data(), @@ -464,7 +464,7 @@ int K3bDevice::HalConnection::mount( K3bDevice::Device* dev, int K3bDevice::HalConnection::unmount( K3bDevice::Device* dev, - const QStringList& options ) + const TQStringList& options ) { // // The code below is based on the code from kioslave/media/mediamanager/halbackend.cpp in the kdebase package @@ -474,13 +474,13 @@ int K3bDevice::HalConnection::unmount( K3bDevice::Device* dev, DBusMessage* reply = 0; DBusError error; - if( !d->deviceUdiMap.contains( dev->blockDeviceName() ) ) + if( !d->deviceUdiMap.tqcontains( dev->blockDeviceName() ) ) return org_freedesktop_Hal_NoSuchDevice; - if( !d->deviceMediumUdiMap.contains( d->deviceUdiMap[dev->blockDeviceName()] ) ) + if( !d->deviceMediumUdiMap.tqcontains( d->deviceUdiMap[dev->blockDeviceName()] ) ) return org_freedesktop_Hal_Device_Volume_NoSuchDevice; - QCString mediumUdi = d->deviceMediumUdiMap[d->deviceUdiMap[dev->blockDeviceName()]]; + TQCString mediumUdi = d->deviceMediumUdiMap[d->deviceUdiMap[dev->blockDeviceName()]]; if( !( dmesg = dbus_message_new_method_call( "org.freedesktop.Hal", mediumUdi.data(), "org.freedesktop.Hal.Device.Volume", @@ -535,7 +535,7 @@ int K3bDevice::HalConnection::unmount( K3bDevice::Device* dev, int K3bDevice::HalConnection::eject( K3bDevice::Device* dev, - const QStringList& options ) + const TQStringList& options ) { // // The code below is based on the code from kioslave/media/mediamanager/halbackend.cpp in the kdebase package @@ -545,13 +545,13 @@ int K3bDevice::HalConnection::eject( K3bDevice::Device* dev, DBusMessage* reply = 0; DBusError error; - if( !d->deviceUdiMap.contains( dev->blockDeviceName() ) ) + if( !d->deviceUdiMap.tqcontains( dev->blockDeviceName() ) ) return org_freedesktop_Hal_NoSuchDevice; - if( !d->deviceMediumUdiMap.contains( d->deviceUdiMap[dev->blockDeviceName()] ) ) + if( !d->deviceMediumUdiMap.tqcontains( d->deviceUdiMap[dev->blockDeviceName()] ) ) return org_freedesktop_Hal_Device_Volume_NoSuchDevice; - QCString mediumUdi = d->deviceMediumUdiMap[d->deviceUdiMap[dev->blockDeviceName()]]; + TQCString mediumUdi = d->deviceMediumUdiMap[d->deviceUdiMap[dev->blockDeviceName()]]; if( !( dmesg = dbus_message_new_method_call( "org.freedesktop.Hal", mediumUdi.data(), "org.freedesktop.Hal.Device.Volume", @@ -601,10 +601,10 @@ int K3bDevice::HalConnection::eject( K3bDevice::Device* dev, } -void K3bDevice::HalConnection::setupDBusQtConnection( DBusConnection* dbusConnection ) +void K3bDevice::HalConnection::setupDBusTQtConnection( DBusConnection* dbusConnection ) { - d->dBusQtConnection = new DBusQt::Connection( this ); - d->dBusQtConnection->dbus_connection_setup_with_qt_main( dbusConnection ); + d->dBusTQtConnection = new DBusTQt::Connection( this ); + d->dBusTQtConnection->dbus_connection_setup_with_qt_main( dbusConnection ); } #include "k3bhalconnection.moc" diff --git a/libk3bdevice/k3bhalconnection.h b/libk3bdevice/k3bhalconnection.h index 583bbf2..882b7b4 100644 --- a/libk3bdevice/k3bhalconnection.h +++ b/libk3bdevice/k3bhalconnection.h @@ -22,9 +22,9 @@ #include "k3bdevice_export.h" -#include -#include -#include +#include +#include +#include class DBusConnection; @@ -44,9 +44,10 @@ namespace K3bDevice { * This class does not deal with K3b devices but with system device names * such as /dev/cdrom. These device names can be used in DeviceManager::findDevice(). */ - class LIBK3BDEVICE_EXPORT HalConnection : public QObject + class LIBK3BDEVICE_EXPORT HalConnection : public TQObject { Q_OBJECT + TQ_OBJECT public: ~HalConnection(); @@ -71,7 +72,7 @@ namespace K3bDevice { /** * \return a list of optical devices as reported by HAL. */ - QStringList devices() const; + TQStringList devices() const; /** * \internal @@ -143,9 +144,9 @@ namespace K3bDevice { * \see ErrorCode */ int mount( Device*, - const QString& mountPoint = QString::null, - const QString& fstype = QString::null, - const QStringList& options = QStringList() ); + const TQString& mountPoint = TQString(), + const TQString& fstype = TQString(), + const TQStringList& options = TQStringList() ); /** * Unmounts a device via HAL @@ -159,7 +160,7 @@ namespace K3bDevice { * \see ErrorCode */ int unmount( Device*, - const QStringList& options = QStringList() ); + const TQStringList& options = TQStringList() ); /** * Unmounts a device via HAL @@ -173,7 +174,7 @@ namespace K3bDevice { * \see ErrorCode */ int eject( Device*, - const QStringList& options = QStringList() ); + const TQStringList& options = TQStringList() ); signals: /** @@ -181,7 +182,7 @@ namespace K3bDevice { * * \param dev The block device name of the new drive. */ - void deviceAdded( const QString& dev ); + void deviceAdded( const TQString& dev ); /** * This signal gets emitted whenever HAL detects that an optical drive @@ -189,7 +190,7 @@ namespace K3bDevice { * * \param dev The block device name of the drive. */ - void deviceRemoved( const QString& dev ); + void deviceRemoved( const TQString& dev ); /** * This signal gets emitted whenever a new medium is inserted into a @@ -197,13 +198,13 @@ namespace K3bDevice { * * \param dev The block device name of the drive the medium is or was inserted into. */ - void mediumChanged( const QString& dev ); + void mediumChanged( const TQString& dev ); private: /** * HalConnection is a signelton class. Use the instance() method to create it. */ - HalConnection( QObject* parent = 0, const char* name = 0 ); + HalConnection( TQObject* tqparent = 0, const char* name = 0 ); /** * Tries to open a connection to HAL. @@ -216,7 +217,7 @@ namespace K3bDevice { class Private; Private* d; - void setupDBusQtConnection( DBusConnection* dbusConnection ); + void setupDBusTQtConnection( DBusConnection* dbusConnection ); }; } diff --git a/libk3bdevice/k3bmmc.h b/libk3bdevice/k3bmmc.h index ebe2171..76c9927 100644 --- a/libk3bdevice/k3bmmc.h +++ b/libk3bdevice/k3bmmc.h @@ -42,7 +42,7 @@ namespace K3bDevice */ typedef struct disc_info { - Q_UINT16 length; + TQ_UINT16 length; #ifdef WORDS_BIGENDIAN // __BYTE_ORDER == __BIG_ENDIAN unsigned char reserved1 : 3; unsigned char erasable : 1; @@ -86,7 +86,7 @@ namespace K3bDevice unsigned char n_sessions_m; unsigned char first_track_m; unsigned char last_track_m; - Q_UINT32 disc_id; + TQ_UINT32 disc_id; /* * Last session lead-in start time @@ -214,7 +214,7 @@ namespace K3bDevice /** * Based on the cdrecord struct cd_mode_page_2A - * MM Capabilities and Mechanical Status Page + * MM Capabilities and Mechanical tqStatus Page */ #ifdef WORDS_BIGENDIAN // __BYTE_ORDER == __BIG_ENDIAN diff --git a/libk3bdevice/k3bmsf.cpp b/libk3bdevice/k3bmsf.cpp index c7257a1..c8f6c70 100644 --- a/libk3bdevice/k3bmsf.cpp +++ b/libk3bdevice/k3bmsf.cpp @@ -14,7 +14,7 @@ */ #include "k3bmsf.h" -#include +#include #include @@ -156,9 +156,9 @@ K3b::Msf& K3b::Msf::operator--() } -QString K3b::Msf::toString( bool showFrames ) const +TQString K3b::Msf::toString( bool showFrames ) const { - QString str; + TQString str; if( showFrames ) str.sprintf( "%.2i:%.2i:%.2i", m_minutes, m_seconds, m_frames ); @@ -219,7 +219,7 @@ void K3b::Msf::makeValid() -QRegExp K3b::Msf::regExp() +TQRegExp K3b::Msf::regExp() { // // An MSF can have the following formats: @@ -228,7 +228,7 @@ QRegExp K3b::Msf::regExp() // 100:23:72 (minutes:seconds:frames) // 100:23.72 (minutes:seconds.frames) // - static QRegExp rx( "(\\d+)(?::([0-5]?\\d)(?:[:\\.]((?:[0-6]?\\d)|(?:7[0-4])))?)?" ); + static TQRegExp rx( "(\\d+)(?::([0-5]?\\d)(?:[:\\.]((?:[0-6]?\\d)|(?:7[0-4])))?)?" ); return rx; } @@ -239,9 +239,9 @@ K3b::Msf K3b::Msf::fromSeconds( double ms ) } -K3b::Msf K3b::Msf::fromString( const QString& s, bool* ok ) +K3b::Msf K3b::Msf::fromString( const TQString& s, bool* ok ) { - QRegExp rx = regExp(); + TQRegExp rx = regExp(); K3b::Msf msf; diff --git a/libk3bdevice/k3bmsf.h b/libk3bdevice/k3bmsf.h index d2209c3..973f6c3 100644 --- a/libk3bdevice/k3bmsf.h +++ b/libk3bdevice/k3bmsf.h @@ -17,8 +17,8 @@ #ifndef _K3B_MSF_H_ #define _K3B_MSF_H_ -#include -#include +#include +#include #include #include @@ -65,7 +65,7 @@ namespace K3b void addSeconds( int s ); void addFrames( int f ); - QString toString( bool showFrames = true ) const; + TQString toString( bool showFrames = true ) const; KIO::filesize_t mode1Bytes() const; KIO::filesize_t mode2Form1Bytes() const; @@ -83,7 +83,7 @@ namespace K3b * \li 100:23:57 - treated as 100 minutes, 23 seconds, and 57 frames * \li 100:23.57 - treated as 100 minutes, 23 seconds, and 57 frames */ - static Msf fromString( const QString&, bool* ok = 0 ); + static Msf fromString( const TQString&, bool* ok = 0 ); /** * @param ms seconds @@ -91,7 +91,7 @@ namespace K3b */ static Msf fromSeconds( double ms ); - static QRegExp regExp(); + static TQRegExp regExp(); private: void makeValid(); diff --git a/libk3bdevice/k3bscsicommand.cpp b/libk3bdevice/k3bscsicommand.cpp index 2b34217..710b8a3 100644 --- a/libk3bdevice/k3bscsicommand.cpp +++ b/libk3bdevice/k3bscsicommand.cpp @@ -19,7 +19,7 @@ #include -QString K3bDevice::commandString( const unsigned char& command ) +TQString K3bDevice::commandString( const unsigned char& command ) { if( command == MMC_BLANK ) return "BLANK"; @@ -35,8 +35,8 @@ QString K3bDevice::commandString( const unsigned char& command ) return "GET EVENT STATUS NOTIFICATION"; if( command == MMC_GET_PERFORMANCE ) return "GET PERFORMANCE"; - if( command == MMC_INQUIRY ) - return "INQUIRY"; + if( command == MMC_INTQUIRY ) + return "INTQUIRY"; if( command == MMC_LOAD_UNLOAD_MEDIUM ) return "LOAD/UNLOAD MEDIUM"; if( command == MMC_MECHANISM_STATUS ) @@ -130,7 +130,7 @@ QString K3bDevice::commandString( const unsigned char& command ) } -QString K3bDevice::ScsiCommand::senseKeyToString( int key ) +TQString K3bDevice::ScsiCommand::senseKeyToString( int key ) { switch( key ) { case 0x0: @@ -168,13 +168,13 @@ QString K3bDevice::ScsiCommand::senseKeyToString( int key ) void K3bDevice::ScsiCommand::debugError( int command, int errorCode, int senseKey, int asc, int ascq ) { if( m_printErrors ) { k3bDebug() << "(K3bDevice::ScsiCommand) failed: " << endl - << " command: " << QString("%1 (%2)") - .arg( K3bDevice::commandString( command ) ) - .arg( QString::number(command, 16) ) << endl - << " errorcode: " << QString::number(errorCode, 16) << endl + << " command: " << TQString("%1 (%2)") + .tqarg( K3bDevice::commandString( command ) ) + .tqarg( TQString::number(command, 16) ) << endl + << " errorcode: " << TQString::number(errorCode, 16) << endl << " sense key: " << senseKeyToString(senseKey) << endl - << " asc: " << QString::number(asc, 16) << endl - << " ascq: " << QString::number(ascq, 16) << endl; + << " asc: " << TQString::number(asc, 16) << endl + << " ascq: " << TQString::number(ascq, 16) << endl; } } diff --git a/libk3bdevice/k3bscsicommand.h b/libk3bdevice/k3bscsicommand.h index 11a9860..7a718d1 100644 --- a/libk3bdevice/k3bscsicommand.h +++ b/libk3bdevice/k3bscsicommand.h @@ -16,8 +16,8 @@ #ifndef _K3B_SCSI_COMMAND_H_ #define _K3B_SCSI_COMMAND_H_ -#include -#include +#include +#include #include "k3bdevice.h" @@ -31,7 +31,7 @@ namespace K3bDevice const unsigned char MMC_GET_CONFIGURATION = 0x46; const unsigned char MMC_GET_EVENT_STATUS_NOTIFICATION = 0x4A; const unsigned char MMC_GET_PERFORMANCE = 0xAC; - const unsigned char MMC_INQUIRY = 0x12; + const unsigned char MMC_INTQUIRY = 0x12; const unsigned char MMC_LOAD_UNLOAD_MEDIUM = 0xA6; const unsigned char MMC_MECHANISM_STATUS = 0xBD; const unsigned char MMC_MODE_SELECT = 0x55; @@ -78,7 +78,7 @@ namespace K3bDevice const unsigned char MMC_WRITE_AND_VERIFY_10 = 0x2E; const unsigned char MMC_WRITE_BUFFER = 0x3B; - QString commandString( const unsigned char& command ); + TQString commandString( const unsigned char& command ); enum TransportDirection { TR_DIR_NONE, @@ -127,7 +127,7 @@ namespace K3bDevice size_t len = 0 ); private: - static QString senseKeyToString( int key ); + static TQString senseKeyToString( int key ); void debugError( int command, int errorCode, int senseKey, int asc, int ascq ); class Private; diff --git a/libk3bdevice/k3bscsicommand_bsd.cpp b/libk3bdevice/k3bscsicommand_bsd.cpp index 84e12f9..eb7f3a3 100644 --- a/libk3bdevice/k3bscsicommand_bsd.cpp +++ b/libk3bdevice/k3bscsicommand_bsd.cpp @@ -83,14 +83,14 @@ int K3bDevice::ScsiCommand::transport( TransportDirection dir, d->ccb.ccb_h.target_id = m_device->handle()->target_id; d->ccb.ccb_h.target_lun = m_device->handle()->target_lun; - k3bDebug() << "(K3bDevice::ScsiCommand) transport command " << QString::number((int)d->ccb.csio.cdb_io.cdb_bytes[0], 16) << ", length: " << (int)d->ccb.csio.cdb_len << endl; + k3bDebug() << "(K3bDevice::ScsiCommand) transport command " << TQString::number((int)d->ccb.csio.cdb_io.cdb_bytes[0], 16) << ", length: " << (int)d->ccb.csio.cdb_len << endl; int ret=0; - int direction = CAM_DEV_QFRZDIS; + int direction = CAM_DEV_TQFRZDIS; if (!len) direction |= CAM_DIR_NONE; else direction |= (dir & TR_DIR_READ)?CAM_DIR_IN : CAM_DIR_OUT; - cam_fill_csio (&(d->ccb.csio), 1, 0 /* NULL */, direction, MSG_SIMPLE_Q_TAG, (u_int8_t *)data, len, sizeof(d->ccb.csio.sense_data), d->ccb.csio.cdb_len, 30*1000); + cam_fill_csio (&(d->ccb.csio), 1, 0 /* NULL */, direction, MSG_SIMPLE_TQ_TAG, (u_int8_t *)data, len, sizeof(d->ccb.csio.sense_data), d->ccb.csio.cdb_len, 30*1000); unsigned char * sense = (unsigned char *)&d->ccb.csio.sense_data; ret = cam_send_ccb(m_device->handle(), &d->ccb); @@ -118,7 +118,7 @@ int K3bDevice::ScsiCommand::transport( TransportDirection dir, return result ? result : ret; } - else if ((d->ccb.ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) { + else if ((d->ccb.ccb_h.status & CAM_STATUS_MASK) == CAM_RETQ_CMP) { if( needToClose ) m_device->close(); m_device->usageUnlock(); @@ -165,7 +165,7 @@ int K3bDevice::ScsiCommand::transport( TransportDirection dir, return -1; } - if ((d->ccb.ccb_h.status&CAM_STATUS_MASK) != CAM_REQ_CMP) + if ((d->ccb.ccb_h.status&CAM_STATUS_MASK) != CAM_RETQ_CMP) { k3bDebug() << "(K3bDevice::ScsiCommand) transport failed (3): " << ret << endl; errno=EIO,-1; diff --git a/libk3bdevice/k3btoc.cpp b/libk3bdevice/k3btoc.cpp index 570bc9e..3ee39f1 100644 --- a/libk3bdevice/k3btoc.cpp +++ b/libk3bdevice/k3btoc.cpp @@ -17,17 +17,17 @@ #include "k3btoc.h" #include "k3bdebug.h" -#include +#include K3bDevice::Toc::Toc() - : QValueList() + : TQValueList() { } K3bDevice::Toc::Toc( const Toc& toc ) - : QValueList( toc ) + : TQValueList( toc ) { m_firstSector = toc.firstSector(); } @@ -44,7 +44,7 @@ K3bDevice::Toc& K3bDevice::Toc::operator=( const Toc& toc ) m_firstSector = toc.firstSector(); - QValueList::operator=( toc ); + TQValueList::operator=( toc ); return *this; } @@ -125,7 +125,7 @@ int K3bDevice::Toc::sessions() const void K3bDevice::Toc::clear() { - QValueList::clear(); + TQValueList::clear(); m_mcn.resize( 0 ); m_firstSector = 0; } @@ -152,12 +152,12 @@ void K3bDevice::Toc::debug() const bool K3bDevice::Toc::operator==( const Toc& other ) const { return( m_firstSector == other.m_firstSector && - QValueList::operator==( other ) ); + TQValueList::operator==( other ) ); } bool K3bDevice::Toc::operator!=( const Toc& other ) const { return( m_firstSector != other.m_firstSector || - QValueList::operator!=( other ) ); + TQValueList::operator!=( other ) ); } diff --git a/libk3bdevice/k3btoc.h b/libk3bdevice/k3btoc.h index adfba74..45923f6 100644 --- a/libk3bdevice/k3btoc.h +++ b/libk3bdevice/k3btoc.h @@ -17,14 +17,14 @@ #ifndef K3BTOC_H #define K3BTOC_H -#include -#include +#include +#include #include #include "k3btrack.h" #include "k3bdevice_export.h" -class QString; +class TQString; namespace K3bDevice { @@ -42,7 +42,7 @@ namespace K3bDevice * The Toc deletes all its tracks when it is deleted and * deletes removed tracks. */ - class LIBK3BDEVICE_EXPORT Toc : public QValueList + class LIBK3BDEVICE_EXPORT Toc : public TQValueList { public: Toc(); @@ -58,7 +58,7 @@ namespace K3bDevice */ unsigned int discId() const; - const QCString& mcn() const { return m_mcn; } + const TQCString& mcn() const { return m_mcn; } /** * determine the contents type based on the tracks' types. @@ -81,7 +81,7 @@ namespace K3bDevice void setFirstSector( int i ) { m_firstSector = i; } - void setMcn( const QCString& mcn ) { m_mcn = mcn; } + void setMcn( const TQCString& mcn ) { m_mcn = mcn; } void clear(); @@ -94,7 +94,7 @@ namespace K3bDevice unsigned int m_discId; K3b::Msf m_firstSector; - QCString m_mcn; + TQCString m_mcn; }; } diff --git a/libk3bdevice/k3btrack.h b/libk3bdevice/k3btrack.h index f68cc86..7e42b03 100644 --- a/libk3bdevice/k3btrack.h +++ b/libk3bdevice/k3btrack.h @@ -18,8 +18,8 @@ #ifndef K3BTRACK_H #define K3BTRACK_H -#include -#include +#include +#include #include #include "k3bdevice_export.h" @@ -75,8 +75,8 @@ namespace K3bDevice bool recordedIncremental() const { return m_preEmphasis; } bool recordedUninterrupted() const { return !recordedIncremental(); } - const QCString& isrc() const { return m_isrc; } - void setIsrc( const QCString& s ) { m_isrc = s; } + const TQCString& isrc() const { return m_isrc; } + void setIsrc( const TQCString& s ) { m_isrc = s; } const K3b::Msf& firstSector() const { return m_firstSector; } const K3b::Msf& lastSector() const { return m_lastSector; } @@ -120,7 +120,7 @@ namespace K3bDevice * All indices. Normally this list is empty as indices are rarely used. * Starts with index 2 (since index 1 are all other sectors FIXME) */ - const QValueVector& indices() const { return m_indices; } + const TQValueVector& indices() const { return m_indices; } bool operator==( const Track& ) const; bool operator!=( const Track& ) const; @@ -140,9 +140,9 @@ namespace K3bDevice int m_session; - QValueVector m_indices; + TQValueVector m_indices; - QCString m_isrc; + TQCString m_isrc; }; } -- cgit v1.2.3