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 --- src/k3bmediacache.cpp | 54 +++++++++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) (limited to 'src/k3bmediacache.cpp') diff --git a/src/k3bmediacache.cpp b/src/k3bmediacache.cpp index fa9f51b..98eac9f 100644 --- a/src/k3bmediacache.cpp +++ b/src/k3bmediacache.cpp @@ -25,22 +25,22 @@ #include #include -#include -#include -#include +#include +#include +#include // //////////////////////////////////////////////////////////////////////////////// // MEDIA CACHE SUPPORT CLASSES // //////////////////////////////////////////////////////////////////////////////// -class K3bMediaCache::MediaChangeEvent : public QCustomEvent +class K3bMediaCache::MediaChangeEvent : public TQCustomEvent { public: static const int EventCode; MediaChangeEvent( K3bDevice::Device* dev ) - : QCustomEvent( EventCode ), + : TQCustomEvent( EventCode ), m_device( dev ) {} K3bDevice::Device* device() const { return m_device; } @@ -49,7 +49,7 @@ private: K3bDevice::Device* m_device; }; -const int K3bMediaCache::MediaChangeEvent::EventCode = QEvent::User + 22; +const int K3bMediaCache::MediaChangeEvent::EventCode = TQEvent::User + 22; class K3bMediaCache::DeviceEntry @@ -62,7 +62,7 @@ public: int blockedId; - QMutex mutex; + TQMutex mutex; K3bMediaCache::PollThread* thread; @@ -74,7 +74,7 @@ public: }; -class K3bMediaCache::PollThread : public QThread +class K3bMediaCache::PollThread : public TQThread { public: PollThread( K3bMediaCache::DeviceEntry* de ) @@ -140,7 +140,7 @@ void K3bMediaCache::PollThread::run() // inform the media cache about the media change // if( m_deviceEntry->blockedId == 0 ) - QApplication::postEvent( m_deviceEntry->cache, + TQApplication::postEvent( m_deviceEntry->cache, new K3bMediaCache::MediaChangeEvent( m_deviceEntry->medium.device() ) ); // the information is valid. let the info go. @@ -148,7 +148,7 @@ void K3bMediaCache::PollThread::run() } if( m_deviceEntry->blockedId == 0 ) - QThread::sleep( 2 ); + TQThread::sleep( 2 ); } } @@ -161,8 +161,8 @@ void K3bMediaCache::PollThread::run() // //////////////////////////////////////////////////////////////////////////////// -K3bMediaCache::K3bMediaCache( QObject* parent ) - : QObject( parent ) +K3bMediaCache::K3bMediaCache( TQObject* tqparent ) + : TQObject( tqparent ) { } @@ -282,26 +282,26 @@ K3bDevice::CdText K3bMediaCache::cdText( K3bDevice::Device* dev ) } -QValueList K3bMediaCache::writingSpeeds( K3bDevice::Device* dev ) +TQValueList K3bMediaCache::writingSpeeds( K3bDevice::Device* dev ) { if( DeviceEntry* e = findDeviceEntry( dev ) ) { e->mutex.lock(); - QValueList ws = e->medium.writingSpeeds(); + TQValueList ws = e->medium.writingSpeeds(); e->mutex.unlock(); return ws; } else - return QValueList(); + return TQValueList(); } -QString K3bMediaCache::mediumString( K3bDevice::Device* device, bool useContent ) +TQString K3bMediaCache::mediumString( K3bDevice::Device* device, bool useContent ) { if( DeviceEntry* e = findDeviceEntry( device ) ) { return e->medium.shortString( useContent ); } else - return QString::null; + return TQString(); } @@ -310,13 +310,13 @@ void K3bMediaCache::clearDeviceList() kdDebug() << k_funcinfo << endl; // make all the threads stop - for( QMap::iterator it = m_deviceMap.begin(); + for( TQMap::iterator it = m_deviceMap.begin(); it != m_deviceMap.end(); ++it ) { it.data()->blockedId = 1; } // and remove them - for( QMap::iterator it = m_deviceMap.begin(); + for( TQMap::iterator it = m_deviceMap.begin(); it != m_deviceMap.end(); ++it ) { kdDebug() << k_funcinfo << " waiting for info thread " << it.key()->blockDeviceName() << " to finish" << endl; it.data()->thread->wait(); @@ -330,23 +330,23 @@ void K3bMediaCache::clearDeviceList() void K3bMediaCache::buildDeviceList( K3bDevice::DeviceManager* dm ) { // remember blocked ids - QMap blockedIds; - for( QMap::iterator it = m_deviceMap.begin(); + TQMap blockedIds; + for( TQMap::iterator it = m_deviceMap.begin(); it != m_deviceMap.end(); ++it ) blockedIds.insert( it.key(), it.data()->blockedId ); clearDeviceList(); - const QPtrList& devices = dm->allDevices(); - for( QPtrListIterator it( devices ); *it; ++it ) { + const TQPtrList& devices = dm->allDevices(); + for( TQPtrListIterator it( devices ); *it; ++it ) { m_deviceMap.insert( *it, new DeviceEntry( this, *it ) ); - QMap::const_iterator bi_it = blockedIds.find( *it ); + TQMap::const_iterator bi_it = blockedIds.tqfind( *it ); if( bi_it != blockedIds.end() ) m_deviceMap[*it]->blockedId = bi_it.data(); } // start all the polling threads - for( QMap::iterator it = m_deviceMap.begin(); + for( TQMap::iterator it = m_deviceMap.begin(); it != m_deviceMap.end(); ++it ) { if( !it.data()->blockedId ) it.data()->thread->start(); @@ -356,7 +356,7 @@ void K3bMediaCache::buildDeviceList( K3bDevice::DeviceManager* dm ) K3bMediaCache::DeviceEntry* K3bMediaCache::findDeviceEntry( K3bDevice::Device* dev ) { - QMap::iterator it = m_deviceMap.find( dev ); + TQMap::iterator it = m_deviceMap.tqfind( dev ); if( it != m_deviceMap.end() ) return it.data(); else @@ -364,7 +364,7 @@ K3bMediaCache::DeviceEntry* K3bMediaCache::findDeviceEntry( K3bDevice::Device* d } -void K3bMediaCache::customEvent( QCustomEvent* e ) +void K3bMediaCache::customEvent( TQCustomEvent* e ) { if( e->type() == MediaChangeEvent::EventCode ) emit mediumChanged( static_cast( e )->device() ); -- cgit v1.2.3