diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-08-20 06:53:52 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-08-20 06:53:52 +0000 |
commit | 3a09386ad170dafdce88c5dcd70275cc7d4081e9 (patch) | |
tree | 0f9544da38cdb9c5cc20ad9d695588413b4cd5f9 /amarok/src/mediadevice | |
parent | 36a9c1916513474b11c59a9060cbaf8770d1bbc0 (diff) | |
download | amarok-3a09386ad170dafdce88c5dcd70275cc7d4081e9.tar.gz amarok-3a09386ad170dafdce88c5dcd70275cc7d4081e9.zip |
Initial TQt conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/amarok@1165727 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'amarok/src/mediadevice')
27 files changed, 900 insertions, 900 deletions
diff --git a/amarok/src/mediadevice/daap/daapclient.cpp b/amarok/src/mediadevice/daap/daapclient.cpp index 1a08c893..ace95233 100644 --- a/amarok/src/mediadevice/daap/daapclient.cpp +++ b/amarok/src/mediadevice/daap/daapclient.cpp @@ -30,13 +30,13 @@ #include "statusbar/statusbar.h" #include "tagdialog.h" -#include <qcheckbox.h> -#include <qmetaobject.h> -#include <qobjectlist.h> -#include <qlabel.h> -#include <qpixmap.h> -#include <qtimer.h> -#include <qtooltip.h> +#include <tqcheckbox.h> +#include <tqmetaobject.h> +#include <tqobjectlist.h> +#include <tqlabel.h> +#include <tqpixmap.h> +#include <tqtimer.h> +#include <tqtooltip.h> #include <kiconloader.h> #include <klineedit.h> @@ -90,10 +90,10 @@ DEBUG_BLOCK i18n("Share My Music") ); m_broadcastButton->setToggle( true ); - QToolTip::add( customButton, i18n( "List music from a remote host" ) ); - QToolTip::add( m_broadcastButton, i18n( "If this button is checked, then your music will be exported to the network" ) ); + TQToolTip::add( customButton, i18n( "List music from a remote host" ) ); + TQToolTip::add( m_broadcastButton, i18n( "If this button is checked, then your music will be exported to the network" ) ); - connect( m_broadcastButton, SIGNAL( toggled(int) ), SLOT( broadcastButtonToggled() ) ); + connect( m_broadcastButton, TQT_SIGNAL( toggled(int) ), TQT_SLOT( broadcastButtonToggled() ) ); MediaBrowser::instance()->insertChild( this ); } @@ -139,20 +139,20 @@ DaapClient::openDevice(bool /* silent=false */) { m_browser = new DNSSD::ServiceBrowser("_daap._tcp"); m_browser->setName("daapServiceBrowser"); - connect( m_browser, SIGNAL( serviceAdded( DNSSD::RemoteService::Ptr ) ), - this, SLOT( foundDaap ( DNSSD::RemoteService::Ptr ) ) ); - connect( m_browser, SIGNAL( serviceRemoved( DNSSD::RemoteService::Ptr ) ), - this, SLOT( serverOffline ( DNSSD::RemoteService::Ptr ) ) ); + connect( m_browser, TQT_SIGNAL( serviceAdded( DNSSD::RemoteService::Ptr ) ), + this, TQT_SLOT( foundDaap ( DNSSD::RemoteService::Ptr ) ) ); + connect( m_browser, TQT_SIGNAL( serviceRemoved( DNSSD::RemoteService::Ptr ) ), + this, TQT_SLOT( serverOffline ( DNSSD::RemoteService::Ptr ) ) ); m_browser->startBrowse(); } #endif - QStringList sl = AmarokConfig::manuallyAddedServers(); + TQStringList sl = AmarokConfig::manuallyAddedServers(); foreach( sl ) { - QStringList current = QStringList::split(":", (*it) ); - QString host = current.first(); + TQStringList current = TQStringList::split(":", (*it) ); + TQString host = current.first(); Q_UINT16 port = current.last().toInt(); - QString ip = resolve( host ); + TQString ip = resolve( host ); if( ip != "0" ) { newHost( host, host, ip, port ); @@ -169,8 +169,8 @@ bool DaapClient::closeDevice() { m_view->clear(); - QObjectList* readers = queryList( "Daap::Reader"); - QObject* itRead; + TQObjectList* readers = queryList( "Daap::Reader"); + TQObject* itRead; for( itRead = readers->first(); itRead; itRead = readers->next() ) { static_cast<Daap::Reader*>(itRead)->logoutRequest(); @@ -223,7 +223,7 @@ DaapClient::deleteItemFromDevice( MediaItem* /*item*/, int /*flags*/ ) } void -DaapClient::rmbPressed( QListViewItem* qitem, const QPoint& point, int ) +DaapClient::rmbPressed( TQListViewItem* qitem, const TQPoint& point, int ) { DEBUG_BLOCK @@ -246,7 +246,7 @@ DaapClient::rmbPressed( QListViewItem* qitem, const QPoint& point, int ) menu.insertItem( SmallIconSet( "remove" ), i18n("&Remove Computer"), REMOVE ); } { - QStringList sl = m_serverItemMap.keys(); + TQStringList sl = m_serverItemMap.keys(); foreach( sl ) { debug() << (*it) << endl; @@ -299,7 +299,7 @@ DaapClient::rmbPressed( QListViewItem* qitem, const QPoint& point, int ) case REMOVE: if( sitem ) { - QStringList mas = AmarokConfig::manuallyAddedServers(); + TQStringList mas = AmarokConfig::manuallyAddedServers(); mas.remove( sitem->key() ); AmarokConfig::setManuallyAddedServers( mas ); delete sitem; @@ -318,7 +318,7 @@ DaapClient::downloadSongs( KURL::List urls ) KURL::List realStreamUrls; KURL::List::Iterator it; for( it = urls.begin(); it != urls.end(); ++it ) - realStreamUrls << Daap::Proxy::realStreamUrl( (*it), getSession( (*it).host() + ':' + QString::number( (*it).port() ) ) ); + realStreamUrls << Daap::Proxy::realStreamUrl( (*it), getSession( (*it).host() + ':' + TQString::number( (*it).port() ) ) ); ThreadManager::instance()->queueJob( new DaapDownloader( realStreamUrls ) ); } @@ -327,7 +327,7 @@ DaapClient::serverOffline( DNSSD::RemoteService::Ptr service ) { #if DNSSD_SUPPORT DEBUG_BLOCK - QString key = serverKey( service.data() ); + TQString key = serverKey( service.data() ); if( m_serverItemMap.contains( key ) ) { ServerItem* removeMe = m_serverItemMap[ key ]; @@ -359,7 +359,7 @@ DaapClient::foundDaap( DNSSD::RemoteService::Ptr service ) #if DNSSD_SUPPORT DEBUG_BLOCK - connect( service, SIGNAL( resolved( bool ) ), this, SLOT( resolvedDaap( bool ) ) ); + connect( service, TQT_SIGNAL( resolved( bool ) ), this, TQT_SLOT( resolvedDaap( bool ) ) ); service->resolveAsync(); #endif } @@ -373,7 +373,7 @@ DaapClient::resolvedDaap( bool success ) if( !success || !service ) return; debug() << service->serviceName() << ' ' << service->hostName() << ' ' << service->domain() << ' ' << service->type() << endl; - QString ip = resolve( service->hostName() ); + TQString ip = resolve( service->hostName() ); if( ip == "0" || m_serverItemMap.contains(serverKey( service )) ) //same server from multiple interfaces return; @@ -382,7 +382,7 @@ DaapClient::resolvedDaap( bool success ) } void -DaapClient::createTree( const QString& /*host*/, Daap::SongList bundles ) +DaapClient::createTree( const TQString& /*host*/, Daap::SongList bundles ) { DEBUG_BLOCK const Daap::Reader* callback = dynamic_cast<const Daap::Reader*>(sender()); @@ -393,14 +393,14 @@ DaapClient::createTree( const QString& /*host*/, Daap::SongList bundles ) } { - const QString hostKey = callback->name(); + const TQString hostKey = callback->name(); ServerInfo* si = new ServerInfo(); si->sessionId = callback->sessionId(); m_servers[ hostKey ] = si; } ServerItem* root = callback->rootMediaItem(); - QStringList artists = bundles.keys(); + TQStringList artists = bundles.keys(); foreach( artists ) { MediaItem* parentArtist = new MediaItem( root ); @@ -409,8 +409,8 @@ DaapClient::createTree( const QString& /*host*/, Daap::SongList bundles ) parentArtist->setText( 0, (*albumMap.begin()).getFirst()->artist() ); //map was made case insensitively //just get the displayed-case from //the first track - QStringList albums = albumMap.keys(); - for ( QStringList::Iterator itAlbum = albums.begin(); itAlbum != albums.end(); ++itAlbum ) + TQStringList albums = albumMap.keys(); + for ( TQStringList::Iterator itAlbum = albums.begin(); itAlbum != albums.end(); ++itAlbum ) { MediaItem* parentAlbum = new MediaItem( parentArtist ); parentAlbum->setType( MediaItem::ALBUM ); @@ -441,7 +441,7 @@ DaapClient::createTree( const QString& /*host*/, Daap::SongList bundles ) } int -DaapClient::incRevision( const QString& host ) +DaapClient::incRevision( const TQString& host ) { if( m_servers.contains(host) ) { @@ -453,7 +453,7 @@ DaapClient::incRevision( const QString& host ) } int -DaapClient::getSession( const QString& host ) +DaapClient::getSession( const TQString& host ) { if( m_servers.contains(host) ) return m_servers[host]->sessionId; @@ -468,11 +468,11 @@ DaapClient::customClicked() { public: - AddHostDialog( QWidget *parent ) + AddHostDialog( TQWidget *parent ) : KDialogBase( parent, "DaapAddHostDialog", true, i18n( "Add Computer" ) , Ok|Cancel) { m_base = new AddHostBase( this, "DaapAddHostBase" ); - m_base->m_downloadPixmap->setPixmap( QPixmap( KGlobal::iconLoader()->iconPath( Amarok::icon( "download" ), -KIcon::SizeEnormous ) ) ); + m_base->m_downloadPixmap->setPixmap( TQPixmap( KGlobal::iconLoader()->iconPath( Amarok::icon( "download" ), -KIcon::SizeEnormous ) ) ); m_base->m_hostName->setFocus(); setMainWidget( m_base ); } @@ -480,16 +480,16 @@ DaapClient::customClicked() }; AddHostDialog dialog( 0 ); - if( dialog.exec() == QDialog::Accepted ) { - QString ip = resolve( dialog.m_base->m_hostName->text() ); + if( dialog.exec() == TQDialog::Accepted ) { + TQString ip = resolve( dialog.m_base->m_hostName->text() ); if( ip == "0" ) Amarok::StatusBar::instance()->shortMessage( i18n("Could not resolve %1.").arg( dialog.m_base->m_hostName->text() ) ); else { - QString key = ServerItem::key( dialog.m_base->m_hostName->text(), dialog.m_base->m_portInput->value() ); + TQString key = ServerItem::key( dialog.m_base->m_hostName->text(), dialog.m_base->m_portInput->value() ); if( !AmarokConfig::manuallyAddedServers().contains( key ) ) { - QStringList mas = AmarokConfig::manuallyAddedServers(); + TQStringList mas = AmarokConfig::manuallyAddedServers(); mas.append( key ); AmarokConfig::setManuallyAddedServers( mas ); } @@ -499,7 +499,7 @@ DaapClient::customClicked() } ServerItem* -DaapClient::newHost( const QString& serviceName, const QString& host, const QString& ip, const Q_INT16 port ) +DaapClient::newHost( const TQString& serviceName, const TQString& host, const TQString& ip, const Q_INT16 port ) { if( ip.isEmpty() ) return 0; @@ -512,7 +512,7 @@ DaapClient::passwordPrompt() class PasswordDialog : public KDialogBase { public: - PasswordDialog( QWidget *parent ) + PasswordDialog( TQWidget *parent ) : KDialogBase( parent, "PasswordDialog", true, i18n( "Password Required" ) , Ok|Cancel) { makeHBoxMainWidget(); @@ -522,17 +522,17 @@ DaapClient::passwordPrompt() ok.setToolTip( i18n("Login to the music share with the password given.") ); setButtonOK( ok ); - QLabel* passIcon = new QLabel( mainWidget(), "passicon" ); - passIcon->setPixmap( QPixmap( KGlobal::iconLoader()->iconPath( "password", -KIcon::SizeHuge ) ) ); - QHBox* loginArea = new QHBox( mainWidget(), "passhbox" ); - new QLabel( i18n( "Password:"), loginArea, "passlabel" ); + TQLabel* passIcon = new TQLabel( mainWidget(), "passicon" ); + passIcon->setPixmap( TQPixmap( KGlobal::iconLoader()->iconPath( "password", -KIcon::SizeHuge ) ) ); + TQHBox* loginArea = new TQHBox( mainWidget(), "passhbox" ); + new TQLabel( i18n( "Password:"), loginArea, "passlabel" ); m_input = new KPasswordEdit( loginArea, "passedit" ); m_input->setFocus(); } KPasswordEdit* m_input; }; - Daap::Reader* callback = dynamic_cast<Daap::Reader*>( const_cast<QObject*>( sender() ) ); + Daap::Reader* callback = dynamic_cast<Daap::Reader*>( const_cast<TQObject*>( sender() ) ); if (!callback) { debug() << "No callback!" << endl; return; @@ -540,14 +540,14 @@ DaapClient::passwordPrompt() ServerItem* root = callback->rootMediaItem(); PasswordDialog dialog( 0 ); - if( dialog.exec() == QDialog::Accepted ) + if( dialog.exec() == TQDialog::Accepted ) { - Daap::Reader* reader = new Daap::Reader( callback->host(), callback->port(), root, QString( dialog.m_input->password() ), this, callback->name() ); + Daap::Reader* reader = new Daap::Reader( callback->host(), callback->port(), root, TQString( dialog.m_input->password() ), this, callback->name() ); root->setReader( reader ); - connect( reader, SIGNAL( daapBundles( const QString&, Daap::SongList ) ), - this, SLOT( createTree( const QString&, Daap::SongList ) ) ); - connect( reader, SIGNAL( passwordRequired() ), this, SLOT( passwordPrompt() ) ); - connect( reader, SIGNAL( httpError( const QString& ) ), root, SLOT( httpError( const QString& ) ) ); + connect( reader, TQT_SIGNAL( daapBundles( const TQString&, Daap::SongList ) ), + this, TQT_SLOT( createTree( const TQString&, Daap::SongList ) ) ); + connect( reader, TQT_SIGNAL( passwordRequired() ), this, TQT_SLOT( passwordPrompt() ) ); + connect( reader, TQT_SIGNAL( httpError( const TQString& ) ), root, TQT_SLOT( httpError( const TQString& ) ) ); reader->loginRequest(); } else @@ -560,7 +560,7 @@ DaapClient::passwordPrompt() } QString -DaapClient::resolve( const QString& hostname ) +DaapClient::resolve( const TQString& hostname ) { KNetwork::KResolver resolver( hostname ); resolver.setFamily( KNetwork::KResolver::KnownFamily ); //A druidic incantation from Thiago. Works around a KResolver bug #132851 @@ -573,7 +573,7 @@ DaapClient::resolve( const QString& hostname ) << resolver.errorString( results.error() ) << ")" << endl; if( !results.empty() ) { - QString ip = results[0].address().asInet().ipAddress().toString(); + TQString ip = results[0].address().asInet().ipAddress().toString(); debug() << "ip found is " << ip << endl; return ip; } @@ -592,7 +592,7 @@ DaapClient::trackExistsInCollection( MetaBundle *bundle ) qb.addReturnFunctionValue( QueryBuilder::funcCount, QueryBuilder::tabSong, QueryBuilder::valURL ); - QStringList values = qb.run(); + TQStringList values = qb.run(); return ( values[0].toInt() > 0 ); } @@ -601,20 +601,20 @@ DaapClient::trackExistsInCollection( MetaBundle *bundle ) /// Configuration Dialog Extension void -DaapClient::addConfigElements( QWidget * parent ) +DaapClient::addConfigElements( TQWidget * parent ) { - m_broadcastServerCheckBox = new QCheckBox( "Broadcast my music", parent ); + m_broadcastServerCheckBox = new TQCheckBox( "Broadcast my music", parent ); m_broadcastServerCheckBox->setChecked( m_broadcastServer ); - m_removeDuplicatesCheckBox = new QCheckBox( "Hide songs in my collection", parent ); + m_removeDuplicatesCheckBox = new TQCheckBox( "Hide songs in my collection", parent ); m_removeDuplicatesCheckBox->setChecked( m_removeDuplicates ); - QToolTip::add( m_removeDuplicatesCheckBox, i18n( "Enabling this may reduce connection times" ) ); + TQToolTip::add( m_removeDuplicatesCheckBox, i18n( "Enabling this may reduce connection times" ) ); } void -DaapClient::removeConfigElements( QWidget * /* parent */ ) +DaapClient::removeConfigElements( TQWidget * /* parent */ ) { if( m_broadcastServerCheckBox != 0 ) delete m_broadcastServerCheckBox; @@ -680,7 +680,7 @@ DEBUG_BLOCK // CLASS ServerItem //////////////////////////////////////////////////////////////////////////////// -ServerItem::ServerItem( QListView* parent, DaapClient* client, const QString& ip, Q_UINT16 port, const QString& title, const QString& host ) +ServerItem::ServerItem( TQListView* parent, DaapClient* client, const TQString& ip, Q_UINT16 port, const TQString& title, const TQString& host ) : MediaItem( parent ) , m_daapClient( client ) , m_reader( 0 ) @@ -689,8 +689,8 @@ ServerItem::ServerItem( QListView* parent, DaapClient* client, const QString& ip , m_title( title ) , m_host( host ) , m_loaded( false ) - , m_loading1( new QPixmap( locate("data", "amarok/images/loading1.png" ) ) ) - , m_loading2( new QPixmap( locate("data", "amarok/images/loading2.png" ) ) ) + , m_loading1( new TQPixmap( locate("data", "amarok/images/loading1.png" ) ) ) + , m_loading2( new TQPixmap( locate("data", "amarok/images/loading2.png" ) ) ) { setText( 0, title ); setType( MediaItem::DIRECTORY ); @@ -710,8 +710,8 @@ ServerItem::reset() m_loaded = 0; - QListViewItem *c = firstChild(); - QListViewItem *n; + TQListViewItem *c = firstChild(); + TQListViewItem *n; while( c ) { n = c->nextSibling(); delete c; @@ -733,18 +733,18 @@ ServerItem::setOpen( bool o ) //starts loading animation m_iconCounter = 1; startAnimation(); - connect( &m_animationTimer, SIGNAL(timeout()), this, SLOT(slotAnimation()) ); + connect( &m_animationTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotAnimation()) ); setText( 0, i18n( "Loading %1").arg( text( 0 ) ) ); Daap::Reader* reader = new Daap::Reader( m_ip, m_port, this, - QString::null, m_daapClient, ( m_ip + ":3689" ).ascii() ); + TQString::null, m_daapClient, ( m_ip + ":3689" ).ascii() ); setReader ( reader ); - connect( reader, SIGNAL( daapBundles( const QString&, Daap::SongList ) ), - m_daapClient, SLOT( createTree( const QString&, Daap::SongList ) ) ); - connect( reader, SIGNAL( passwordRequired() ), m_daapClient, SLOT( passwordPrompt() ) ); - connect( reader, SIGNAL( httpError( const QString& ) ), this, SLOT( httpError( const QString& ) ) ); + connect( reader, TQT_SIGNAL( daapBundles( const TQString&, Daap::SongList ) ), + m_daapClient, TQT_SLOT( createTree( const TQString&, Daap::SongList ) ) ); + connect( reader, TQT_SIGNAL( passwordRequired() ), m_daapClient, TQT_SLOT( passwordPrompt() ) ); + connect( reader, TQT_SIGNAL( httpError( const TQString& ) ), this, TQT_SLOT( httpError( const TQString& ) ) ); reader->loginRequest(); m_loaded = true; } @@ -777,7 +777,7 @@ ServerItem::slotAnimation() } void -ServerItem::httpError( const QString& errorString ) +ServerItem::httpError( const TQString& errorString ) { stopAnimation(); resetTitle(); @@ -805,16 +805,16 @@ DaapDownloader::doJob() { DEBUG_BLOCK KURL::List::iterator urlIt = m_urls.begin(); - Daap::ContentFetcher* http = new Daap::ContentFetcher( (*urlIt).host(), (*urlIt).port(), QString(), this ); - connect( http, SIGNAL( requestFinished( int, bool ) ), this, SLOT( downloadFinished( int, bool ) ) ); - connect( http, SIGNAL( dataReadProgress( int, int ) ), this, SLOT( dataReadProgress( int, int ) ) ); - connect( http, SIGNAL( httpError( const QString& ) ), this, SLOT( downloadFailed( const QString& ) ) ); + Daap::ContentFetcher* http = new Daap::ContentFetcher( (*urlIt).host(), (*urlIt).port(), TQString(), this ); + connect( http, TQT_SIGNAL( requestFinished( int, bool ) ), this, TQT_SLOT( downloadFinished( int, bool ) ) ); + connect( http, TQT_SIGNAL( dataReadProgress( int, int ) ), this, TQT_SLOT( dataReadProgress( int, int ) ) ); + connect( http, TQT_SIGNAL( httpError( const TQString& ) ), this, TQT_SLOT( downloadFailed( const TQString& ) ) ); while( !isAborted() && !m_errorOccured && urlIt != m_urls.end() ) { m_ready = false; debug() << "downloading " << (*urlIt).path() << endl; setProgressTotalSteps( 100 ); - KTempFile* tempNewFile = new KTempFile( QString(), '.' + QFileInfo( (*urlIt).path() ).extension() ); + KTempFile* tempNewFile = new KTempFile( TQString(), '.' + TQFileInfo( (*urlIt).path() ).extension() ); tempNewFile->setAutoDelete( true ); m_tempFileList.append( tempNewFile ); http->getDaap( (*urlIt).path() + (*urlIt).query(), tempNewFile->file() ); @@ -847,13 +847,13 @@ DaapDownloader::completeJob() DEBUG_BLOCK KURL path; KURL::List tempUrlList; - for( QValueList<KTempFile*>::Iterator itTemps = m_tempFileList.begin(); itTemps != m_tempFileList.end(); ++itTemps ) + for( TQValueList<KTempFile*>::Iterator itTemps = m_tempFileList.begin(); itTemps != m_tempFileList.end(); ++itTemps ) { path.setPath( (*itTemps)->name() ); tempUrlList << path; } CollectionView::instance()->organizeFiles( tempUrlList, i18n( "Copy Files To Collection" ), false ); - for( QValueList<KTempFile*>::Iterator itTemps = m_tempFileList.begin(); itTemps != m_tempFileList.end(); ++itTemps ) + for( TQValueList<KTempFile*>::Iterator itTemps = m_tempFileList.begin(); itTemps != m_tempFileList.end(); ++itTemps ) delete (*itTemps); //autodelete is true, so file is unlinked now m_tempFileList.clear(); } @@ -865,7 +865,7 @@ DaapDownloader::dataReadProgress( int done, int total ) } void -DaapDownloader::downloadFailed( const QString & error ) +DaapDownloader::downloadFailed( const TQString & error ) { // Amarok::StatusBar::instance()->longMessageThreadSafe( i18n( "An error occured while downloading from remote music server." ), Amarok::StatusBar::Error ); DEBUG_BLOCK diff --git a/amarok/src/mediadevice/daap/daapclient.h b/amarok/src/mediadevice/daap/daapclient.h index c3475de7..15dfe24c 100644 --- a/amarok/src/mediadevice/daap/daapclient.h +++ b/amarok/src/mediadevice/daap/daapclient.h @@ -45,9 +45,9 @@ class DaapServer; class KURL; -class QCheckBox; -class QString; -class QTimer; +class TQCheckBox; +class TQString; +class TQTimer; class DaapClient : public MediaDevice { @@ -65,14 +65,14 @@ class DaapClient : public MediaDevice bool isConnected(); virtual bool needsManualConfig() { return true; } - virtual void addConfigElements ( QWidget * /*parent*/ ); - virtual void removeConfigElements( QWidget * /*parent*/ ); + virtual void addConfigElements ( TQWidget * /*parent*/ ); + virtual void removeConfigElements( TQWidget * /*parent*/ ); virtual void applyConfig(); virtual void loadConfig(); - int incRevision( const QString& host ); - int getSession( const QString& host ); + int incRevision( const TQString& host ); + int getSession( const TQString& host ); KURL getProxyUrl( const KURL& url ); void customClicked(); bool autoConnect() { return true; } @@ -82,7 +82,7 @@ class DaapClient : public MediaDevice protected: bool getCapacity( KIO::filesize_t *total, KIO::filesize_t *available ); - void rmbPressed( QListViewItem* qitem, const QPoint& point, int ); + void rmbPressed( TQListViewItem* qitem, const TQPoint& point, int ); bool lockDevice( bool tryOnly = false ); void unlockDevice(); bool openDevice( bool silent=false ); @@ -96,27 +96,27 @@ class DaapClient : public MediaDevice void serverOffline( DNSSD::RemoteService::Ptr ); void foundDaap( DNSSD::RemoteService::Ptr ); void resolvedDaap( bool ); - void createTree( const QString& host, Daap::SongList bundles ); + void createTree( const TQString& host, Daap::SongList bundles ); void broadcastButtonToggled(); private: - ServerItem* newHost( const QString& serviceName, const QString& host, const QString& ip, const Q_INT16 port ); + ServerItem* newHost( const TQString& serviceName, const TQString& host, const TQString& ip, const Q_INT16 port ); void downloadSongs( KURL::List urls ); - QString resolve( const QString& hostname ); + TQString resolve( const TQString& hostname ); #if DNSSD_SUPPORT - QString serverKey( const DNSSD::RemoteService* service ) const; + TQString serverKey( const DNSSD::RemoteService* service ) const; DNSSD::ServiceBrowser* m_browser; #endif /// @return true if track is already in the local collection const bool trackExistsInCollection( MetaBundle *bundle ); bool m_connected; - QMap<QString, ServerInfo*> m_servers; - QMap<QString, ServerItem*> m_serverItemMap; + TQMap<TQString, ServerInfo*> m_servers; + TQMap<TQString, ServerItem*> m_serverItemMap; DaapServer *m_sharingServer; - QCheckBox *m_broadcastServerCheckBox; - QCheckBox *m_removeDuplicatesCheckBox; + TQCheckBox *m_broadcastServerCheckBox; + TQCheckBox *m_removeDuplicatesCheckBox; bool m_broadcastServer; bool m_removeDuplicates; KToolBarButton *m_broadcastButton; @@ -125,12 +125,12 @@ class DaapClient : public MediaDevice bool m_hideMusicOwned; }; -class ServerItem : public QObject, public MediaItem +class ServerItem : public TQObject, public MediaItem { Q_OBJECT public: - ServerItem( QListView* parent, DaapClient* client, const QString& ip, Q_UINT16 port, const QString& title, const QString& host ); + ServerItem( TQListView* parent, DaapClient* client, const TQString& ip, Q_UINT16 port, const TQString& title, const TQString& host ); ~ServerItem(); void setOpen( bool o ); void resetTitle() { setText( 0, m_title ); } @@ -141,25 +141,25 @@ class ServerItem : public QObject, public MediaItem void startAnimation(); void stopAnimation(); - QString key() const { return key( m_host, m_port ); } + TQString key() const { return key( m_host, m_port ); } void reset(); - static QString key( const QString& host, Q_UINT16 port ) { return host + ':' + QString::number( port ); } + static TQString key( const TQString& host, Q_UINT16 port ) { return host + ':' + TQString::number( port ); } public slots: - void httpError( const QString& ); + void httpError( const TQString& ); private slots: void slotAnimation(); private: DaapClient *m_daapClient; Daap::Reader *m_reader; - const QString m_ip; + const TQString m_ip; const Q_UINT16 m_port; - const QString m_title; - const QString m_host; + const TQString m_title; + const TQString m_host; bool m_loaded; - QPixmap *m_loading1, *m_loading2; //icons for loading animation - QTimer m_animationTimer; + TQPixmap *m_loading1, *m_loading2; //icons for loading animation + TQTimer m_animationTimer; uint m_iconCounter; static const int ANIMATION_INTERVAL = 250; @@ -178,11 +178,11 @@ public: private slots: void downloadFinished( int id, bool error ); void dataReadProgress( int done, int total ); - void downloadFailed( const QString &error ); + void downloadFailed( const TQString &error ); private: KURL::List m_urls; - QValueList<KTempFile*> m_tempFileList; + TQValueList<KTempFile*> m_tempFileList; bool m_ready; bool m_successful; bool m_errorOccured; diff --git a/amarok/src/mediadevice/daap/daapreader/authentication/contentfetcher.cpp b/amarok/src/mediadevice/daap/daapreader/authentication/contentfetcher.cpp index ced4c825..56b8874e 100644 --- a/amarok/src/mediadevice/daap/daapreader/authentication/contentfetcher.cpp +++ b/amarok/src/mediadevice/daap/daapreader/authentication/contentfetcher.cpp @@ -15,10 +15,10 @@ #include "debug.h" #include "hasher.h" -#include <qbuffer.h> -#include <qsocket.h> -#include <qdatastream.h> -#include <qhttp.h> +#include <tqbuffer.h> +#include <tqsocket.h> +#include <tqdatastream.h> +#include <tqhttp.h> #include <kfilterdev.h> #include <kmdcodec.h> @@ -26,14 +26,14 @@ using namespace Daap; int ContentFetcher::s_requestId = 10; -ContentFetcher::ContentFetcher( const QString & hostname, Q_UINT16 port, const QString& password, QObject * parent, const char * name ) - : QHttp(hostname, port, parent, name) +ContentFetcher::ContentFetcher( const TQString & hostname, Q_UINT16 port, const TQString& password, TQObject * parent, const char * name ) + : TQHttp(hostname, port, parent, name) , m_hostname( hostname ) , m_port( port ) , m_selfDestruct( false ) { - connect( this, SIGNAL( stateChanged( int ) ), this , SLOT( checkForErrors( int ) ) ); - QCString pass = password.utf8(); + connect( this, TQT_SIGNAL( stateChanged( int ) ), this , TQT_SLOT( checkForErrors( int ) ) ); + TQCString pass = password.utf8(); if( !password.isNull() ) { m_authorize = "Basic " + KCodecs::base64Encode( "none:" + pass ); @@ -43,20 +43,20 @@ ContentFetcher::ContentFetcher( const QString & hostname, Q_UINT16 port, const Q ContentFetcher::~ContentFetcher() { } -QDataStream& +TQDataStream& ContentFetcher::results() { - QBuffer* bytes = new QBuffer( readAll() ); - QIODevice* stream = KFilterDev::device( bytes, "application/x-gzip", false ); + TQBuffer* bytes = new TQBuffer( readAll() ); + TQIODevice* stream = KFilterDev::device( bytes, "application/x-gzip", false ); stream->open( IO_ReadOnly ); - QDataStream* ds = new QDataStream( stream ); + TQDataStream* ds = new TQDataStream( stream ); return *ds; } void -ContentFetcher::getDaap( const QString & command, QIODevice* musicFile /*= 0*/ ) +ContentFetcher::getDaap( const TQString & command, TQIODevice* musicFile /*= 0*/ ) { - QHttpRequestHeader header( "GET", command ); + TQHttpRequestHeader header( "GET", command ); char hash[33] = {0}; GenerateHash(3, reinterpret_cast<const unsigned char*>(command.ascii()), 2, reinterpret_cast<unsigned char*>(hash), 0 /*s_requestId*/); @@ -65,8 +65,8 @@ ContentFetcher::getDaap( const QString & command, QIODevice* musicFile /*= 0*/ ) header.setValue( "Authorization", m_authorize ); } - header.setValue( "Host", m_hostname + QString::number( m_port ) ); - header.setValue( "Client-DAAP-Request-ID", "0"/*QString::number( s_requestId )*/ ); + header.setValue( "Host", m_hostname + TQString::number( m_port ) ); + header.setValue( "Client-DAAP-Request-ID", "0"/*TQString::number( s_requestId )*/ ); header.setValue( "Client-DAAP-Access-Index", "2" ); header.setValue( "Client-DAAP-Validation", hash ); header.setValue( "Client-DAAP-Version", "3.0" ); @@ -78,7 +78,7 @@ ContentFetcher::getDaap( const QString & command, QIODevice* musicFile /*= 0*/ ) } /** - * QHttp enjoys forgetting to emit a requestFinished when there's an error + * TQHttp enjoys forgetting to emit a requestFinished when there's an error * This gets around that. */ void diff --git a/amarok/src/mediadevice/daap/daapreader/authentication/contentfetcher.h b/amarok/src/mediadevice/daap/daapreader/authentication/contentfetcher.h index bf299a1f..9869063d 100644 --- a/amarok/src/mediadevice/daap/daapreader/authentication/contentfetcher.h +++ b/amarok/src/mediadevice/daap/daapreader/authentication/contentfetcher.h @@ -13,10 +13,10 @@ #ifndef DAAPCONTENTFETCHER_H #define DAAPCONTENTFETCHER_H -#include <qhttp.h> +#include <tqhttp.h> -class QDataStream; -class QFile; +class TQDataStream; +class TQFile; namespace Daap { @@ -30,22 +30,22 @@ class ContentFetcher : public QHttp Q_OBJECT public: - ContentFetcher( const QString & hostname, Q_UINT16 port, const QString& password, QObject * parent = 0, const char * name = 0 ); + ContentFetcher( const TQString & hostname, Q_UINT16 port, const TQString& password, TQObject * parent = 0, const char * name = 0 ); ~ContentFetcher(); - void getDaap( const QString & command, QIODevice* musicFile = 0 ); - QDataStream& results(); + void getDaap( const TQString & command, TQIODevice* musicFile = 0 ); + TQDataStream& results(); private slots: void checkForErrors( int state ); signals: - void httpError( const QString& ); + void httpError( const TQString& ); private: - QString m_hostname; + TQString m_hostname; Q_UINT16 m_port; - QCString m_authorize; + TQCString m_authorize; bool m_selfDestruct; static int s_requestId; //! Apple needs this for some reason }; diff --git a/amarok/src/mediadevice/daap/daapreader/reader.cpp b/amarok/src/mediadevice/daap/daapreader/reader.cpp index 1fbbf9a3..16d86979 100644 --- a/amarok/src/mediadevice/daap/daapreader/reader.cpp +++ b/amarok/src/mediadevice/daap/daapreader/reader.cpp @@ -17,19 +17,19 @@ #include "metabundle.h" #include "qstringx.h" -#include <qcstring.h> -#include <qdatastream.h> -#include <qptrlist.h> -#include <qvaluevector.h> -#include <qvariant.h> +#include <tqcstring.h> +#include <tqdatastream.h> +#include <tqptrlist.h> +#include <tqvaluevector.h> +#include <tqvariant.h> using namespace Daap; -QMap<QString, Code> Reader::s_codes; +TQMap<TQString, Code> Reader::s_codes; -Reader::Reader(const QString& host, Q_UINT16 port, ServerItem* root, const QString& password, QObject* parent, const char* name) - : QObject(parent, name) +Reader::Reader(const TQString& host, Q_UINT16 port, ServerItem* root, const TQString& password, TQObject* parent, const char* name) + : TQObject(parent, name) , m_host( host ) , m_port( port ) , m_sessionId( -1 ) @@ -162,15 +162,15 @@ void Reader::logoutRequest() { ContentFetcher* http = new ContentFetcher( m_host, m_port, m_password, this, "readerLogoutHttp" ); - connect( http, SIGNAL( httpError( const QString& ) ), this, SLOT( fetchingError( const QString& ) ) ); - connect( http, SIGNAL( requestFinished( int, bool ) ), this, SLOT( logoutRequest( int, bool ) ) ); + connect( http, TQT_SIGNAL( httpError( const TQString& ) ), this, TQT_SLOT( fetchingError( const TQString& ) ) ); + connect( http, TQT_SIGNAL( requestFinished( int, bool ) ), this, TQT_SLOT( logoutRequest( int, bool ) ) ); http->getDaap( "/logout?" + m_loginString ); } void Reader::logoutRequest( int, bool ) { - const_cast<QObject*>(sender())->deleteLater(); + const_cast<TQObject*>(sender())->deleteLater(); deleteLater(); } @@ -179,26 +179,26 @@ Reader::loginRequest() { DEBUG_BLOCK ContentFetcher* http = new ContentFetcher( m_host, m_port, m_password, this, "readerHttp"); - connect( http, SIGNAL( httpError( const QString& ) ), this, SLOT( fetchingError( const QString& ) ) ); - connect( http, SIGNAL( responseHeaderReceived( const QHttpResponseHeader & ) ) - , this, SLOT( loginHeaderReceived( const QHttpResponseHeader & ) ) ); + connect( http, TQT_SIGNAL( httpError( const TQString& ) ), this, TQT_SLOT( fetchingError( const TQString& ) ) ); + connect( http, TQT_SIGNAL( responseHeaderReceived( const TQHttpResponseHeader & ) ) + , this, TQT_SLOT( loginHeaderReceived( const TQHttpResponseHeader & ) ) ); http->getDaap( "/login" ); } void -Reader::loginHeaderReceived( const QHttpResponseHeader & resp ) +Reader::loginHeaderReceived( const TQHttpResponseHeader & resp ) { DEBUG_BLOCK ContentFetcher* http = (ContentFetcher*) sender(); - disconnect( http, SIGNAL( responseHeaderReceived( const QHttpResponseHeader & ) ) - , this, SLOT( loginHeaderReceived( const QHttpResponseHeader & ) ) ); + disconnect( http, TQT_SIGNAL( responseHeaderReceived( const TQHttpResponseHeader & ) ) + , this, TQT_SLOT( loginHeaderReceived( const TQHttpResponseHeader & ) ) ); if( resp.statusCode() == 401 /*authorization required*/) { emit passwordRequired(); http->deleteLater(); return; } - connect( http, SIGNAL( requestFinished( int, bool ) ), this, SLOT( loginFinished( int, bool ) ) ); + connect( http, TQT_SIGNAL( requestFinished( int, bool ) ), this, TQT_SLOT( loginFinished( int, bool ) ) ); } @@ -207,7 +207,7 @@ Reader::loginFinished( int /* id */, bool error ) { DEBUG_BLOCK ContentFetcher* http = (ContentFetcher*) sender(); - disconnect( http, SIGNAL( requestFinished( int, bool ) ), this, SLOT( loginFinished( int, bool ) ) ); + disconnect( http, TQT_SIGNAL( requestFinished( int, bool ) ), this, TQT_SLOT( loginFinished( int, bool ) ) ); if( error ) { http->deleteLater(); @@ -216,8 +216,8 @@ Reader::loginFinished( int /* id */, bool error ) Map loginResults = parse( http->results() , 0 ,true ); m_sessionId = loginResults["mlog"].asList()[0].asMap()["mlid"].asList()[0].asInt(); - m_loginString = "session-id=" + QString::number( m_sessionId ); - connect( http, SIGNAL( requestFinished( int, bool ) ), this, SLOT( updateFinished( int, bool ) ) ); + m_loginString = "session-id=" + TQString::number( m_sessionId ); + connect( http, TQT_SIGNAL( requestFinished( int, bool ) ), this, TQT_SLOT( updateFinished( int, bool ) ) ); http->getDaap( "/update?" + m_loginString ); } @@ -226,7 +226,7 @@ Reader::updateFinished( int /*id*/, bool error ) { DEBUG_BLOCK ContentFetcher* http = (ContentFetcher*) sender(); - disconnect( http, SIGNAL( requestFinished( int, bool ) ), this, SLOT( updateFinished( int, bool ) ) ); + disconnect( http, TQT_SIGNAL( requestFinished( int, bool ) ), this, TQT_SLOT( updateFinished( int, bool ) ) ); if( error ) { http->deleteLater(); @@ -236,9 +236,9 @@ Reader::updateFinished( int /*id*/, bool error ) Map updateResults = parse( http->results(), 0, true ); m_loginString = m_loginString + "&revision-number=" + - QString::number( updateResults["mupd"].asList()[0].asMap()["musr"].asList()[0].asInt() ); + TQString::number( updateResults["mupd"].asList()[0].asMap()["musr"].asList()[0].asInt() ); - connect( http, SIGNAL( requestFinished( int, bool ) ), this, SLOT( databaseIdFinished( int, bool ) ) ); + connect( http, TQT_SIGNAL( requestFinished( int, bool ) ), this, TQT_SLOT( databaseIdFinished( int, bool ) ) ); http->getDaap( "/databases?" + m_loginString ); } @@ -247,7 +247,7 @@ void Reader::databaseIdFinished( int /*id*/, bool error ) { ContentFetcher* http = (ContentFetcher*) sender(); - disconnect( http, SIGNAL( requestFinished( int, bool ) ), this, SLOT( databaseIdFinished( int, bool ) ) ); + disconnect( http, TQT_SIGNAL( requestFinished( int, bool ) ), this, TQT_SLOT( databaseIdFinished( int, bool ) ) ); if( error ) { http->deleteLater(); @@ -255,9 +255,9 @@ Reader::databaseIdFinished( int /*id*/, bool error ) } Map dbIdResults = parse( http->results(), 0, true ); - m_databaseId = QString::number( dbIdResults["avdb"].asList()[0].asMap()["mlcl"].asList()[0].asMap()["mlit"].asList()[0].asMap()["miid"].asList()[0].asInt() ); - connect( http, SIGNAL( requestFinished( int, bool ) ), this, SLOT( songListFinished( int, bool ) ) ); - http->getDaap( QString("/databases/%1/items?type=music&meta=dmap.itemid,dmap.itemname,daap.songformat,daap.songartist,daap.songalbum,daap.songtime,daap.songtracknumber,daap.songcomment,daap.songyear,daap.songgenre&%2") + m_databaseId = TQString::number( dbIdResults["avdb"].asList()[0].asMap()["mlcl"].asList()[0].asMap()["mlit"].asList()[0].asMap()["miid"].asList()[0].asInt() ); + connect( http, TQT_SIGNAL( requestFinished( int, bool ) ), this, TQT_SLOT( songListFinished( int, bool ) ) ); + http->getDaap( TQString("/databases/%1/items?type=music&meta=dmap.itemid,dmap.itemname,daap.songformat,daap.songartist,daap.songalbum,daap.songtime,daap.songtracknumber,daap.songcomment,daap.songyear,daap.songgenre&%2") .arg( m_databaseId, m_loginString ) ); } @@ -266,7 +266,7 @@ void Reader::songListFinished( int /*id*/, bool error ) { ContentFetcher* http = (ContentFetcher*) sender(); - disconnect( http, SIGNAL( requestFinished( int, bool ) ), this, SLOT( songListFinished( int, bool ) ) ); + disconnect( http, TQT_SIGNAL( requestFinished( int, bool ) ), this, TQT_SLOT( songListFinished( int, bool ) ) ); if( error ) { http->deleteLater(); @@ -276,28 +276,28 @@ Reader::songListFinished( int /*id*/, bool error ) Map songResults = parse( http->results(), 0, true ); SongList result; - QValueList<QVariant> songList; + TQValueList<TQVariant> songList; songList = songResults["adbs"].asList()[0].asMap()["mlcl"].asList()[0].asMap()["mlit"].asList(); debug() << "songList.count() = " << songList.count() << endl; - QValueList<QVariant>::iterator it; + TQValueList<TQVariant>::iterator it; for( it = songList.begin(); it != songList.end(); ++it ) { MetaBundle* bundle = new MetaBundle(); bundle->setTitle( (*it).asMap()["minm"].asList()[0].toString() ); //input url: daap://host:port/databaseId/music.ext bundle->setUrl( Amarok::QStringx("daap://%1:%2/%3/%4.%5").args( - QStringList() << m_host - << QString::number( m_port ) + TQStringList() << m_host + << TQString::number( m_port ) << m_databaseId - << QString::number( (*it).asMap()["miid"].asList()[0].asInt() ) + << TQString::number( (*it).asMap()["miid"].asList()[0].asInt() ) << (*it).asMap()["asfm"].asList()[0].asString() ) ); bundle->setLength( (*it).asMap()["astm"].asList()[0].toInt()/1000 ); bundle->setTrack( (*it).asMap()["astn"].asList()[0].toInt() ); - QString album = (*it).asMap()["asal"].asList()[0].toString(); + TQString album = (*it).asMap()["asal"].asList()[0].toString(); bundle->setAlbum( album ); - QString artist = (*it).asMap()["asar"].asList()[0].toString(); + TQString artist = (*it).asMap()["asar"].asList()[0].toString(); bundle->setArtist( artist ); result[ artist.lower() ][ album.lower() ].append(bundle); @@ -310,7 +310,7 @@ Reader::songListFinished( int /*id*/, bool error ) } Q_UINT32 -Reader::getTagAndLength( QDataStream &raw, char tag[5] ) +Reader::getTagAndLength( TQDataStream &raw, char tag[5] ) { tag[4] = 0; raw.readRawBytes(tag, 4); @@ -320,7 +320,7 @@ Reader::getTagAndLength( QDataStream &raw, char tag[5] ) } Map -Reader::parse( QDataStream &raw, uint containerLength, bool first ) +Reader::parse( TQDataStream &raw, uint containerLength, bool first ) { //DEBUG_BLOCK /* http://daap.sourceforge.net/docs/index.html @@ -347,39 +347,39 @@ Reader::parse( QDataStream &raw, uint containerLength, bool first ) case CHAR: { Q_INT8 charData; raw >> charData; DEBUGTAG( charData ) - addElement( childMap, tag, QVariant( static_cast<int>(charData) ) ); + addElement( childMap, tag, TQVariant( static_cast<int>(charData) ) ); } break; case SHORT: { Q_INT16 shortData; raw >> shortData; DEBUGTAG( shortData ) - addElement( childMap, tag, QVariant( static_cast<int>(shortData) ) ); + addElement( childMap, tag, TQVariant( static_cast<int>(shortData) ) ); } break; case LONG: { Q_INT32 longData; raw >> longData; DEBUGTAG( longData ) - addElement( childMap, tag, QVariant( longData ) ); + addElement( childMap, tag, TQVariant( longData ) ); } break; case LONGLONG: { Q_INT64 longlongData; raw >> longlongData; DEBUGTAG( longlongData ) - addElement( childMap, tag, QVariant( longlongData ) ); + addElement( childMap, tag, TQVariant( longlongData ) ); } break; case STRING: { - QByteArray stringData(tagLength); - raw.readRawBytes( stringData.data(), tagLength ); DEBUGTAG( QString::fromUtf8( stringData, tagLength ) ) - addElement( childMap, tag, QVariant( QString::fromUtf8( stringData, tagLength ) ) ); + TQByteArray stringData(tagLength); + raw.readRawBytes( stringData.data(), tagLength ); DEBUGTAG( TQString::fromUtf8( stringData, tagLength ) ) + addElement( childMap, tag, TQVariant( TQString::fromUtf8( stringData, tagLength ) ) ); } break; case DATE: { Q_INT64 dateData; - QDateTime date; + TQDateTime date; raw >> dateData; DEBUGTAG( dateData ) date.setTime_t(dateData); - addElement( childMap, tag, QVariant( date ) ); + addElement( childMap, tag, TQVariant( date ) ); } break; case DVERSION: { @@ -387,14 +387,14 @@ Reader::parse( QDataStream &raw, uint containerLength, bool first ) Q_INT8 minor; Q_INT8 patchLevel; raw >> major >> minor >> patchLevel; DEBUGTAG( patchLevel ) - QString version("%1.%2.%3"); + TQString version("%1.%2.%3"); version.arg(major, minor, patchLevel); - addElement( childMap, tag, QVariant(version) ); + addElement( childMap, tag, TQVariant(version) ); } break; case CONTAINER: { DEBUGTAG( 11 ) - addElement( childMap, tag, QVariant( parse( raw, tagLength ) ) ); + addElement( childMap, tag, TQVariant( parse( raw, tagLength ) ) ); } break; default: @@ -407,18 +407,18 @@ Reader::parse( QDataStream &raw, uint containerLength, bool first ) } void -Reader::addElement( Map &parentMap, char* tag, QVariant element ) +Reader::addElement( Map &parentMap, char* tag, TQVariant element ) { if( !parentMap.contains( tag ) ) - parentMap[tag] = QVariant( QValueList<QVariant>() ); + parentMap[tag] = TQVariant( TQValueList<TQVariant>() ); parentMap[tag].asList().append(element); } void -Reader::fetchingError( const QString& error ) +Reader::fetchingError( const TQString& error ) { - const_cast< QObject* >( sender() )->deleteLater(); + const_cast< TQObject* >( sender() )->deleteLater(); emit httpError( error ); } #include "reader.moc" diff --git a/amarok/src/mediadevice/daap/daapreader/reader.h b/amarok/src/mediadevice/daap/daapreader/reader.h index 8b9f533b..473c53c7 100644 --- a/amarok/src/mediadevice/daap/daapreader/reader.h +++ b/amarok/src/mediadevice/daap/daapreader/reader.h @@ -13,36 +13,36 @@ #ifndef DAAPREADER_H #define DAAPREADER_H -#include <qobject.h> +#include <tqobject.h> #include <kurl.h> -class QString; +class TQString; template <class T> -class QPtrList; +class TQPtrList; class MetaBundle; class ServerItem; -class QHttpResponseHeader; +class TQHttpResponseHeader; namespace Daap { - typedef QMap<QString, QVariant> Map; + typedef TQMap<TQString, TQVariant> Map; - typedef QPtrList< MetaBundle > TrackList; - typedef QMap< QString, TrackList > AlbumList; - typedef QMap< QString, AlbumList > SongList; + typedef TQPtrList< MetaBundle > TrackList; + typedef TQMap< TQString, TrackList > AlbumList; + typedef TQMap< TQString, AlbumList > SongList; -//typedef QMap<QString, QMap<QString, QPtrList<MetaBundle> > > SongList; +//typedef TQMap<TQString, TQMap<TQString, TQPtrList<MetaBundle> > > SongList; enum ContentTypes { INVALID = 0, CHAR = 1, SHORT = 2, LONG = 5, LONGLONG = 7, STRING = 9, DATE = 10, DVERSION = 11, CONTAINER = 12 }; struct Code { Code() : type(INVALID) { } - Code( const QString& nName, ContentTypes nType ) : name( nName ), type( nType ) { } + Code( const TQString& nName, ContentTypes nType ) : name( nName ), type( nType ) { } ~Code() { } - QString name; + TQString name; ContentTypes type; }; @@ -57,31 +57,31 @@ namespace Daap Q_OBJECT public: - Reader( const QString& host, Q_UINT16 port, ServerItem* root, - const QString& password, QObject* parent, const char* name ); + Reader( const TQString& host, Q_UINT16 port, ServerItem* root, + const TQString& password, TQObject* parent, const char* name ); ~Reader(); - //QPtrList<MetaBundle> getSongList(); + //TQPtrList<MetaBundle> getSongList(); enum Options { SESSION_ID = 1, SERVER_VERSION = 2 }; void loginRequest(); void logoutRequest(); ServerItem* rootMediaItem() const { return m_root; } int sessionId() const { return m_sessionId; } - QString host() const { return m_host; } + TQString host() const { return m_host; } Q_UINT16 port() const { return m_port; } public slots: void logoutRequest(int, bool ); - void loginHeaderReceived( const QHttpResponseHeader& resp ); + void loginHeaderReceived( const TQHttpResponseHeader& resp ); void loginFinished( int id , bool error ); void updateFinished( int id , bool error ); void databaseIdFinished( int id , bool error ); void songListFinished( int id, bool error ); - void fetchingError( const QString& error ); + void fetchingError( const TQString& error ); signals: - void daapBundles( const QString& host, Daap::SongList bundles ); - void httpError( const QString& ); + void daapBundles( const TQString& host, Daap::SongList bundles ); + void httpError( const TQString& ); void passwordRequired(); private: @@ -90,19 +90,19 @@ namespace Daap * @param raw stream of DAAP reply * @param containerLength length of the container (or entire result) being analyzed */ - static Map parse( QDataStream &raw, uint containerLength, bool first = false ); - static void addElement( Map &parentMap, char* tag, QVariant element ); //! supporter function for parse - static Q_UINT32 getTagAndLength( QDataStream &raw, char tag[5] ); + static Map parse( TQDataStream &raw, uint containerLength, bool first = false ); + static void addElement( Map &parentMap, char* tag, TQVariant element ); //! supporter function for parse + static Q_UINT32 getTagAndLength( TQDataStream &raw, char tag[5] ); - static QMap<QString, Code> s_codes; + static TQMap<TQString, Code> s_codes; - QString m_host; + TQString m_host; Q_UINT16 m_port; - QString m_loginString; - QString m_databaseId; + TQString m_loginString; + TQString m_databaseId; int m_sessionId; ServerItem* m_root; - QString m_password; + TQString m_password; }; diff --git a/amarok/src/mediadevice/daap/daapserver.cpp b/amarok/src/mediadevice/daap/daapserver.cpp index 6b9cd8de..9a1b9b23 100644 --- a/amarok/src/mediadevice/daap/daapserver.cpp +++ b/amarok/src/mediadevice/daap/daapserver.cpp @@ -21,8 +21,8 @@ #if DNSSD_SUPPORT #include <dnssd/publicservice.h> #endif -DaapServer::DaapServer(QObject* parent, char* name) - : QObject( parent, name ) +DaapServer::DaapServer(TQObject* parent, char* name) + : TQObject( parent, name ) , m_service( 0 ) { DEBUG_BLOCK @@ -38,7 +38,7 @@ DaapServer::DaapServer(QObject* parent, char* name) return; } - connect( m_server, SIGNAL( readReady( KProcIO* ) ), this, SLOT( readSql() ) ); + connect( m_server, TQT_SIGNAL( readReady( KProcIO* ) ), this, TQT_SLOT( readSql() ) ); } DaapServer::~DaapServer() @@ -52,9 +52,9 @@ DaapServer::~DaapServer() void DaapServer::readSql() { - static const QCString sqlPrefix = "SQL QUERY: "; - static const QCString serverStartPrefix = "SERVER STARTING: "; - QString line; + static const TQCString sqlPrefix = "SQL QUERY: "; + static const TQCString serverStartPrefix = "SERVER STARTING: "; + TQString line; while( m_server->readln( line ) != -1 ) { if( line.startsWith( sqlPrefix ) ) diff --git a/amarok/src/mediadevice/daap/daapserver.h b/amarok/src/mediadevice/daap/daapserver.h index 1f1d0773..594d478e 100644 --- a/amarok/src/mediadevice/daap/daapserver.h +++ b/amarok/src/mediadevice/daap/daapserver.h @@ -24,7 +24,7 @@ class DaapServer : public QObject Q_OBJECT public: - DaapServer(QObject* parent, char* name); + DaapServer(TQObject* parent, char* name); ~DaapServer(); public slots: void readSql(); diff --git a/amarok/src/mediadevice/daap/proxy.cpp b/amarok/src/mediadevice/daap/proxy.cpp index 9ab3885d..b1095cd4 100644 --- a/amarok/src/mediadevice/daap/proxy.cpp +++ b/amarok/src/mediadevice/daap/proxy.cpp @@ -24,20 +24,20 @@ using namespace Daap; //input url: daap://host:port/databaseId/music.ext /* bundle->setUrl( Amarok::QStringx("http://%1:3689/databases/%2/items/%3.%4?%5").args( - QStringList() << m_host + TQStringList() << m_host << m_databaseId - << QString::number( (*it).asMap()["miid"].asList()[0].asInt() ) + << TQString::number( (*it).asMap()["miid"].asList()[0].asInt() ) << (*it).asMap()["asfm"].asList()[0].asString() << m_loginString ) ); */ Proxy::Proxy(KURL stream, DaapClient* client, const char* name) - : QObject(client, name) + : TQObject(client, name) , m_proxy( new Amarok::ProcIO() ) { DEBUG_BLOCK //find the request id and increment it - const QString hostKey = stream.host() + ':' + QString::number(stream.port()); + const TQString hostKey = stream.host() + ':' + TQString::number(stream.port()); const int revisionId = client->incRevision( hostKey ); const int sessionId = client->getSession( hostKey ); //compose URL @@ -56,16 +56,16 @@ Proxy::Proxy(KURL stream, DaapClient* client, const char* name) const int port = socket->port(); debug() << "Proxy server using port: " << port << endl; delete socket; - m_proxyUrl = KURL( QString("http://localhost:%1/daap.mp3").arg( port ) ); + m_proxyUrl = KURL( TQString("http://localhost:%1/daap.mp3").arg( port ) ); //start proxy m_proxy->setComm( KProcess::Communication( KProcess::AllOutput ) ); *m_proxy << "amarok_proxy.rb"; *m_proxy << "--daap"; - *m_proxy << QString::number( port ); + *m_proxy << TQString::number( port ); *m_proxy << realStream.url(); *m_proxy << AmarokConfig::soundSystem(); *m_proxy << hash; - *m_proxy << QString::number( revisionId ); + *m_proxy << TQString::number( revisionId ); *m_proxy << Amarok::proxyForUrl( realStream.url() ); if( !m_proxy->start( KProcIO::NotifyOnExit, true ) ) { @@ -73,15 +73,15 @@ Proxy::Proxy(KURL stream, DaapClient* client, const char* name) return; } - QString line; + TQString line; while( true ) { kapp->processEvents(); m_proxy->readln( line ); if( line == "AMAROK_PROXY: startup" ) break; } - debug() << "started amarok_proxy.rb --daap " << QString::number( port ) << ' ' << realStream.url() << ' ' << AmarokConfig::soundSystem() << ' ' << hash << ' ' << revisionId << endl; - connect( m_proxy, SIGNAL( processExited( KProcess* ) ), this, SLOT( playbackStopped() ) ); - connect( m_proxy, SIGNAL( readReady( KProcIO* ) ), this, SLOT( readProxy() ) ); + debug() << "started amarok_proxy.rb --daap " << TQString::number( port ) << ' ' << realStream.url() << ' ' << AmarokConfig::soundSystem() << ' ' << hash << ' ' << revisionId << endl; + connect( m_proxy, TQT_SIGNAL( processExited( KProcess* ) ), this, TQT_SLOT( playbackStopped() ) ); + connect( m_proxy, TQT_SIGNAL( readReady( KProcIO* ) ), this, TQT_SLOT( readProxy() ) ); } Proxy::~Proxy() @@ -98,7 +98,7 @@ Proxy::playbackStopped() void Proxy::readProxy() { - QString line; + TQString line; while( m_proxy->readln( line ) != -1 ) { @@ -113,7 +113,7 @@ KURL Proxy::realStreamUrl( KURL fakeStream, int sessionId ) realStream.setHost(fakeStream.host()); realStream.setPort(fakeStream.port()); realStream.setPath( "/databases" + fakeStream.directory() + "/items/" + fakeStream.fileName() ); - realStream.setQuery( QString("?session-id=") + QString::number(sessionId) ); + realStream.setQuery( TQString("?session-id=") + TQString::number(sessionId) ); return realStream; } diff --git a/amarok/src/mediadevice/daap/proxy.h b/amarok/src/mediadevice/daap/proxy.h index 9757871a..02b37158 100644 --- a/amarok/src/mediadevice/daap/proxy.h +++ b/amarok/src/mediadevice/daap/proxy.h @@ -13,8 +13,8 @@ #ifndef DAAPPROXY_H #define DAAPPROXY_H -#include <qobject.h> -#include <qserversocket.h> +#include <tqobject.h> +#include <tqserversocket.h> class DaapClient; namespace Daap { @@ -38,12 +38,12 @@ namespace Daap { Amarok::ProcIO* m_proxy; }; - // We must implement this because QServerSocket has one pure virtual method. + // We must implement this because TQServerSocket has one pure virtual method. // It's just used for finding a free port. class MyServerSocket : public QServerSocket { public: - MyServerSocket() : QServerSocket( Q_UINT16( 0 ) ) {} + MyServerSocket() : TQServerSocket( Q_UINT16( 0 ) ) {} private: void newConnection( int ) {} diff --git a/amarok/src/mediadevice/generic/genericmediadevice.cpp b/amarok/src/mediadevice/generic/genericmediadevice.cpp index 9a27b12e..79056bde 100644 --- a/amarok/src/mediadevice/generic/genericmediadevice.cpp +++ b/amarok/src/mediadevice/generic/genericmediadevice.cpp @@ -53,17 +53,17 @@ AMAROK_EXPORT_PLUGIN( GenericMediaDevice ) #include <unistd.h> //usleep() -#include <qcstring.h> -#include <qfile.h> +#include <tqcstring.h> +#include <tqfile.h> #include <qstringx.h> -#include <qstringlist.h> +#include <tqstringlist.h> -#include <qcombobox.h> -#include <qlistbox.h> -#include <qlineedit.h> +#include <tqcombobox.h> +#include <tqlistbox.h> +#include <tqlineedit.h> -typedef QPtrList<GenericMediaFile> MediaFileList; -typedef QPtrListIterator<GenericMediaFile> MediaFileListIterator; +typedef TQPtrList<GenericMediaFile> MediaFileList; +typedef TQPtrListIterator<GenericMediaFile> MediaFileListIterator; /** * GenericMediaItem Class @@ -72,17 +72,17 @@ typedef QPtrListIterator<GenericMediaFile> MediaFileListIterator; class GenericMediaItem : public MediaItem { public: - GenericMediaItem( QListView *parent, QListViewItem *after = 0 ) + GenericMediaItem( TQListView *parent, TQListViewItem *after = 0 ) : MediaItem( parent, after ) { } - GenericMediaItem( QListViewItem *parent, QListViewItem *after = 0 ) + GenericMediaItem( TQListViewItem *parent, TQListViewItem *after = 0 ) : MediaItem( parent, after ) { } // List directories first, always int - compare( QListViewItem *i, int col, bool ascending ) const + compare( TQListViewItem *i, int col, bool ascending ) const { #define i static_cast<GenericMediaItem *>(i) switch( type() ) @@ -108,7 +108,7 @@ class GenericMediaItem : public MediaItem class GenericMediaFile { public: - GenericMediaFile( GenericMediaFile *parent, QString basename, GenericMediaDevice *device ) + GenericMediaFile( GenericMediaFile *parent, TQString basename, GenericMediaDevice *device ) : m_parent( parent ) , m_device( device ) { @@ -193,12 +193,12 @@ class GenericMediaFile //always follow this function with setNamesFromBase() void - setBaseName( QString &name ) { m_baseName = name; } + setBaseName( TQString &name ) { m_baseName = name; } void - setNamesFromBase( const QString &name = QString::null ) + setNamesFromBase( const TQString &name = TQString::null ) { - if( name != QString::null ) + if( name != TQString::null ) m_baseName = name; if( m_parent ) m_fullName = m_parent->getFullName() + '/' + m_baseName; @@ -241,8 +241,8 @@ class GenericMediaFile } private: - QString m_fullName; - QString m_baseName; + TQString m_fullName; + TQString m_baseName; GenericMediaFile *m_parent; MediaFileList *m_children; GenericMediaItem *m_viewItem; @@ -253,7 +253,7 @@ class GenericMediaFile QString GenericMediaDevice::fileName( const MetaBundle &bundle ) { - QString result = cleanPath( bundle.artist() ); + TQString result = cleanPath( bundle.artist() ); if( !result.isEmpty() ) { @@ -299,18 +299,18 @@ GenericMediaDevice::GenericMediaDevice() m_ignoreThePrefix = false; m_asciiTextOnly = false; - m_songLocation = QString::null; - m_podcastLocation = QString::null; + m_songLocation = TQString::null; + m_podcastLocation = TQString::null; m_supportedFileTypes.clear(); m_configDialog = 0; - connect( m_dirLister, SIGNAL( newItems(const KFileItemList &) ), this, SLOT( newItems(const KFileItemList &) ) ); - connect( m_dirLister, SIGNAL( completed() ), this, SLOT( dirListerCompleted() ) ); - connect( m_dirLister, SIGNAL( clear() ), this, SLOT( dirListerClear() ) ); - connect( m_dirLister, SIGNAL( clear(const KURL &) ), this, SLOT( dirListerClear(const KURL &) ) ); - connect( m_dirLister, SIGNAL( deleteItem(KFileItem *) ), this, SLOT( dirListerDeleteItem(KFileItem *) ) ); + connect( m_dirLister, TQT_SIGNAL( newItems(const KFileItemList &) ), this, TQT_SLOT( newItems(const KFileItemList &) ) ); + connect( m_dirLister, TQT_SIGNAL( completed() ), this, TQT_SLOT( dirListerCompleted() ) ); + connect( m_dirLister, TQT_SIGNAL( clear() ), this, TQT_SLOT( dirListerClear() ) ); + connect( m_dirLister, TQT_SIGNAL( clear(const KURL &) ), this, TQT_SLOT( dirListerClear(const KURL &) ) ); + connect( m_dirLister, TQT_SIGNAL( deleteItem(KFileItem *) ), this, TQT_SLOT( dirListerDeleteItem(KFileItem *) ) ); } void @@ -332,7 +332,7 @@ GenericMediaDevice::applyConfig() m_supportedFileTypes.clear(); for( uint i = 0; i < m_configDialog->m_supportedListBox->count(); i++ ) { - QString currentText = m_configDialog->m_supportedListBox->item( i )->text(); + TQString currentText = m_configDialog->m_supportedListBox->item( i )->text(); if( currentText == m_configDialog->m_convertComboBox->currentText() ) m_supportedFileTypes.prepend( currentText ); @@ -373,7 +373,7 @@ GenericMediaDevice::loadConfig() m_songLocation = configString( "songLocation", "/%artist/%album/%title.%filetype" ); m_podcastLocation = configString( "podcastLocation", "/podcasts/" ); - m_supportedFileTypes = QStringList::split( ", ", configString( "supportedFiletypes", "mp3"), true); + m_supportedFileTypes = TQStringList::split( ", ", configString( "supportedFiletypes", "mp3"), true); } bool @@ -399,11 +399,11 @@ GenericMediaDevice::openDevice( bool /*silent*/ ) true : false; m_connected = true; KURL tempurl = KURL::fromPathOrURL( m_medium.mountPoint() ); - QString newMountPoint = tempurl.isLocalFile() ? tempurl.path( -1 ) : tempurl.prettyURL( -1 ); //no trailing slash + TQString newMountPoint = tempurl.isLocalFile() ? tempurl.path( -1 ) : tempurl.prettyURL( -1 ); //no trailing slash m_transferDir = newMountPoint; m_initialFile = new GenericMediaFile( 0, newMountPoint, this ); listDir( newMountPoint ); - connect( this, SIGNAL( startTransfer() ), MediaBrowser::instance(), SLOT( transferClicked() ) ); + connect( this, TQT_SIGNAL( startTransfer() ), MediaBrowser::instance(), TQT_SLOT( transferClicked() ) ); return true; } @@ -426,7 +426,7 @@ GenericMediaDevice::closeDevice() //SLOT /// Renaming void -GenericMediaDevice::renameItem( QListViewItem *item ) // SLOT +GenericMediaDevice::renameItem( TQListViewItem *item ) // SLOT { if( !item ) @@ -434,8 +434,8 @@ GenericMediaDevice::renameItem( QListViewItem *item ) // SLOT #define item static_cast<GenericMediaItem*>(item) - QString src = m_mim[item]->getFullName(); - QString dst = m_mim[item]->getParent()->getFullName() + '/' + item->text(0); + TQString src = m_mim[item]->getFullName(); + TQString dst = m_mim[item]->getParent()->getFullName() + '/' + item->text(0); debug() << "Renaming: " << src << " to: " << dst << endl; @@ -464,15 +464,15 @@ GenericMediaDevice::renameItem( QListViewItem *item ) // SLOT /// Creating a directory MediaItem * -GenericMediaDevice::newDirectory( const QString &name, MediaItem *parent ) +GenericMediaDevice::newDirectory( const TQString &name, MediaItem *parent ) { if( !m_connected || name.isEmpty() ) return 0; #define parent static_cast<GenericMediaItem*>(parent) - QString fullName = m_mim[parent]->getFullName(); - QString cleanedName = cleanPath( name ); - QString fullPath = fullName + '/' + cleanedName; + TQString fullName = m_mim[parent]->getFullName(); + TQString cleanedName = cleanPath( name ); + TQString fullPath = fullName + '/' + cleanedName; debug() << "Creating directory: " << fullPath << endl; const KURL url( fullPath ); @@ -490,7 +490,7 @@ GenericMediaDevice::newDirectory( const QString &name, MediaItem *parent ) } void -GenericMediaDevice::addToDirectory( MediaItem *directory, QPtrList<MediaItem> items ) +GenericMediaDevice::addToDirectory( MediaItem *directory, TQPtrList<MediaItem> items ) { if( items.isEmpty() ) return; @@ -506,11 +506,11 @@ GenericMediaDevice::addToDirectory( MediaItem *directory, QPtrList<MediaItem> it dropDir = m_mim[directory]; } - for( QPtrListIterator<MediaItem> it(items); *it; ++it ) + for( TQPtrListIterator<MediaItem> it(items); *it; ++it ) { GenericMediaItem *currItem = static_cast<GenericMediaItem *>(*it); - QString src = m_mim[currItem]->getFullName(); - QString dst = dropDir->getFullName() + '/' + currItem->text(0); + TQString src = m_mim[currItem]->getFullName(); + TQString dst = dropDir->getFullName() + '/' + currItem->text(0); debug() << "Moving: " << src << " to: " << dst << endl; const KURL srcurl(src); @@ -531,12 +531,12 @@ GenericMediaDevice::addToDirectory( MediaItem *directory, QPtrList<MediaItem> it /// Uploading QString -GenericMediaDevice::buildDestination( const QString &format, const MetaBundle &mb ) +GenericMediaDevice::buildDestination( const TQString &format, const MetaBundle &mb ) { bool isCompilation = mb.compilation() == MetaBundle::CompilationYes; - QMap<QString, QString> args; - QString artist = mb.artist(); - QString albumartist = artist; + TQMap<TQString, TQString> args; + TQString artist = mb.artist(); + TQString albumartist = artist; if( isCompilation ) albumartist = i18n( "Various Artists" ); args["theartist"] = cleanPath( artist ); @@ -558,21 +558,21 @@ GenericMediaDevice::buildDestination( const QString &format, const MetaBundle &m args["albumartist"] = albumartist; args["initial"] = albumartist.mid( 0, 1 ).upper(); args["filetype"] = mb.url().pathOrURL().section( ".", -1 ).lower(); - QString track; + TQString track; if ( mb.track() ) track.sprintf( "%02d", mb.track() ); args["track"] = track; Amarok::QStringx formatx( format ); - QString result = formatx.namedOptArgs( args ); + TQString result = formatx.namedOptArgs( args ); if( !result.startsWith( "/" ) ) result.prepend( "/" ); - return result.replace( QRegExp( "/\\.*" ), "/" ); + return result.replace( TQRegExp( "/\\.*" ), "/" ); } void -GenericMediaDevice::checkAndBuildLocation( const QString& location ) +GenericMediaDevice::checkAndBuildLocation( const TQString& location ) { // check for every directory from the mount point to the location // whether they exist or not. @@ -593,8 +593,8 @@ GenericMediaDevice::checkAndBuildLocation( const QString& location ) i++ ) { - QString firstpart = location.section( '/', 0, i-1 ); - QString secondpart = cleanPath( location.section( '/', i, i ) ); + TQString firstpart = location.section( '/', 0, i-1 ); + TQString secondpart = cleanPath( location.section( '/', i, i ) ); KURL url = KURL::fromPathOrURL( firstpart + '/' + secondpart ); if( !KIO::NetAccess::exists( url, false, m_parent ) ) @@ -612,18 +612,18 @@ GenericMediaDevice::checkAndBuildLocation( const QString& location ) QString GenericMediaDevice::buildPodcastDestination( const PodcastEpisodeBundle *bundle ) { - QString location = m_podcastLocation.endsWith("/") ? m_podcastLocation : m_podcastLocation + '/'; + TQString location = m_podcastLocation.endsWith("/") ? m_podcastLocation : m_podcastLocation + '/'; // get info about the PodcastChannel - QString parentUrl = bundle->parent().url(); - QString sql = "SELECT title,parent FROM podcastchannels WHERE url='" + CollectionDB::instance()->escapeString( parentUrl ) + "';"; - QStringList values = CollectionDB::instance()->query( sql ); - QString channelTitle; + TQString parentUrl = bundle->parent().url(); + TQString sql = "SELECT title,parent FROM podcastchannels WHERE url='" + CollectionDB::instance()->escapeString( parentUrl ) + "';"; + TQStringList values = CollectionDB::instance()->query( sql ); + TQString channelTitle; int parent = 0; channelTitle = values.first(); parent = values.last().toInt(); // Put the file in a directory tree like in the playlistbrowser sql = "SELECT name,parent FROM podcastfolders WHERE id=%1;"; - QString name; + TQString name; while ( parent > 0 ) { values = CollectionDB::instance()->query( sql.arg( parent ) ); @@ -642,7 +642,7 @@ GenericMediaDevice::copyTrackToDevice( const MetaBundle& bundle ) if( !m_connected ) return 0; // use different naming schemes for differen kinds of tracks - QString path = m_transferDir; + TQString path = m_transferDir; debug() << "bundle exists: " << bundle.podcastBundle() << endl; if( bundle.podcastBundle() ) path += buildPodcastDestination( bundle.podcastBundle() ); @@ -676,13 +676,13 @@ GenericMediaDevice::copyTrackToDevice( const MetaBundle& bundle ) MediaItem * GenericMediaDevice::trackExists( const MetaBundle& bundle ) { - QString key; - QString path = buildDestination( m_songLocation, bundle); + TQString key; + TQString path = buildDestination( m_songLocation, bundle); KURL url( path ); - QStringList directories = QStringList::split( "/", url.directory(1,1), false ); + TQStringList directories = TQStringList::split( "/", url.directory(1,1), false ); - QListViewItem *it = view()->firstChild(); - for( QStringList::Iterator directory = directories.begin(); + TQListViewItem *it = view()->firstChild(); + for( TQStringList::Iterator directory = directories.begin(); directory != directories.end(); directory++ ) { @@ -732,7 +732,7 @@ GenericMediaDevice::deleteItemFromDevice( MediaItem *item, int /*flags*/ ) #define item static_cast<GenericMediaItem*>(item) - QString path = m_mim[item]->getFullName(); + TQString path = m_mim[item]->getFullName(); debug() << "Deleting path: " << path << endl; if ( !KIO::NetAccess::del( KURL::fromPathOrURL(path), m_view )) @@ -763,7 +763,7 @@ GenericMediaDevice::deleteItemFromDevice( MediaItem *item, int /*flags*/ ) /// Directory Reading void -GenericMediaDevice::expandItem( QListViewItem *item ) // SLOT +GenericMediaDevice::expandItem( TQListViewItem *item ) // SLOT { if( !item || !item->isExpandable() ) return; @@ -780,7 +780,7 @@ GenericMediaDevice::expandItem( QListViewItem *item ) // SLOT } void -GenericMediaDevice::listDir( const QString &dir ) +GenericMediaDevice::listDir( const TQString &dir ) { m_dirListerComplete = false; if( m_mfm[dir]->getListed() ) @@ -793,7 +793,7 @@ GenericMediaDevice::listDir( const QString &dir ) } void -GenericMediaDevice::refreshDir( const QString &dir ) +GenericMediaDevice::refreshDir( const TQString &dir ) { m_dirListerComplete = false; m_dirLister->updateDirectory( KURL::fromPathOrURL(dir) ); @@ -802,7 +802,7 @@ GenericMediaDevice::refreshDir( const QString &dir ) void GenericMediaDevice::newItems( const KFileItemList &items ) { - QPtrListIterator<KFileItem> it( items ); + TQPtrListIterator<KFileItem> it( items ); KFileItem *kfi; while ( (kfi = it.current()) != 0 ) { ++it; @@ -826,14 +826,14 @@ GenericMediaDevice::dirListerClear() m_mim.clear(); KURL tempurl = KURL::fromPathOrURL( m_medium.mountPoint() ); - QString newMountPoint = tempurl.isLocalFile() ? tempurl.path( -1 ) : tempurl.prettyURL( -1 ); //no trailing slash + TQString newMountPoint = tempurl.isLocalFile() ? tempurl.path( -1 ) : tempurl.prettyURL( -1 ); //no trailing slash m_initialFile = new GenericMediaFile( 0, newMountPoint, this ); } void GenericMediaDevice::dirListerClear( const KURL &url ) { - QString directory = url.pathOrURL(); + TQString directory = url.pathOrURL(); GenericMediaFile *vmf = m_mfm[directory]; if( vmf ) vmf->deleteAll( false ); @@ -842,7 +842,7 @@ GenericMediaDevice::dirListerClear( const KURL &url ) void GenericMediaDevice::dirListerDeleteItem( KFileItem *fileitem ) { - QString filename = fileitem->url().pathOrURL(); + TQString filename = fileitem->url().pathOrURL(); GenericMediaFile *vmf = m_mfm[filename]; if( vmf ) vmf->deleteAll( true ); @@ -851,10 +851,10 @@ GenericMediaDevice::dirListerDeleteItem( KFileItem *fileitem ) int GenericMediaDevice::addTrackToList( int type, KURL url, int /*size*/ ) { - QString path = url.isLocalFile() ? url.path( -1 ) : url.prettyURL( -1 ); //no trailing slash + TQString path = url.isLocalFile() ? url.path( -1 ) : url.prettyURL( -1 ); //no trailing slash int index = path.findRev( '/', -1 ); - QString baseName = path.right( path.length() - index - 1 ); - QString parentName = path.left( index ); + TQString baseName = path.right( path.length() - index - 1 ); + TQString parentName = path.left( index ); GenericMediaFile* parent = m_mfm[parentName]; GenericMediaFile* newItem = new GenericMediaFile( parent, baseName, this ); @@ -891,8 +891,8 @@ GenericMediaDevice::getCapacity( KIO::filesize_t *total, KIO::filesize_t *availa KDiskFreeSp* kdf = new KDiskFreeSp( m_parent, "generic_kdf" ); kdf->readDF( m_medium.mountPoint() ); - connect(kdf, SIGNAL(foundMountPoint( const QString &, unsigned long, unsigned long, unsigned long )), - SLOT(foundMountPoint( const QString &, unsigned long, unsigned long, unsigned long ))); + connect(kdf, TQT_SIGNAL(foundMountPoint( const TQString &, unsigned long, unsigned long, unsigned long )), + TQT_SLOT(foundMountPoint( const TQString &, unsigned long, unsigned long, unsigned long ))); int count = 0; @@ -916,7 +916,7 @@ GenericMediaDevice::getCapacity( KIO::filesize_t *total, KIO::filesize_t *availa } void -GenericMediaDevice::foundMountPoint( const QString & mountPoint, unsigned long kBSize, unsigned long /*kBUsed*/, unsigned long kBAvail ) +GenericMediaDevice::foundMountPoint( const TQString & mountPoint, unsigned long kBSize, unsigned long /*kBUsed*/, unsigned long kBAvail ) { if ( mountPoint == m_medium.mountPoint() ){ m_kBSize = kBSize; @@ -927,7 +927,7 @@ GenericMediaDevice::foundMountPoint( const QString & mountPoint, unsigned long k /// Helper functions void -GenericMediaDevice::rmbPressed( QListViewItem* qitem, const QPoint& point, int ) +GenericMediaDevice::rmbPressed( TQListViewItem* qitem, const TQPoint& point, int ) { enum Actions { APPEND, LOAD, QUEUE, DOWNLOAD, @@ -1033,16 +1033,16 @@ GenericMediaDevice::rmbPressed( QListViewItem* qitem, const QPoint& point, int ) } -QString GenericMediaDevice::cleanPath( const QString &component ) +TQString GenericMediaDevice::cleanPath( const TQString &component ) { - QString result = Amarok::cleanPath( component ); + TQString result = Amarok::cleanPath( component ); if( m_asciiTextOnly ) result = Amarok::asciiPath( result ); result.simplifyWhiteSpace(); if( m_spacesToUnderscores ) - result.replace( QRegExp( "\\s" ), "_" ); + result.replace( TQRegExp( "\\s" ), "_" ); if( m_actuallyVfat || m_vfatTextOnly ) result = Amarok::vfatPath( result ); @@ -1055,7 +1055,7 @@ QString GenericMediaDevice::cleanPath( const QString &component ) bool GenericMediaDevice::isPlayable( const MetaBundle& bundle ) { - for( QStringList::Iterator it = m_supportedFileTypes.begin(); it != m_supportedFileTypes.end() ; it++ ) + for( TQStringList::Iterator it = m_supportedFileTypes.begin(); it != m_supportedFileTypes.end() ; it++ ) { if( bundle.type().lower() == (*it).lower() ) return true; @@ -1072,7 +1072,7 @@ bool GenericMediaDevice::isPreferredFormat( const MetaBundle &bundle ) /// Configuration Dialog Extension -void GenericMediaDevice::addConfigElements( QWidget * parent ) +void GenericMediaDevice::addConfigElements( TQWidget * parent ) { m_configDialog = new GenericMediaDeviceConfigDialog( parent ); @@ -1080,7 +1080,7 @@ void GenericMediaDevice::addConfigElements( QWidget * parent ) } -void GenericMediaDevice::removeConfigElements( QWidget * /* parent */ ) +void GenericMediaDevice::removeConfigElements( TQWidget * /* parent */ ) { if( m_configDialog != 0 ) delete m_configDialog; diff --git a/amarok/src/mediadevice/generic/genericmediadevice.h b/amarok/src/mediadevice/generic/genericmediadevice.h index ab034273..4ea9665f 100644 --- a/amarok/src/mediadevice/generic/genericmediadevice.h +++ b/amarok/src/mediadevice/generic/genericmediadevice.h @@ -26,17 +26,17 @@ #include <kdirlister.h> #include <kurl.h> -#include <qptrlist.h> +#include <tqptrlist.h> class GenericMediaItem; class GenericMediaFile; class GenericMediaDeviceConfigDialog; class PodcastEpisodeBundle; -class QStringList; +class TQStringList; -typedef QMap<QString, GenericMediaFile*> MediaFileMap; -typedef QMap<GenericMediaItem*, GenericMediaFile*> MediaItemMap; +typedef TQMap<TQString, GenericMediaFile*> MediaFileMap; +typedef TQMap<GenericMediaItem*, GenericMediaFile*> MediaItemMap; class GenericMediaDevice : public MediaDevice { @@ -51,15 +51,15 @@ class GenericMediaDevice : public MediaDevice bool isConnected() { return m_connected; } - void rmbPressed( QListViewItem* qitem, const QPoint& point, int ); + void rmbPressed( TQListViewItem* qitem, const TQPoint& point, int ); - QStringList supportedFiletypes() { return m_supportedFileTypes; } + TQStringList supportedFiletypes() { return m_supportedFileTypes; } bool isPlayable( const MetaBundle& bundle ); bool isPreferredFormat( const MetaBundle &bundle ); bool needsManualConfig() { return false; } - void addConfigElements( QWidget * parent ); - void removeConfigElements( QWidget * /* parent */); + void addConfigElements( TQWidget * parent ); + void removeConfigElements( TQWidget * /* parent */); void applyConfig(); void loadConfig(); @@ -74,18 +74,18 @@ class GenericMediaDevice : public MediaDevice MediaItem *copyTrackToDevice( const MetaBundle& bundle ); int deleteItemFromDevice( MediaItem *item, int flags=DeleteTrack ); - MediaItem *newDirectory( const QString &name, MediaItem *parent ); - void addToDirectory( MediaItem *directory, QPtrList<MediaItem> items ); + MediaItem *newDirectory( const TQString &name, MediaItem *parent ); + void addToDirectory( MediaItem *directory, TQPtrList<MediaItem> items ); bool getCapacity( KIO::filesize_t *total, KIO::filesize_t *available ); - QString fileName( const MetaBundle & ); + TQString fileName( const MetaBundle & ); //methods not implemented/needed bool lockDevice( bool ) { return true; } void unlockDevice() {} void synchronizeDevice() {} - void addToPlaylist( MediaItem *, MediaItem *, QPtrList<MediaItem> ) {} - MediaItem *newPlaylist( const QString &, MediaItem *, QPtrList<MediaItem> ) { return 0; } + void addToPlaylist( MediaItem *, MediaItem *, TQPtrList<MediaItem> ) {} + MediaItem *newPlaylist( const TQString &, MediaItem *, TQPtrList<MediaItem> ) { return 0; } signals: @@ -93,10 +93,10 @@ class GenericMediaDevice : public MediaDevice protected slots: - void renameItem( QListViewItem *item ); - void expandItem( QListViewItem *item ); - void foundMountPoint( const QString & mountPoint, unsigned long kBSize, unsigned long kBUsed, unsigned long kBAvail ); - void refreshDir( const QString &dir ); + void renameItem( TQListViewItem *item ); + void expandItem( TQListViewItem *item ); + void foundMountPoint( const TQString & mountPoint, unsigned long kBSize, unsigned long kBUsed, unsigned long kBAvail ); + void refreshDir( const TQString &dir ); void newItems( const KFileItemList &items ); void dirListerCompleted(); @@ -110,18 +110,18 @@ class GenericMediaDevice : public MediaDevice MediaItem *trackExists( const MetaBundle& ); - QString buildDestination( const QString &format, const MetaBundle &mb ); - QString buildPodcastDestination( const PodcastEpisodeBundle *bundle ); - void checkAndBuildLocation( const QString& location ); + TQString buildDestination( const TQString &format, const MetaBundle &mb ); + TQString buildPodcastDestination( const PodcastEpisodeBundle *bundle ); + void checkAndBuildLocation( const TQString& location ); KURL::List getSelectedItems(); void downloadSelectedItems(); - void copyTrackSortHelper( const MetaBundle& bundle, QString& sort, QString& base ); + void copyTrackSortHelper( const MetaBundle& bundle, TQString& sort, TQString& base ); - void listDir( const QString &dir ); + void listDir( const TQString &dir ); int addTrackToList( int type, KURL name, int size=0 ); - QString cleanPath( const QString &component ); + TQString cleanPath( const TQString &component ); GenericMediaFile *m_initialFile; @@ -137,9 +137,9 @@ class GenericMediaDevice : public MediaDevice MediaFileMap m_mfm; MediaItemMap m_mim; - QStringList m_supportedFileTypes; - QString m_songLocation; - QString m_podcastLocation; + TQStringList m_supportedFileTypes; + TQString m_songLocation; + TQString m_podcastLocation; bool m_asciiTextOnly; bool m_vfatTextOnly; bool m_ignoreThePrefix; diff --git a/amarok/src/mediadevice/generic/genericmediadeviceconfigdialog.ui.h b/amarok/src/mediadevice/generic/genericmediadeviceconfigdialog.ui.h index 8d266f56..192d4fa0 100644 --- a/amarok/src/mediadevice/generic/genericmediadeviceconfigdialog.ui.h +++ b/amarok/src/mediadevice/generic/genericmediadeviceconfigdialog.ui.h @@ -26,17 +26,17 @@ void GenericMediaDeviceConfigDialog::addSupportedButtonClicked( int id ) { - QPopupMenu *unsupported = m_addSupportedButton->popup(); - QComboBox *convert = m_convertComboBox; - QListBox *supported = m_supportedListBox; + TQPopupMenu *unsupported = m_addSupportedButton->popup(); + TQComboBox *convert = m_convertComboBox; + TQListBox *supported = m_supportedListBox; - QString text = unsupported->text( id ); + TQString text = unsupported->text( id ); if( text.startsWith( "&" ) ) supported->insertItem( text.right( text.length() - 1 ) ); else supported->insertItem( text ); - QString temp = convert->currentText(); + TQString temp = convert->currentText(); convert->insertItem( unsupported->text( id ) ); unsupported->removeItem( id ); @@ -51,10 +51,10 @@ GenericMediaDeviceConfigDialog::addSupportedButtonClicked( int id ) void GenericMediaDeviceConfigDialog::removeSupportedButtonClicked() { - QStringList unsupported; + TQStringList unsupported; - QComboBox *convert = m_convertComboBox; - QListBox *supported = m_supportedListBox; + TQComboBox *convert = m_convertComboBox; + TQListBox *supported = m_supportedListBox; for( uint i = 0; i < m_addSupportedButton->popup()->count(); i++ ) { @@ -64,11 +64,11 @@ GenericMediaDeviceConfigDialog::removeSupportedButtonClicked() for( uint i = 0; i < supported->count() ; /* nothing */) { - QListBoxItem *item = supported->item( i ); + TQListBoxItem *item = supported->item( i ); if( item->isSelected() ) { - QString temp; + TQString temp; unsupported.append( item->text() ); @@ -102,7 +102,7 @@ GenericMediaDeviceConfigDialog::removeSupportedButtonClicked() unsupported.sort(); m_addSupportedButton->popup()->clear(); - for( QStringList::Iterator it = unsupported.begin(); it != unsupported.end(); it++ ) + for( TQStringList::Iterator it = unsupported.begin(); it != unsupported.end(); it++ ) { m_addSupportedButton->popup()->insertItem( *it ); } @@ -110,7 +110,7 @@ GenericMediaDeviceConfigDialog::removeSupportedButtonClicked() void -GenericMediaDeviceConfigDialog::supportedListBoxDoubleClicked( QListBoxItem* item ) +GenericMediaDeviceConfigDialog::supportedListBoxDoubleClicked( TQListBoxItem* item ) { m_convertComboBox->setCurrentText( item->text() ); } @@ -119,18 +119,18 @@ GenericMediaDeviceConfigDialog::supportedListBoxDoubleClicked( QListBoxItem* ite void -GenericMediaDeviceConfigDialog::updateConfigDialogLists( const QStringList & supportedFileTypes ) +GenericMediaDeviceConfigDialog::updateConfigDialogLists( const TQStringList & supportedFileTypes ) { - QStringList allTypes; + TQStringList allTypes; allTypes << "mp3" << "ogg" << "wma" << "mp4" << "aac" << "m4a" << "ac3"; allTypes << "wav" << "flac" << "asf" << "asx" << "mpg" << "mp4v" << "mpeg"; allTypes << "aa" << "3gp" << "mp2" << "ape" << "mpc"; - QStringList unsupported; - QComboBox *convert = m_convertComboBox; - QListBox *supported = m_supportedListBox; + TQStringList unsupported; + TQComboBox *convert = m_convertComboBox; + TQListBox *supported = m_supportedListBox; - for( QStringList::Iterator it = allTypes.begin(); it != allTypes.end(); it++ ) + for( TQStringList::Iterator it = allTypes.begin(); it != allTypes.end(); it++ ) { if( supportedFileTypes.contains( *it ) ) { @@ -148,7 +148,7 @@ GenericMediaDeviceConfigDialog::updateConfigDialogLists( const QStringList & sup m_addSupportedButton->popup()->clear(); - for( QStringList::Iterator it = unsupported.begin(); it != unsupported.end(); it++ ) + for( TQStringList::Iterator it = unsupported.begin(); it != unsupported.end(); it++ ) { m_addSupportedButton->popup()->insertItem( *it ); } @@ -157,12 +157,12 @@ GenericMediaDeviceConfigDialog::updateConfigDialogLists( const QStringList & sup } QString -GenericMediaDeviceConfigDialog::buildDestination( const QString &format, const MetaBundle &mb ) const +GenericMediaDeviceConfigDialog::buildDestination( const TQString &format, const MetaBundle &mb ) const { bool isCompilation = mb.compilation() > 0; - QMap<QString, QString> args; - QString artist = mb.artist(); - QString albumartist = artist; + TQMap<TQString, TQString> args; + TQString artist = mb.artist(); + TQString albumartist = artist; if( isCompilation ) albumartist = i18n( "Various Artists" ); args["theartist"] = cleanPath( artist ); @@ -184,30 +184,30 @@ GenericMediaDeviceConfigDialog::buildDestination( const QString &format, const M args["albumartist"] = albumartist; args["initial"] = albumartist.mid( 0, 1 ).upper(); args["filetype"] = mb.url().path().section( ".", -1 ).lower(); - QString track; + TQString track; if ( mb.track() ) track.sprintf( "%02d", mb.track() ); args["track"] = track; Amarok::QStringx formatx( format ); - QString result = m_device->mountPoint().append( formatx.namedOptArgs( args ) ); - QString tail = result.mid( m_device->mountPoint().length() ); + TQString result = m_device->mountPoint().append( formatx.namedOptArgs( args ) ); + TQString tail = result.mid( m_device->mountPoint().length() ); if( !tail.startsWith( "/" ) ) tail.prepend( "/" ); - return m_device->mountPoint() + tail.replace( QRegExp( "/\\.*" ), "/" ); + return m_device->mountPoint() + tail.replace( TQRegExp( "/\\.*" ), "/" ); } -QString GenericMediaDeviceConfigDialog::cleanPath( const QString &component ) const +TQString GenericMediaDeviceConfigDialog::cleanPath( const TQString &component ) const { - QString result = Amarok::cleanPath( component ); + TQString result = Amarok::cleanPath( component ); if( m_asciiCheck->isChecked() ) result = Amarok::asciiPath( result ); result.simplifyWhiteSpace(); if( m_spaceCheck->isChecked() ) - result.replace( QRegExp( "\\s" ), "_" ); + result.replace( TQRegExp( "\\s" ), "_" ); if( m_device->m_actuallyVfat || m_vfatCheck->isChecked() ) result = Amarok::vfatPath( result ); @@ -224,7 +224,7 @@ GenericMediaDeviceConfigDialog::updatePreviewLabel() } void -GenericMediaDeviceConfigDialog::updatePreviewLabel( const QString& format) +GenericMediaDeviceConfigDialog::updatePreviewLabel( const TQString& format) { m_previewLabel->setText( buildDestination( format , *m_previewBundle ) ); } @@ -248,7 +248,7 @@ GenericMediaDeviceConfigDialog::setDevice( GenericMediaDevice* device ) QString GenericMediaDeviceConfigDialog::buildFormatTip() const { - QMap<QString, QString> args; + TQMap<TQString, TQString> args; for( int i = 0; i < MetaBundle::NUM_COLUMNS; i++ ) { if( i == MetaBundle::Score || i == MetaBundle::PlayCount || i == MetaBundle::LastPlayed ) @@ -263,14 +263,14 @@ GenericMediaDeviceConfigDialog::buildFormatTip() const args["filetype"] = i18n( "File Extension of Source" ); args["track"] = i18n( "Track Number" ); - QString tooltip = i18n( "<h3>Custom Format String</h3>" ); + TQString tooltip = i18n( "<h3>Custom Format String</h3>" ); tooltip += i18n( "You can use the following tokens:" ); tooltip += "<ul>"; - for( QMap<QString, QString>::iterator it = args.begin(); + for( TQMap<TQString, TQString>::iterator it = args.begin(); it != args.end(); ++it ) { - tooltip += QString( "<li>%1 - %2" ).arg( it.data(), "%" + it.key() ); + tooltip += TQString( "<li>%1 - %2" ).arg( it.data(), "%" + it.key() ); } tooltip += "</ul>"; @@ -304,14 +304,14 @@ GenericMediaDeviceConfigDialog::init() m_previewBundle->setUrl( "/some%20directory/some%20file.mp3" ); m_previewBundle->setYear( 2006 ); - m_formatHelp->setText( QString( "<a href='whatsthis:%1'>%2</a>" ). + m_formatHelp->setText( TQString( "<a href='whatsthis:%1'>%2</a>" ). arg( Amarok::escapeHTMLAttr( buildFormatTip() ), i18n( "(Help)" ) ) ); - m_unsupportedMenu = new QPopupMenu( m_addSupportedButton, "unsupported" ); + m_unsupportedMenu = new TQPopupMenu( m_addSupportedButton, "unsupported" ); m_addSupportedButton->setPopup( m_unsupportedMenu ); - connect( m_unsupportedMenu, SIGNAL( activated( int ) ), this, SLOT( addSupportedButtonClicked( int ) ) ); + connect( m_unsupportedMenu, TQT_SIGNAL( activated( int ) ), this, TQT_SLOT( addSupportedButtonClicked( int ) ) ); } diff --git a/amarok/src/mediadevice/ifp/ifpmediadevice.cpp b/amarok/src/mediadevice/ifp/ifpmediadevice.cpp index daa529a5..7f5f101b 100644 --- a/amarok/src/mediadevice/ifp/ifpmediadevice.cpp +++ b/amarok/src/mediadevice/ifp/ifpmediadevice.cpp @@ -41,13 +41,13 @@ AMAROK_EXPORT_PLUGIN( IfpMediaDevice ) #include <kurlrequester.h> //downloadSelectedItems() #include <kurlrequesterdlg.h> //downloadSelectedItems() -#include <qfile.h> -#include <qcstring.h> -#include <qregexp.h> +#include <tqfile.h> +#include <tqcstring.h> +#include <tqregexp.h> namespace Amarok { - extern KConfig *config( const QString& ); - extern QString cleanPath( const QString&, bool ); + extern KConfig *config( const TQString& ); + extern TQString cleanPath( const TQString&, bool ); } /** @@ -57,29 +57,29 @@ namespace Amarok { class IfpMediaItem : public MediaItem { public: - IfpMediaItem( QListView *parent, QListViewItem *after = 0 ) + IfpMediaItem( TQListView *parent, TQListViewItem *after = 0 ) : MediaItem( parent, after ) {} - IfpMediaItem( QListViewItem *parent, QListViewItem *after = 0 ) + IfpMediaItem( TQListViewItem *parent, TQListViewItem *after = 0 ) : MediaItem( parent, after ) {} void - setEncodedName( QString &name ) + setEncodedName( TQString &name ) { - m_encodedName = QFile::encodeName( name ); + m_encodedName = TQFile::encodeName( name ); } void - setEncodedName( QCString &name ) { m_encodedName = name; } + setEncodedName( TQCString &name ) { m_encodedName = name; } QCString encodedName() { return m_encodedName; } // List directories first, always int - compare( QListViewItem *i, int col, bool ascending ) const + compare( TQListViewItem *i, int col, bool ascending ) const { #define i static_cast<IfpMediaItem *>(i) switch( type() ) @@ -100,7 +100,7 @@ class IfpMediaItem : public MediaItem private: bool m_dir; - QCString m_encodedName; + TQCString m_encodedName; }; @@ -143,7 +143,7 @@ IfpMediaDevice::~IfpMediaDevice() } bool -IfpMediaDevice::checkResult( int result, QString message ) +IfpMediaDevice::checkResult( int result, TQString message ) { if( result == 0 ) return true; @@ -162,7 +162,7 @@ IfpMediaDevice::openDevice( bool /*silent*/ ) m_dh = (usb_dev_handle*)ifp_find_device(); - QString genericError = i18n( "Could not connect to iFP device" ); + TQString genericError = i18n( "Could not connect to iFP device" ); if( m_dh == NULL ) { @@ -209,7 +209,7 @@ IfpMediaDevice::openDevice( bool /*silent*/ ) char info[20]; ifp_model( &m_ifpdev, info, 20 ); - m_transferDir = QString(info); + m_transferDir = TQString(info); debug() << "Successfully connected to: " << info << endl; listDir( "" ); @@ -253,18 +253,18 @@ IfpMediaDevice::runTransferDialog() /// Renaming void -IfpMediaDevice::renameItem( QListViewItem *item ) // SLOT +IfpMediaDevice::renameItem( TQListViewItem *item ) // SLOT { if( !item ) return; #define item static_cast<IfpMediaItem*>(item) - QCString src = QFile::encodeName( getFullPath( item, false ) ); + TQCString src = TQFile::encodeName( getFullPath( item, false ) ); src.append( item->encodedName() ); - //the rename line edit has already changed the QListViewItem text - QCString dest = QFile::encodeName( getFullPath( item ) ); + //the rename line edit has already changed the TQListViewItem text + TQCString dest = TQFile::encodeName( getFullPath( item ) ); debug() << "Renaming " << src << " to: " << dest << endl; @@ -278,13 +278,13 @@ IfpMediaDevice::renameItem( QListViewItem *item ) // SLOT /// Creating a directory MediaItem * -IfpMediaDevice::newDirectory( const QString &name, MediaItem *parent ) +IfpMediaDevice::newDirectory( const TQString &name, MediaItem *parent ) { if( !m_connected || name.isEmpty() ) return 0; - QString cleanedName = cleanPath( name ); + TQString cleanedName = cleanPath( name ); - const QCString dirPath = QFile::encodeName( getFullPath( parent ) + "\\" + cleanedName ); + const TQCString dirPath = TQFile::encodeName( getFullPath( parent ) + "\\" + cleanedName ); debug() << "Creating directory: " << dirPath << endl; int err = ifp_mkdir( &m_ifpdev, dirPath ); @@ -297,10 +297,10 @@ IfpMediaDevice::newDirectory( const QString &name, MediaItem *parent ) } MediaItem * -IfpMediaDevice::newDirectoryRecursive( const QString &name, MediaItem *parent ) +IfpMediaDevice::newDirectoryRecursive( const TQString &name, MediaItem *parent ) { - QStringList folders = QStringList::split( '\\', name ); - QString progress = ""; + TQStringList folders = TQStringList::split( '\\', name ); + TQString progress = ""; if( parent ) progress += getFullPath( parent ) + "\\"; @@ -311,7 +311,7 @@ IfpMediaDevice::newDirectoryRecursive( const QString &name, MediaItem *parent ) { debug() << "Checking folder: " << progress << endl; progress += *it; - const QCString dirPath = QFile::encodeName( progress ); + const TQCString dirPath = TQFile::encodeName( progress ); if( ifp_exists( &m_ifpdev, dirPath ) == IFP_DIR ) { @@ -335,9 +335,9 @@ IfpMediaDevice::newDirectoryRecursive( const QString &name, MediaItem *parent ) } MediaItem * -IfpMediaDevice::findChildItem( const QString &name, MediaItem *parent ) +IfpMediaDevice::findChildItem( const TQString &name, MediaItem *parent ) { - QListViewItem *child; + TQListViewItem *child; parent ? child = parent->firstChild(): @@ -353,15 +353,15 @@ IfpMediaDevice::findChildItem( const QString &name, MediaItem *parent ) } void -IfpMediaDevice::addToDirectory( MediaItem *directory, QPtrList<MediaItem> items ) +IfpMediaDevice::addToDirectory( MediaItem *directory, TQPtrList<MediaItem> items ) { if( !directory || items.isEmpty() ) return; m_tmpParent = directory; - for( QPtrListIterator<MediaItem> it(items); *it; ++it ) + for( TQPtrListIterator<MediaItem> it(items); *it; ++it ) { - QCString src = QFile::encodeName( getFullPath( *it ) ); - QCString dest = QFile::encodeName( getFullPath( directory ) + "\\" + (*it)->text(0) ); + TQCString src = TQFile::encodeName( getFullPath( *it ) ); + TQCString dest = TQFile::encodeName( getFullPath( directory ) + "\\" + (*it)->text(0) ); debug() << "Moving: " << src << " to: " << dest << endl; int err = ifp_rename( &m_ifpdev, src, dest ); @@ -381,9 +381,9 @@ IfpMediaDevice::copyTrackToDevice( const MetaBundle& bundle ) if( !m_connected ) return 0; m_transferring = true; - const QCString src = QFile::encodeName( bundle.url().path() ); + const TQCString src = TQFile::encodeName( bundle.url().path() ); - QString directory = "\\"; //root + TQString directory = "\\"; //root bool cleverFilename = false; bool addFileToView = true; if( m_firstSort != i18n("None") ) @@ -404,20 +404,20 @@ IfpMediaDevice::copyTrackToDevice( const MetaBundle& bundle ) m_tmpParent = newDirectoryRecursive( directory, 0 ); // recursively create folders as required. - QString newFilename; + TQString newFilename; // we don't put this in cleanPath because of remote directory delimiters - const QString title = bundle.title().replace( '\\', '-' ); + const TQString title = bundle.title().replace( '\\', '-' ); if( cleverFilename && !title.isEmpty() ) { if( bundle.track() > 0 ) - newFilename = cleanPath( QString::number(bundle.track()) + " - " + title ) + '.' + bundle.type(); + newFilename = cleanPath( TQString::number(bundle.track()) + " - " + title ) + '.' + bundle.type(); else newFilename = cleanPath( title ) + '.' + bundle.type(); } else newFilename = cleanPath( bundle.prettyTitle() ) + '.' + bundle.type(); - const QCString dest = QFile::encodeName( cleanPath(directory + newFilename) ); + const TQCString dest = TQFile::encodeName( cleanPath(directory + newFilename) ); kapp->processEvents( 100 ); int result = uploadTrack( src, dest ); @@ -433,7 +433,7 @@ IfpMediaDevice::copyTrackToDevice( const MetaBundle& bundle ) /// File transfer methods int -IfpMediaDevice::uploadTrack( const QCString& src, const QCString& dest ) +IfpMediaDevice::uploadTrack( const TQCString& src, const TQCString& dest ) { debug() << "Transferring " << src << " to: " << dest << endl; @@ -441,7 +441,7 @@ IfpMediaDevice::uploadTrack( const QCString& src, const QCString& dest ) } int -IfpMediaDevice::downloadTrack( const QCString& src, const QCString& dest ) +IfpMediaDevice::downloadTrack( const TQCString& src, const TQCString& dest ) { debug() << "Downloading " << src << " to: " << dest << endl; @@ -452,8 +452,8 @@ void IfpMediaDevice::downloadSelectedItems() { // KConfig *config = Amarok::config( "MediaDevice" ); -// QString save = config->readEntry( "DownloadLocation", QString::null ); //restore the save directory - QString save = QString::null; +// TQString save = config->readEntry( "DownloadLocation", TQString::null ); //restore the save directory + TQString save = TQString::null; KURLRequesterDlg dialog( save, 0, 0 ); dialog.setCaption( kapp->makeStdCaption( i18n( "Choose a Download Directory" ) ) ); @@ -469,11 +469,11 @@ IfpMediaDevice::downloadSelectedItems() // if( save != destDir.path() ) // config->writeEntry( "DownloadLocation", destDir.path() ); - QListViewItemIterator it( m_view, QListViewItemIterator::Selected ); + TQListViewItemIterator it( m_view, TQListViewItemIterator::Selected ); for( ; it.current(); ++it ) { - QCString dest = QFile::encodeName( destDir.path() + (*it)->text(0) ); - QCString src = QFile::encodeName( getFullPath( *it ) ); + TQCString dest = TQFile::encodeName( destDir.path() + (*it)->text(0) ); + TQCString src = TQFile::encodeName( getFullPath( *it ) ); downloadTrack( src, dest ); } @@ -515,9 +515,9 @@ IfpMediaDevice::deleteItemFromDevice( MediaItem *item, int /*flags*/ ) { if( !item || !m_connected ) return -1; - QString path = getFullPath( item ); + TQString path = getFullPath( item ); - QCString encodedPath = QFile::encodeName( path ); + TQCString encodedPath = TQFile::encodeName( path ); int err; int count = 0; @@ -545,7 +545,7 @@ IfpMediaDevice::deleteItemFromDevice( MediaItem *item, int /*flags*/ ) /// Directory Reading void -IfpMediaDevice::expandItem( QListViewItem *item ) // SLOT +IfpMediaDevice::expandItem( TQListViewItem *item ) // SLOT { if( !item || !item->isExpandable() || m_transferring ) return; @@ -554,16 +554,16 @@ IfpMediaDevice::expandItem( QListViewItem *item ) // SLOT m_tmpParent = item; - QString path = getFullPath( item ); + TQString path = getFullPath( item ); listDir( path ); m_tmpParent = 0; } void -IfpMediaDevice::listDir( const QString &dir ) +IfpMediaDevice::listDir( const TQString &dir ) { - int err = ifp_list_dirs( &m_ifpdev, QFile::encodeName( dir ), listDirCallback, this ); + int err = ifp_list_dirs( &m_ifpdev, TQFile::encodeName( dir ), listDirCallback, this ); checkResult( err, i18n("Cannot enter directory: '%1'").arg(dir) ); } @@ -571,12 +571,12 @@ IfpMediaDevice::listDir( const QString &dir ) int IfpMediaDevice::listDirCallback( void *pData, int type, const char *name, int size ) { - QString qName = QFile::decodeName( name ); + TQString qName = TQFile::decodeName( name ); return static_cast<IfpMediaDevice *>(pData)->addTrackToList( type, qName, size ); } int -IfpMediaDevice::addTrackToList( int type, QString name, int /*size*/ ) +IfpMediaDevice::addTrackToList( int type, TQString name, int /*size*/ ) { m_tmpParent ? m_last = new IfpMediaItem( m_tmpParent ): @@ -620,15 +620,15 @@ IfpMediaDevice::getCapacity( KIO::filesize_t *total, KIO::filesize_t *available /// Helper functions QString -IfpMediaDevice::getFullPath( const QListViewItem *item, const bool getFilename ) +IfpMediaDevice::getFullPath( const TQListViewItem *item, const bool getFilename ) { - if( !item ) return QString(); + if( !item ) return TQString(); - QString path; + TQString path; if( getFilename ) path = item->text(0); - QListViewItem *parent = item->parent(); + TQListViewItem *parent = item->parent(); while( parent ) { path.prepend( "\\" ); @@ -642,7 +642,7 @@ IfpMediaDevice::getFullPath( const QListViewItem *item, const bool getFilename ) void -IfpMediaDevice::rmbPressed( QListViewItem* qitem, const QPoint& point, int ) +IfpMediaDevice::rmbPressed( TQListViewItem* qitem, const TQPoint& point, int ) { enum Actions { DOWNLOAD, DIRECTORY, RENAME, DELETE }; @@ -695,16 +695,16 @@ IfpMediaDevice::rmbPressed( QListViewItem* qitem, const QPoint& point, int ) } } -QString IfpMediaDevice::cleanPath( const QString &component ) +TQString IfpMediaDevice::cleanPath( const TQString &component ) { - QString result = Amarok::asciiPath( component ); + TQString result = Amarok::asciiPath( component ); result.simplifyWhiteSpace(); result.remove( "?" ).replace( "*", " " ).replace( ":", " " ); // if( m_spacesToUnderscores ) -// result.replace( QRegExp( "\\s" ), "_" ); +// result.replace( TQRegExp( "\\s" ), "_" ); result.replace( "/", "-" ); diff --git a/amarok/src/mediadevice/ifp/ifpmediadevice.h b/amarok/src/mediadevice/ifp/ifpmediadevice.h index d2721dd6..ff2330a6 100644 --- a/amarok/src/mediadevice/ifp/ifpmediadevice.h +++ b/amarok/src/mediadevice/ifp/ifpmediadevice.h @@ -26,7 +26,7 @@ extern "C" { #include <kurl.h> -#include <qptrlist.h> +#include <tqptrlist.h> class IfpMediaItem; class TransferDialog; @@ -41,7 +41,7 @@ class IfpMediaDevice : public MediaDevice virtual ~IfpMediaDevice(); bool isConnected() { return m_connected; } - void rmbPressed( QListViewItem* qitem, const QPoint& point, int ); + void rmbPressed( TQListViewItem* qitem, const TQPoint& point, int ); bool hasTransferDialog() { return true; } void runTransferDialog(); TransferDialog *getTransferDialog() { return m_td; } @@ -57,12 +57,12 @@ class IfpMediaDevice : public MediaDevice MediaItem *copyTrackToDevice( const MetaBundle& bundle); int deleteItemFromDevice( MediaItem *item, int flags=DeleteTrack ); bool getCapacity( KIO::filesize_t *total, KIO::filesize_t *available ); - MediaItem *newDirectory( const QString &name, MediaItem *parent ); - void addToDirectory( MediaItem *directory, QPtrList<MediaItem> items ); + MediaItem *newDirectory( const TQString &name, MediaItem *parent ); + void addToDirectory( MediaItem *directory, TQPtrList<MediaItem> items ); protected slots: - void renameItem( QListViewItem *item ); - void expandItem( QListViewItem *item ); + void renameItem( TQListViewItem *item ); + void expandItem( TQListViewItem *item ); private: enum Error { ERR_ACCESS_DENIED, ERR_CANNOT_RENAME, ERR_DISK_FULL, ERR_COULD_NOT_WRITE }; @@ -70,28 +70,28 @@ class IfpMediaDevice : public MediaDevice // Too expensive to implement on a non-database device MediaItem *trackExists( const MetaBundle& ) { return 0; } - bool checkResult( int result, QString message ); + bool checkResult( int result, TQString message ); // file transfer - MediaItem *newDirectoryRecursive( const QString &name, MediaItem *parent ); - int uploadTrack( const QCString& src, const QCString& dest ); + MediaItem *newDirectoryRecursive( const TQString &name, MediaItem *parent ); + int uploadTrack( const TQCString& src, const TQCString& dest ); void downloadSelectedItems(); - int downloadTrack( const QCString& src, const QCString& dest ); + int downloadTrack( const TQCString& src, const TQCString& dest ); // listDir - void listDir( const QString &dir ); + void listDir( const TQString &dir ); static int listDirCallback( void *pData, int type, const char *name, int size ); - int addTrackToList( int type, QString name, int size=0 ); + int addTrackToList( int type, TQString name, int size=0 ); // miscellaneous methods static int filetransferCallback( void *pData, struct ifp_transfer_status *progress ); int setProgressInfo( struct ifp_transfer_status *progress ); // Will iterate over parents and add directory name to the item. // getFilename = false will return only parent structure, as opposed to returning the filename as well - QString getFullPath( const QListViewItem *item, const bool getFilename = true ); - QString cleanPath( const QString &component ); + TQString getFullPath( const TQListViewItem *item, const bool getFilename = true ); + TQString cleanPath( const TQString &component ); - MediaItem *findChildItem( const QString &name, MediaItem *parent ); + MediaItem *findChildItem( const TQString &name, MediaItem *parent ); // IFP device struct usb_device *m_dev; @@ -102,7 +102,7 @@ class IfpMediaDevice : public MediaDevice IfpMediaItem *m_last; //used to specify new IfpMediaItem parent. Make sure it is restored to 0 (m_listview) - QListViewItem *m_tmpParent; + TQListViewItem *m_tmpParent; TransferDialog *m_td; }; diff --git a/amarok/src/mediadevice/ipod/ipodmediadevice.cpp b/amarok/src/mediadevice/ipod/ipodmediadevice.cpp index 0d09a1f7..ab54cf88 100644 --- a/amarok/src/mediadevice/ipod/ipodmediadevice.cpp +++ b/amarok/src/mediadevice/ipod/ipodmediadevice.cpp @@ -51,14 +51,14 @@ AMAROK_EXPORT_PLUGIN( IpodMediaDevice ) #include <kiconloader.h> #include <kpopupmenu.h> -#include <qcheckbox.h> -#include <qdir.h> -#include <qfileinfo.h> -#include <qlabel.h> -#include <qlineedit.h> -#include <qregexp.h> -#include <qtimer.h> -#include <qtooltip.h> +#include <tqcheckbox.h> +#include <tqdir.h> +#include <tqfileinfo.h> +#include <tqlabel.h> +#include <tqlineedit.h> +#include <tqregexp.h> +#include <tqtimer.h> +#include <tqtooltip.h> #ifdef HAVE_STATVFS #include <stdint.h> @@ -78,21 +78,21 @@ AMAROK_EXPORT_PLUGIN( IpodMediaDevice ) struct PodcastInfo { // per show - QString url; - QString description; - QDateTime date; - QString author; + TQString url; + TQString description; + TQDateTime date; + TQString author; bool listened; // per channel - QString rss; + TQString rss; PodcastInfo() { listened = false; } }; -class TrackList : public QPtrList<Itdb_Track> +class TrackList : public TQPtrList<Itdb_Track> { - int compareItems ( QPtrCollection::Item track1, QPtrCollection::Item track2 ) + int compareItems ( TQPtrCollection::Item track1, TQPtrCollection::Item track2 ) { Itdb_Track *t1 = (Itdb_Track *)track1; Itdb_Track *t2 = (Itdb_Track *)track2; @@ -107,16 +107,16 @@ class TrackList : public QPtrList<Itdb_Track> class IpodMediaItem : public MediaItem { public: - IpodMediaItem( QListView *parent, MediaDevice *dev ) + IpodMediaItem( TQListView *parent, MediaDevice *dev ) : MediaItem( parent ) { init( dev ); } - IpodMediaItem( QListViewItem *parent, MediaDevice *dev ) + IpodMediaItem( TQListViewItem *parent, MediaDevice *dev ) : MediaItem( parent ) { init( dev ); } - IpodMediaItem( QListView *parent, QListViewItem *after, MediaDevice *dev ) + IpodMediaItem( TQListView *parent, TQListViewItem *after, MediaDevice *dev ) : MediaItem( parent, after ) { init( dev ); } - IpodMediaItem( QListViewItem *parent, QListViewItem *after, MediaDevice *dev ) + IpodMediaItem( TQListViewItem *parent, TQListViewItem *after, MediaDevice *dev ) : MediaItem( parent, after ) { init( dev ); } virtual ~IpodMediaItem() { delete m_podcastInfo; } @@ -129,16 +129,16 @@ class IpodMediaItem : public MediaItem m_podcastInfo = 0; } - void bundleFromTrack( Itdb_Track *track, const QString& path ) + void bundleFromTrack( Itdb_Track *track, const TQString& path ) { MetaBundle *bundle = new MetaBundle(); - bundle->setArtist ( QString::fromUtf8( track->artist ) ); - bundle->setComposer ( QString::fromUtf8( track->composer ) ); - bundle->setAlbum ( QString::fromUtf8( track->album ) ); - bundle->setTitle ( QString::fromUtf8( track->title ) ); - bundle->setComment ( QString::fromUtf8( track->comment ) ); - bundle->setGenre ( QString::fromUtf8( track->genre ) ); + bundle->setArtist ( TQString::fromUtf8( track->artist ) ); + bundle->setComposer ( TQString::fromUtf8( track->composer ) ); + bundle->setAlbum ( TQString::fromUtf8( track->album ) ); + bundle->setTitle ( TQString::fromUtf8( track->title ) ); + bundle->setComment ( TQString::fromUtf8( track->comment ) ); + bundle->setGenre ( TQString::fromUtf8( track->genre ) ); bundle->setYear ( track->year ); bundle->setTrack ( track->track_nr ); bundle->setDiscNumber( track->cd_nr ); @@ -149,18 +149,18 @@ class IpodMediaItem : public MediaItem bundle->setPath ( path ); bundle->setFilesize ( track->size ); - QString rss( track->podcastrss ); - QString url( track->podcasturl ); - QString desc( track->description ); - QString subtitle( track->subtitle ); - QDateTime date; + TQString rss( track->podcastrss ); + TQString url( track->podcasturl ); + TQString desc( track->description ); + TQString subtitle( track->subtitle ); + TQDateTime date; date.setTime_t( itdb_time_mac_to_host( track->time_released) ); if( !rss.isEmpty() || !url.isEmpty() ) { PodcastEpisodeBundle peb( KURL::fromPathOrURL(url), KURL::fromPathOrURL(rss), - track->title, track->artist, desc, date.toString(Qt::ISODate), QString::null /*type*/, - bundle->length(), QString::null /*guid*/, track->playcount<=0 ); + track->title, track->artist, desc, date.toString(Qt::ISODate), TQString::null /*type*/, + bundle->length(), TQString::null /*guid*/, track->playcount<=0 ); bundle->setPodcastBundle( peb ); } @@ -212,9 +212,9 @@ class IpodMediaItem : public MediaItem } } - QDateTime playTime() const + TQDateTime playTime() const { - QDateTime t; + TQDateTime t; if( m_track ) t.setTime_t( itdb_time_mac_to_host( m_track->time_played ) ); return t; @@ -283,7 +283,7 @@ IpodMediaDevice::IpodMediaDevice() m_customAction->setEnabled( false ); am->setDelayed( false ); KPopupMenu *menu = am->popupMenu(); - connect( menu, SIGNAL(activated(int)), SLOT(slotIpodAction(int)) ); + connect( menu, TQT_SIGNAL(activated(int)), TQT_SLOT(slotIpodAction(int)) ); menu->insertItem( i18n( "Stale and Orphaned" ), CHECK_INTEGRITY ); menu->insertItem( i18n( "Update Artwork" ), UPDATE_ARTWORK ); @@ -309,14 +309,14 @@ IpodMediaDevice::IpodMediaDevice() { infoFound = true; gen = new KPopupMenu( ipodGen ); - connect( gen, SIGNAL(activated(int)), SLOT(slotIpodAction(int)) ); + connect( gen, TQT_SIGNAL(activated(int)), TQT_SLOT(slotIpodAction(int)) ); ipodGen->insertItem( itdb_info_get_ipod_generation_string( info->ipod_generation), gen ); } if( info->capacity > 0.f ) gen->insertItem( i18n( "%1 GB %2 (x%3)" ) - .arg( QString::number( info->capacity ), + .arg( TQString::number( info->capacity ), itdb_info_get_ipod_model_name_string( info->ipod_model ), info->model_number ), index ); @@ -364,8 +364,8 @@ IpodMediaDevice::slotIpodAction( int id ) } // try to make sure that the Device directory exists - QDir dir; - QString realPath; + TQDir dir; + TQString realPath; if(!pathExists( itunesDir(), &realPath) ) { dir.setPath(realPath); @@ -390,7 +390,7 @@ IpodMediaDevice::slotIpodAction( int id ) //FIXME: update i18n files for next message Amarok::StatusBar::instance()->shortMessage( i18n( "Unable to set iPod model to %1 GB %2 (x%3)" ) - .arg( QString::number( table[index].capacity ), + .arg( TQString::number( table[index].capacity ), itdb_info_get_ipod_model_name_string( table[index].ipod_model ), table[index].model_number ) ); } @@ -398,7 +398,7 @@ IpodMediaDevice::slotIpodAction( int id ) { Amarok::StatusBar::instance()->shortMessage( i18n( "Setting iPod model to %1 GB %2 (x%3)" ) - .arg( QString::number( table[index].capacity ), + .arg( TQString::number( table[index].capacity ), itdb_info_get_ipod_model_name_string( table[index].ipod_model ), table[index].model_number ) ); } @@ -430,7 +430,7 @@ IpodMediaDevice::isConnected() } MediaItem * -IpodMediaDevice::insertTrackIntoDB( const QString &pathname, +IpodMediaDevice::insertTrackIntoDB( const TQString &pathname, const MetaBundle &metaBundle, const MetaBundle &propertiesBundle, const PodcastInfo *podcastInfo ) { @@ -438,7 +438,7 @@ IpodMediaDevice::insertTrackIntoDB( const QString &pathname, } MediaItem * -IpodMediaDevice::updateTrackInDB( IpodMediaItem *item, const QString &pathname, +IpodMediaDevice::updateTrackInDB( IpodMediaItem *item, const TQString &pathname, const MetaBundle &metaBundle, const MetaBundle &propertiesBundle, const PodcastInfo *podcastInfo ) { @@ -456,7 +456,7 @@ IpodMediaDevice::updateTrackInDB( IpodMediaItem *item, const QString &pathname, return 0; } - QString type = pathname.section('.', -1).lower(); + TQString type = pathname.section('.', -1).lower(); track->ipod_path = g_strdup( ipodPath(pathname).latin1() ); debug() << "on iPod: " << track->ipod_path << ", podcast=" << podcastInfo << endl; @@ -499,7 +499,7 @@ IpodMediaDevice::updateTrackInDB( IpodMediaItem *item, const QString &pathname, audiobook = true; track->filetype = g_strdup( "audible" ); - TagLib::Audible::File f( QFile::encodeName( propertiesBundle.url().path() ) ); + TagLib::Audible::File f( TQFile::encodeName( propertiesBundle.url().path() ) ); TagLib::Audible::Tag *t = f.getAudibleTag(); if( t ) track->drm_userid = t->userID(); @@ -514,7 +514,7 @@ IpodMediaDevice::updateTrackInDB( IpodMediaItem *item, const QString &pathname, } - QString genre = metaBundle.genre(); + TQString genre = metaBundle.genre(); if( genre.startsWith("audiobook", false) ) audiobook = true; if( audiobook ) @@ -543,7 +543,7 @@ IpodMediaDevice::updateTrackInDB( IpodMediaItem *item, const QString &pathname, QueryBuilder qb; qb.addReturnValue( QueryBuilder::tabSong, QueryBuilder::valCreateDate ); qb.addMatch( QueryBuilder::tabSong, QueryBuilder::valURL, metaBundle.url().path() ); - QStringList values = qb.run(); + TQStringList values = qb.run(); //Add to track info if present if ( values.count() ) { @@ -564,8 +564,8 @@ IpodMediaDevice::updateTrackInDB( IpodMediaItem *item, const QString &pathname, : ITDB_MEDIATYPE_PODCAST; track->flag4 = 0x01; // also show description on iPod - QString plaindesc = podcastInfo->description; - plaindesc.replace( QRegExp("<[^>]*>"), "" ); + TQString plaindesc = podcastInfo->description; + plaindesc.replace( TQRegExp("<[^>]*>"), "" ); track->description = g_strdup( plaindesc.utf8() ); track->subtitle = g_strdup( plaindesc.utf8() ); track->podcasturl = g_strdup( podcastInfo->url.utf8() ); @@ -590,7 +590,7 @@ IpodMediaDevice::updateTrackInDB( IpodMediaItem *item, const QString &pathname, if( m_supportsArtwork ) { - QString image; + TQString image; if( metaBundle.podcastBundle() ) { PodcastChannelBundle pcb; @@ -602,7 +602,7 @@ IpodMediaDevice::updateTrackInDB( IpodMediaItem *item, const QString &pathname, if( !image.endsWith( "@nocover.png" ) ) { debug() << "adding image " << image << " to " << metaBundle.artist() << ":" << metaBundle.album() << endl; - itdb_track_set_thumbnails( track, g_strdup( QFile::encodeName(image) ) ); + itdb_track_set_thumbnails( track, g_strdup( TQFile::encodeName(image) ) ); } } @@ -661,13 +661,13 @@ IpodMediaDevice::copyTrackToDevice(const MetaBundle &bundle) KURL url = determineURLOnDevice(bundle); // check if path exists and make it if needed - QFileInfo finfo( url.path() ); - QDir dir = finfo.dir(); + TQFileInfo finfo( url.path() ); + TQDir dir = finfo.dir(); while ( !dir.exists() ) { - QString path = dir.absPath(); - QDir parentdir; - QDir create; + TQString path = dir.absPath(); + TQDir parentdir; + TQDir create; do { create.setPath(path); @@ -747,7 +747,7 @@ IpodMediaDevice::trackExists( const MetaBundle& bundle ) } MediaItem * -IpodMediaDevice::newPlaylist(const QString &name, MediaItem *parent, QPtrList<MediaItem> items) +IpodMediaDevice::newPlaylist(const TQString &name, MediaItem *parent, TQPtrList<MediaItem> items) { m_dbChanged = true; IpodMediaItem *item = new IpodMediaItem(parent, this); @@ -761,7 +761,7 @@ IpodMediaDevice::newPlaylist(const QString &name, MediaItem *parent, QPtrList<Me void -IpodMediaDevice::addToPlaylist(MediaItem *mlist, MediaItem *after, QPtrList<MediaItem> items) +IpodMediaDevice::addToPlaylist(MediaItem *mlist, MediaItem *after, TQPtrList<MediaItem> items) { IpodMediaItem *list = dynamic_cast<IpodMediaItem *>(mlist); if(!list) @@ -830,7 +830,7 @@ IpodMediaDevice::addToPlaylist(MediaItem *mlist, MediaItem *after, QPtrList<Medi add->setType(MediaItem::PLAYLISTITEM); add->m_track = it->m_track; add->bundleFromTrack( add->m_track, realPath(add->m_track->ipod_path) ); - add->setText(0, QString::fromUtf8(it->m_track->artist) + " - " + QString::fromUtf8(it->m_track->title) ); + add->setText(0, TQString::fromUtf8(it->m_track->artist) + " - " + TQString::fromUtf8(it->m_track->title) ); add->m_order = order; order++; } @@ -983,11 +983,11 @@ IpodMediaDevice::deleteItemFromDevice(MediaItem *mediaitem, int flags ) bool IpodMediaDevice::createLockFile( bool silent ) { - QString lockFilePath; + TQString lockFilePath; pathExists( itunesDir( "iTunes:iTunesLock" ), &lockFilePath ); - m_lockFile = new QFile( lockFilePath ); - QString msg; + m_lockFile = new TQFile( lockFilePath ); + TQString msg; bool ok = true; if( m_lockFile->exists() ) { @@ -999,7 +999,7 @@ IpodMediaDevice::createLockFile( bool silent ) if( !silent ) { if( KMessageBox::warningContinueCancel( m_parent, msg, i18n( "Remove iTunes Lock File?" ), - KGuiItem(i18n("&Remove"), "editdelete"), QString::null, KMessageBox::Dangerous ) + KGuiItem(i18n("&Remove"), "editdelete"), TQString::null, KMessageBox::Dangerous ) == KMessageBox::Continue ) { msg = i18n( "Media Device: removing lockfile %1 failed: %2. " ) @@ -1034,7 +1034,7 @@ IpodMediaDevice::createLockFile( bool silent ) bool IpodMediaDevice::initializeIpod() { - QDir dir( mountPoint() ); + TQDir dir( mountPoint() ); if( !dir.exists() ) { Amarok::StatusBar::instance()->longMessage( @@ -1053,7 +1053,7 @@ IpodMediaDevice::initializeIpod() // in order to get directories right detectModel(); - itdb_set_mountpoint(m_itdb, QFile::encodeName(mountPoint())); + itdb_set_mountpoint(m_itdb, TQFile::encodeName(mountPoint())); Itdb_Playlist *mpl = itdb_playlist_new("iPod", false); itdb_playlist_set_mpl(mpl); @@ -1062,7 +1062,7 @@ IpodMediaDevice::initializeIpod() itdb_playlist_add(m_itdb, podcasts, -1); itdb_playlist_add(m_itdb, mpl, 0); - QString realPath; + TQString realPath; if(!pathExists( itunesDir(), &realPath) ) { dir.setPath(realPath); @@ -1127,8 +1127,8 @@ IpodMediaDevice::openDevice( bool silent ) ++mountiter ) { canInitialize = false; - QString devicenode = (*mountiter)->mountedFrom(); - QString mountpoint = (*mountiter)->mountPoint(); + TQString devicenode = (*mountiter)->mountedFrom(); + TQString mountpoint = (*mountiter)->mountPoint(); if( mountpoint.startsWith( "/proc" ) || mountpoint.startsWith( "/sys" ) || @@ -1151,7 +1151,7 @@ IpodMediaDevice::openDevice( bool silent ) } GError *err = 0; - m_itdb = itdb_parse(QFile::encodeName(mountpoint), &err); + m_itdb = itdb_parse(TQFile::encodeName(mountpoint), &err); if( err ) { g_error_free(err); @@ -1184,7 +1184,7 @@ IpodMediaDevice::openDevice( bool silent ) if( !m_itdb && canInitialize ) { - QString msg = i18n( "Media Device: could not find iTunesDB on device mounted at %1. " + TQString msg = i18n( "Media Device: could not find iTunesDB on device mounted at %1. " "Should I try to initialize your iPod?" ).arg( mountPoint() ); if( !silent @@ -1224,12 +1224,12 @@ IpodMediaDevice::openDevice( bool silent ) for( int i=0; i < itdb_musicdirs_number(m_itdb); i++) { - QString real; - QString ipod; + TQString real; + TQString ipod; ipod.sprintf( itunesDir( "Music:f%02d" ).latin1(), i ); if(!pathExists( ipod, &real ) ) { - QDir dir( real ); + TQDir dir( real ); dir.mkdir( real ); dir.setPath( real ); if( !dir.exists() ) @@ -1364,7 +1364,7 @@ IpodMediaDevice::detectModel() #endif } if( modelString ) - m_name = QString( "iPod %1" ).arg( QString::fromUtf8( modelString ) ); + m_name = TQString( "iPod %1" ).arg( TQString::fromUtf8( modelString ) ); if( m_needsFirewireGuid ) { @@ -1452,11 +1452,11 @@ IpodMediaDevice::updateArtwork() if( !m_supportsArtwork ) return; - QPtrList<MediaItem> items; + TQPtrList<MediaItem> items; m_view->getSelectedLeaves( 0, &items, false ); int updateCount = 0; - for( QPtrList<MediaItem>::iterator it = items.begin(); + for( TQPtrList<MediaItem>::iterator it = items.begin(); it != items.end(); it++ ) { @@ -1465,7 +1465,7 @@ IpodMediaDevice::updateArtwork() continue; const MetaBundle *bundle = i->bundle(); - QString image; + TQString image; if( i->m_podcastInfo && !i->m_podcastInfo->rss.isEmpty() ) { PodcastChannelBundle pcb; @@ -1478,7 +1478,7 @@ IpodMediaDevice::updateArtwork() { debug() << "adding image " << image << " to " << bundle->artist() << ":" << bundle->album() << endl; - itdb_track_set_thumbnails( i->m_track, g_strdup( QFile::encodeName(image) ) ); + itdb_track_set_thumbnails( i->m_track, g_strdup( TQFile::encodeName(image) ) ); ++updateCount; } } @@ -1516,22 +1516,22 @@ IpodMediaDevice::checkIntegrity() addPlaylistToView( playlist ); } - QString musicpath; + TQString musicpath; if (!pathExists( itunesDir( "Music" ), &musicpath )) return false; - QDir dir( musicpath, QString::null, QDir::Unsorted, QDir::Dirs ); + TQDir dir( musicpath, TQString::null, TQDir::Unsorted, TQDir::Dirs ); for(unsigned i=0; i<dir.count(); i++) { if(dir[i] == "." || dir[i] == "..") continue; - QString hashpath = musicpath + '/' + dir[i]; - QDir hashdir( hashpath, QString::null, QDir::Unsorted, QDir::Files ); + TQString hashpath = musicpath + '/' + dir[i]; + TQDir hashdir( hashpath, TQString::null, TQDir::Unsorted, TQDir::Files ); for(unsigned j=0; j<hashdir.count(); j++) { - QString filename = hashpath + '/' + hashdir[j]; - QString ipodPath = itunesDir( "Music:" ) + dir[i] + ':' + hashdir[j]; + TQString filename = hashpath + '/' + hashdir[j]; + TQString ipodPath = itunesDir( "Music:" ) + dir[i] + ':' + hashdir[j]; Itdb_Track *track = m_files[ipodPath.lower()]; if(!track) { @@ -1541,7 +1541,7 @@ IpodMediaDevice::checkIntegrity() KURL url = KURL::fromPathOrURL(filename); MetaBundle *bundle = new MetaBundle(url); item->setBundle( bundle ); - QString title = bundle->artist() + " - " + bundle->title(); + TQString title = bundle->artist() + " - " + bundle->title(); item->setText(0, title); } } @@ -1589,7 +1589,7 @@ IpodMediaDevice::closeDevice() //SLOT } void -IpodMediaDevice::renameItem( QListViewItem *i ) // SLOT +IpodMediaDevice::renameItem( TQListViewItem *i ) // SLOT { IpodMediaItem *item = dynamic_cast<IpodMediaItem *>(i); if(!item) @@ -1641,14 +1641,14 @@ IpodMediaDevice::addTrackToView(Itdb_Track *track, IpodMediaItem *item, bool che else item = new IpodMediaItem(m_staleItem, this); item->setType(MediaItem::STALE); - QString title = QString::fromUtf8(track->artist) + " - " - + QString::fromUtf8(track->title); + TQString title = TQString::fromUtf8(track->artist) + " - " + + TQString::fromUtf8(track->title); item->setText( 0, title ); item->m_track = track; } else { - m_files.insert( QString(track->ipod_path).lower(), track ); + m_files.insert( TQString(track->ipod_path).lower(), track ); } } @@ -1657,11 +1657,11 @@ IpodMediaDevice::addTrackToView(Itdb_Track *track, IpodMediaItem *item, bool che { visible = true; - QString artistName; + TQString artistName; if( track->compilation ) artistName = i18n( "Various Artists" ); else - artistName = QString::fromUtf8(track->artist); + artistName = TQString::fromUtf8(track->artist); IpodMediaItem *artist = getArtist(artistName); if(!artist) @@ -1673,7 +1673,7 @@ IpodMediaDevice::addTrackToView(Itdb_Track *track, IpodMediaItem *item, bool che artist->m_order = -1; } - QString albumName(QString::fromUtf8(track->album)); + TQString albumName(TQString::fromUtf8(track->album)); MediaItem *album = artist->findItem(albumName); if(!album) { @@ -1688,9 +1688,9 @@ IpodMediaDevice::addTrackToView(Itdb_Track *track, IpodMediaItem *item, bool che { item = new IpodMediaItem( album, this ); } - QString titleName = QString::fromUtf8(track->title); + TQString titleName = TQString::fromUtf8(track->title); if( track->compilation ) - item->setText( 0, QString::fromUtf8(track->artist) + i18n( " - " ) + titleName ); + item->setText( 0, TQString::fromUtf8(track->artist) + i18n( " - " ) + titleName ); else item->setText( 0, titleName ); item->setType( MediaItem::TRACK ); @@ -1703,7 +1703,7 @@ IpodMediaDevice::addTrackToView(Itdb_Track *track, IpodMediaItem *item, bool che { visible = true; - QString channelName(QString::fromUtf8(track->album)); + TQString channelName(TQString::fromUtf8(track->album)); IpodMediaItem *channel = dynamic_cast<IpodMediaItem *>(m_podcastItem->findItem(channelName)); if(!channel) { @@ -1717,16 +1717,16 @@ IpodMediaDevice::addTrackToView(Itdb_Track *track, IpodMediaItem *item, bool che channel->insertItem( item ); else item = new IpodMediaItem( channel, this ); - item->setText( 0, QString::fromUtf8(track->title) ); + item->setText( 0, TQString::fromUtf8(track->title) ); item->setType( MediaItem::PODCASTITEM ); item->m_track = track; item->bundleFromTrack( track, realPath(track->ipod_path) ); PodcastInfo *info = new PodcastInfo; item->m_podcastInfo = info; - info->url = QString::fromUtf8( track->podcasturl ); - info->rss = QString::fromUtf8( track->podcastrss ); - info->description = QString::fromUtf8( track->description ); + info->url = TQString::fromUtf8( track->podcasturl ); + info->rss = TQString::fromUtf8( track->podcastrss ); + info->description = TQString::fromUtf8( track->description ); info->date.setTime_t( itdb_time_mac_to_host( track->time_released) ); if( !info->rss.isEmpty() && channel->m_podcastInfo->rss.isEmpty() ) @@ -1742,8 +1742,8 @@ IpodMediaDevice::addTrackToView(Itdb_Track *track, IpodMediaItem *item, bool che m_invisibleItem->insertItem( item ); else item = new IpodMediaItem(m_invisibleItem, this); - QString title = QString::fromUtf8(track->artist) + " - " - + QString::fromUtf8(track->title); + TQString title = TQString::fromUtf8(track->artist) + " - " + + TQString::fromUtf8(track->title); item->setText( 0, title ); item->setType( MediaItem::INVISIBLE ); item->m_track = track; @@ -1776,7 +1776,7 @@ IpodMediaDevice::addPlaylistToView( Itdb_Playlist *pl ) debug() << "playlist " << pl->name << " is a smart playlist" << endl; } - QString name( QString::fromUtf8(pl->name) ); + TQString name( TQString::fromUtf8(pl->name) ); IpodMediaItem *playlist = dynamic_cast<IpodMediaItem *>(m_playlistItem->findItem(name)); if( !playlist ) { @@ -1792,8 +1792,8 @@ IpodMediaDevice::addPlaylistToView( Itdb_Playlist *pl ) { Itdb_Track *track = (Itdb_Track *)cur->data; IpodMediaItem *item = new IpodMediaItem(playlist, this); - QString title = QString::fromUtf8(track->artist) + " - " - + QString::fromUtf8(track->title); + TQString title = TQString::fromUtf8(track->artist) + " - " + + TQString::fromUtf8(track->title); item->setText( 0, title ); item->setType( MediaItem::PLAYLISTITEM ); item->m_playlist = pl; @@ -1807,9 +1807,9 @@ IpodMediaDevice::addPlaylistToView( Itdb_Playlist *pl ) } QString -IpodMediaDevice::itunesDir(const QString &p) const +IpodMediaDevice::itunesDir(const TQString &p) const { - QString base( ":iPod_Control" ); + TQString base( ":iPod_Control" ); if( m_isMobile ) base = ":iTunes:iTunes_Control"; else if( m_isIPhone ) @@ -1823,38 +1823,38 @@ IpodMediaDevice::itunesDir(const QString &p) const QString IpodMediaDevice::realPath(const char *ipodPath) { - QString path; + TQString path; if(m_itdb) { - path = QFile::decodeName(itdb_get_mountpoint(m_itdb)); - path.append(QString(ipodPath).replace(':', "/")); + path = TQFile::decodeName(itdb_get_mountpoint(m_itdb)); + path.append(TQString(ipodPath).replace(':', "/")); } return path; } QString -IpodMediaDevice::ipodPath(const QString &realPath) +IpodMediaDevice::ipodPath(const TQString &realPath) { if(m_itdb) { - QString mp = QFile::decodeName(itdb_get_mountpoint(m_itdb)); + TQString mp = TQFile::decodeName(itdb_get_mountpoint(m_itdb)); if(realPath.startsWith(mp)) { - QString path = realPath; + TQString path = realPath; path = path.mid(mp.length()); path = path.replace('/', ":"); return path; } } - return QString(); + return TQString(); } class IpodWriteDBJob : public ThreadManager::DependentJob { public: - IpodWriteDBJob( QObject *parent, Itdb_iTunesDB *itdb, bool isShuffle, bool *resultPtr ) + IpodWriteDBJob( TQObject *parent, Itdb_iTunesDB *itdb, bool isShuffle, bool *resultPtr ) : ThreadManager::DependentJob( parent, "IpodWriteDBJob" ) , m_itdb( itdb ) , m_isShuffle( isShuffle ) @@ -1995,7 +1995,7 @@ IpodMediaDevice::writeITunesDB( bool threaded ) IpodMediaItem * -IpodMediaDevice::getArtist(const QString &artist) +IpodMediaDevice::getArtist(const TQString &artist) { for(IpodMediaItem *it = dynamic_cast<IpodMediaItem *>(m_view->firstChild()); it; @@ -2009,7 +2009,7 @@ IpodMediaDevice::getArtist(const QString &artist) } IpodMediaItem * -IpodMediaDevice::getAlbum(const QString &artist, const QString &album) +IpodMediaDevice::getAlbum(const TQString &artist, const TQString &album) { IpodMediaItem *item = getArtist(artist); if(item) @@ -2019,7 +2019,7 @@ IpodMediaDevice::getAlbum(const QString &artist, const QString &album) } IpodMediaItem * -IpodMediaDevice::getTrack(const QString &artist, const QString &album, const QString &title, +IpodMediaDevice::getTrack(const TQString &artist, const TQString &album, const TQString &title, int discNumber, int trackNumber, const PodcastEpisodeBundle *peb) { IpodMediaItem *item = getAlbum(artist, album); @@ -2038,7 +2038,7 @@ IpodMediaDevice::getTrack(const QString &artist, const QString &album, const QSt item = getAlbum( i18n( "Various Artists" ), album ); if( item ) { - QString t = artist + i18n(" - ") + title; + TQString t = artist + i18n(" - ") + title; for( IpodMediaItem *track = dynamic_cast<IpodMediaItem *>(item->findItem(t)); track; track = dynamic_cast<IpodMediaItem *>(item->findItem(t, track)) ) @@ -2073,9 +2073,9 @@ IpodMediaDevice::getTrack(const QString &artist, const QString &album, const QSt IpodMediaItem * IpodMediaDevice::getTrack( const Itdb_Track *itrack ) { - QString artist = QString::fromUtf8( itrack->artist ); - QString album = QString::fromUtf8( itrack->album ); - QString title = QString::fromUtf8( itrack->title ); + TQString artist = TQString::fromUtf8( itrack->artist ); + TQString album = TQString::fromUtf8( itrack->album ); + TQString title = TQString::fromUtf8( itrack->title ); IpodMediaItem *item = getAlbum( artist, album ); if(item) @@ -2092,7 +2092,7 @@ IpodMediaDevice::getTrack( const Itdb_Track *itrack ) item = getAlbum( i18n( "Various Artists" ), album ); if( item ) { - QString t = artist + i18n(" - ") + title; + TQString t = artist + i18n(" - ") + title; for( IpodMediaItem *track = dynamic_cast<IpodMediaItem *>(item->findItem(t)); track; track = dynamic_cast<IpodMediaItem *>(item->findItem(t, track)) ) @@ -2130,25 +2130,25 @@ IpodMediaDevice::determineURLOnDevice(const MetaBundle &bundle) return KURL(); } - QString local = bundle.filename(); - QString type = local.section('.', -1).lower(); + TQString local = bundle.filename(); + TQString type = local.section('.', -1).lower(); - QString trackpath; - QString realpath; + TQString trackpath; + TQString realpath; do { int num = std::rand() % 1000000; int music_dirs = itdb_musicdirs_number(m_itdb) > 1 ? itdb_musicdirs_number(m_itdb) : 20; int dir = num % music_dirs; - QString dirname; + TQString dirname; dirname.sprintf( "%s:Music:f%02d", itunesDir().latin1(), dir ); if( !pathExists( dirname ) ) { - QString realdir = realPath(dirname.latin1()); - QDir qdir( realdir ); + TQString realdir = realPath(dirname.latin1()); + TQDir qdir( realdir ); qdir.mkdir( realdir ); } - QString filename; + TQString filename; filename.sprintf( ":kpod%07d.%s", num, type.latin1() ); trackpath = dirname + filename; } @@ -2203,12 +2203,12 @@ IpodMediaDevice::getCapacity( KIO::filesize_t *total, KIO::filesize_t *available return false; #ifdef HAVE_STATVFS - QString path; + TQString path; if ( !pathExists( itunesDir(), &path ) ) return false; struct statvfs buf; - if(statvfs(QFile::encodeName(path), &buf) != 0) + if(statvfs(TQFile::encodeName(path), &buf) != 0) { *total = 0; *available = 0; @@ -2225,7 +2225,7 @@ IpodMediaDevice::getCapacity( KIO::filesize_t *total, KIO::filesize_t *available } void -IpodMediaDevice::rmbPressed( QListViewItem* qitem, const QPoint& point, int ) +IpodMediaDevice::rmbPressed( TQListViewItem* qitem, const TQPoint& point, int ) { MediaItem *item = dynamic_cast<MediaItem *>(qitem); bool locked = m_mutex.locked(); @@ -2377,7 +2377,7 @@ IpodMediaDevice::rmbPressed( QListViewItem* qitem, const QPoint& point, int ) break; case COPY_TO_COLLECTION: { - QPtrList<MediaItem> items; + TQPtrList<MediaItem> items; m_view->getSelectedLeaves( 0, &items ); KURL::List urls; @@ -2433,15 +2433,15 @@ IpodMediaDevice::rmbPressed( QListViewItem* qitem, const QPoint& point, int ) case CREATE_PLAYLIST: case MAKE_PLAYLIST: { - QPtrList<MediaItem> items; + TQPtrList<MediaItem> items; if( id == MAKE_PLAYLIST ) m_view->getSelectedLeaves( 0, &items ); - QString base(i18n("New Playlist")); - QString name = base; + TQString base(i18n("New Playlist")); + TQString name = base; int i=1; while(m_playlistItem->findItem(name)) { - QString num; + TQString num; num.setNum(i); name = base + ' ' + num; i++; @@ -2476,9 +2476,9 @@ IpodMediaDevice::rmbPressed( QListViewItem* qitem, const QPoint& point, int ) } else { - QPtrList<MediaItem> items; + TQPtrList<MediaItem> items; m_view->getSelectedLeaves( 0, &items ); - for( QPtrList<MediaItem>::iterator it = items.begin(); + for( TQPtrList<MediaItem>::iterator it = items.begin(); it != items.end(); it++ ) { @@ -2523,8 +2523,8 @@ IpodMediaDevice::rmbPressed( QListViewItem* qitem, const QPoint& point, int ) default: if( playlistsMenu && id >= FIRST_PLAYLIST ) { - QString name = playlistsMenu->text(id); - if( name != QString::null ) + TQString name = playlistsMenu->text(id); + if( name != TQString::null ) { MediaItem *list = m_playlistItem->findItem(name); if(list) @@ -2534,7 +2534,7 @@ IpodMediaDevice::rmbPressed( QListViewItem* qitem, const QPoint& point, int ) it; it = dynamic_cast<MediaItem *>(it->nextSibling())) after = it; - QPtrList<MediaItem> items; + TQPtrList<MediaItem> items; m_view->getSelectedLeaves( 0, &items ); addToPlaylist( list, after, items ); } @@ -2554,7 +2554,7 @@ IpodMediaDevice::rmbPressed( QListViewItem* qitem, const QPoint& point, int ) QStringList IpodMediaDevice::supportedFiletypes() { - QStringList list; + TQStringList list; list << "mp3"; list << "m4a"; list << "m4b"; @@ -2590,21 +2590,21 @@ IpodMediaDevice::supportedFiletypes() } void -IpodMediaDevice::addConfigElements( QWidget *parent ) +IpodMediaDevice::addConfigElements( TQWidget *parent ) { - m_autoDeletePodcastsCheck = new QCheckBox( parent ); + m_autoDeletePodcastsCheck = new TQCheckBox( parent ); m_autoDeletePodcastsCheck->setText( i18n( "&Automatically delete podcasts" ) ); - QToolTip::add( m_autoDeletePodcastsCheck, i18n( "Automatically delete podcast shows already played when connecting device" ) ); + TQToolTip::add( m_autoDeletePodcastsCheck, i18n( "Automatically delete podcast shows already played when connecting device" ) ); m_autoDeletePodcastsCheck->setChecked( m_autoDeletePodcasts ); - m_syncStatsCheck = new QCheckBox( parent ); + m_syncStatsCheck = new TQCheckBox( parent ); m_syncStatsCheck->setText( i18n( "&Synchronize with Amarok statistics" ) ); - QToolTip::add( m_syncStatsCheck, i18n( "Synchronize with Amarok statistics and submit tracks played to last.fm" ) ); + TQToolTip::add( m_syncStatsCheck, i18n( "Synchronize with Amarok statistics and submit tracks played to last.fm" ) ); m_syncStatsCheck->setChecked( m_syncStats ); } void -IpodMediaDevice::removeConfigElements( QWidget * /*parent*/ ) +IpodMediaDevice::removeConfigElements( TQWidget * /*parent*/ ) { delete m_syncStatsCheck; m_syncStatsCheck = 0; @@ -2635,15 +2635,15 @@ IpodMediaDevice::loadConfig() } bool -IpodMediaDevice::pathExists( const QString &ipodPath, QString *realPath ) +IpodMediaDevice::pathExists( const TQString &ipodPath, TQString *realPath ) { - QDir curDir( mountPoint() ); - curDir.setFilter(curDir.filter() | QDir::Hidden); - QString curPath = mountPoint(); - QStringList components = QStringList::split( ":", ipodPath ); + TQDir curDir( mountPoint() ); + curDir.setFilter(curDir.filter() | TQDir::Hidden); + TQString curPath = mountPoint(); + TQStringList components = TQStringList::split( ":", ipodPath ); bool found = false; - QStringList::iterator it = components.begin(); + TQStringList::iterator it = components.begin(); for( ; it != components.end(); ++it ) { found = false; @@ -2689,8 +2689,8 @@ IpodMediaDevice::deleteFile( const KURL &url ) debug() << "deleting " << url.prettyURL() << endl; m_waitForDeletion = true; KIO::Job *job = KIO::file_delete( url, false ); - connect( job, SIGNAL( result( KIO::Job * ) ), - this, SLOT( fileDeleted( KIO::Job * ) ) ); + connect( job, TQT_SIGNAL( result( KIO::Job * ) ), + this, TQT_SLOT( fileDeleted( KIO::Job * ) ) ); do { kapp->processEvents( 100 ); diff --git a/amarok/src/mediadevice/ipod/ipodmediadevice.h b/amarok/src/mediadevice/ipod/ipodmediadevice.h index bb38fea8..7f994c91 100644 --- a/amarok/src/mediadevice/ipod/ipodmediadevice.h +++ b/amarok/src/mediadevice/ipod/ipodmediadevice.h @@ -32,16 +32,16 @@ extern "C" { #include "mediabrowser.h" -#include <qmutex.h> -#include <qptrlist.h> -#include <qdict.h> +#include <tqmutex.h> +#include <tqptrlist.h> +#include <tqdict.h> #include <kio/job.h> -class QCheckBox; -class QLabel; -class QLineEdit; -class QFile; +class TQCheckBox; +class TQLabel; +class TQLineEdit; +class TQFile; class KAction; @@ -59,12 +59,12 @@ class IpodMediaDevice : public MediaDevice virtual ~IpodMediaDevice(); virtual bool autoConnect() { return m_autoConnect; } virtual bool asynchronousTransfer() { return false; /* kernel buffer flushes freeze Amarok */ } - QStringList supportedFiletypes(); + TQStringList supportedFiletypes(); bool isConnected(); - virtual void addConfigElements( QWidget *parent ); - virtual void removeConfigElements( QWidget *parent ); + virtual void addConfigElements( TQWidget *parent ); + virtual void removeConfigElements( TQWidget *parent ); virtual void applyConfig(); virtual void loadConfig(); virtual MediaItem*tagsChanged( MediaItem *item, const MetaBundle &bundle ); @@ -89,11 +89,11 @@ class IpodMediaDevice : public MediaDevice * @param podcastInfo PodcastInfo of track if it is a podcast, 0 otherwise * @return If successful, the created MediaItem in the media device view, else 0 */ - virtual MediaItem *insertTrackIntoDB( const QString &pathname, + virtual MediaItem *insertTrackIntoDB( const TQString &pathname, const MetaBundle &metaBundle, const MetaBundle &propertiesBundle, const PodcastInfo *podcastInfo ); - virtual MediaItem *updateTrackInDB( IpodMediaItem *item, const QString &pathname, + virtual MediaItem *updateTrackInDB( IpodMediaItem *item, const TQString &pathname, const MetaBundle &metaBundle, const MetaBundle &propertiesBundle, const PodcastInfo *podcastInfo ); @@ -107,15 +107,15 @@ class IpodMediaDevice : public MediaDevice void synchronizeDevice(); int deleteItemFromDevice( MediaItem *item, int flags=DeleteTrack ); virtual void deleteFile( const KURL &url ); - void addToPlaylist( MediaItem *list, MediaItem *after, QPtrList<MediaItem> items ); - MediaItem *newPlaylist( const QString &name, MediaItem *list, QPtrList<MediaItem> items ); + void addToPlaylist( MediaItem *list, MediaItem *after, TQPtrList<MediaItem> items ); + MediaItem *newPlaylist( const TQString &name, MediaItem *list, TQPtrList<MediaItem> items ); bool getCapacity( KIO::filesize_t *total, KIO::filesize_t *available ); - void rmbPressed( QListViewItem* qitem, const QPoint& point, int ); + void rmbPressed( TQListViewItem* qitem, const TQPoint& point, int ); bool checkIntegrity(); void updateArtwork(); protected slots: - void renameItem( QListViewItem *item ); + void renameItem( TQListViewItem *item ); virtual void fileDeleted( KIO::Job *job ); private: @@ -127,15 +127,15 @@ class IpodMediaDevice : public MediaDevice void addPlaylistToView( Itdb_Playlist *playlist ); void playlistFromItem( IpodMediaItem *item ); - QString itunesDir( const QString &path = QString::null ) const; - QString realPath( const char *ipodPath ); - QString ipodPath( const QString &realPath ); - bool pathExists( const QString &ipodPath, QString *realPath=0 ); + TQString itunesDir( const TQString &path = TQString::null ) const; + TQString realPath( const char *ipodPath ); + TQString ipodPath( const TQString &realPath ); + bool pathExists( const TQString &ipodPath, TQString *realPath=0 ); // ipod database Itdb_iTunesDB *m_itdb; Itdb_Playlist *m_masterPlaylist; - QDict<Itdb_Track> m_files; + TQDict<Itdb_Track> m_files; // podcasts Itdb_Playlist* m_podcastPlaylist; @@ -149,10 +149,10 @@ class IpodMediaDevice : public MediaDevice bool m_needsFirewireGuid; bool m_autoConnect; - IpodMediaItem *getArtist( const QString &artist ); - IpodMediaItem *getAlbum( const QString &artist, const QString &album ); - IpodMediaItem *getTrack( const QString &artist, const QString &album, - const QString &title, + IpodMediaItem *getArtist( const TQString &artist ); + IpodMediaItem *getAlbum( const TQString &artist, const TQString &album ); + IpodMediaItem *getTrack( const TQString &artist, const TQString &album, + const TQString &title, int discNumber = -1, int trackNumber = -1, const PodcastEpisodeBundle *peb = 0 ); IpodMediaItem *getTrack( const Itdb_Track *itrack ); @@ -161,10 +161,10 @@ class IpodMediaDevice : public MediaDevice bool m_dbChanged; - QCheckBox *m_syncStatsCheck; - QCheckBox *m_autoDeletePodcastsCheck; - QFile *m_lockFile; - QMutex m_mutex; + TQCheckBox *m_syncStatsCheck; + TQCheckBox *m_autoDeletePodcastsCheck; + TQFile *m_lockFile; + TQMutex m_mutex; KAction *m_customAction; enum { CHECK_INTEGRITY, UPDATE_ARTWORK, SET_IPOD_MODEL }; diff --git a/amarok/src/mediadevice/mtp/mtpmediadevice.cpp b/amarok/src/mediadevice/mtp/mtpmediadevice.cpp index ca015273..42de70c3 100644 --- a/amarok/src/mediadevice/mtp/mtpmediadevice.cpp +++ b/amarok/src/mediadevice/mtp/mtpmediadevice.cpp @@ -45,13 +45,13 @@ AMAROK_EXPORT_PLUGIN( MtpMediaDevice ) #include <ktempdir.h> // Qt -#include <qdir.h> -#include <qlistview.h> -#include <qtooltip.h> -#include <qlineedit.h> -#include <qregexp.h> -#include <qbuffer.h> -#include <qmap.h> +#include <tqdir.h> +#include <tqlistview.h> +#include <tqtooltip.h> +#include <tqlineedit.h> +#include <tqregexp.h> +#include <tqbuffer.h> +#include <tqmap.h> /** * MtpMediaDevice Class @@ -75,8 +75,8 @@ MtpMediaDevice::MtpMediaDevice() : MediaDevice() KToolBarButton *customButton = MediaBrowser::instance()->getToolBar()->getButton( MediaBrowser::CUSTOM ); customButton->setText( i18n("Special device functions") ); - QToolTip::remove( customButton ); - QToolTip::add( customButton, i18n( "Special functions of your device" ) ); + TQToolTip::remove( customButton ); + TQToolTip::add( customButton, i18n( "Special functions of your device" ) ); mtpFileTypes[LIBMTP_FILETYPE_WAV] = "wav"; mtpFileTypes[LIBMTP_FILETYPE_MP3] = "mp3"; @@ -108,7 +108,7 @@ MtpMediaDevice::MtpMediaDevice() : MediaDevice() mtpFileTypes[LIBMTP_FILETYPE_HTML] = "html"; mtpFileTypes[LIBMTP_FILETYPE_UNKNOWN] = "unknown"; - m_newTracks = new QPtrList<MediaItem>; + m_newTracks = new TQPtrList<MediaItem>; } void @@ -161,7 +161,7 @@ MediaItem { DEBUG_BLOCK - QString genericError = i18n( "Could not send track" ); + TQString genericError = i18n( "Could not send track" ); LIBMTP_track_t *trackmeta = LIBMTP_new_track_t(); trackmeta->item_id = 0; @@ -188,7 +188,7 @@ MediaItem // fallback to checking the extension (e.g. .wma, .ogg, etc) debug() << "No filetype found by Amarok filetype" << endl; - const QString extension = bundle.url().path().section( ".", -1 ).lower(); + const TQString extension = bundle.url().path().section( ".", -1 ).lower(); int libmtp_type = m_supportedFiles.findIndex( extension ); if( libmtp_type >= 0 ) @@ -248,8 +248,8 @@ MediaItem if( bundle.year() > 0 ) { - QString date; - QTextOStream( &date ) << bundle.year() << "0101T0000.0"; + TQString date; + TQTextOStream( &date ) << bundle.year() << "0101T0000.0"; trackmeta->date = qstrdup( date.utf8() ); } else @@ -334,14 +334,14 @@ MediaItem * device and set it as the cover art. */ void -MtpMediaDevice::sendAlbumArt( QPtrList<MediaItem> *items ) +MtpMediaDevice::sendAlbumArt( TQPtrList<MediaItem> *items ) { - QString image; + TQString image; image = CollectionDB::instance()->albumImage(items->first()->bundle()->artist(), items->first()->bundle()->album(), false, 100); if( ! image.endsWith( "@nocover.png" ) ) { debug() << "image " << image << " found for " << items->first()->bundle()->album() << endl; - QByteArray *imagedata = getSupportedImage( image ); + TQByteArray *imagedata = getSupportedImage( image ); if( imagedata == 0 ) { debug() << "Cannot generate a supported image format" << endl; @@ -400,7 +400,7 @@ MtpMediaDevice::getDefaultParentId( void ) * supported on the device */ QByteArray -*MtpMediaDevice::getSupportedImage( QString path ) +*MtpMediaDevice::getSupportedImage( TQString path ) { if( m_format == 0 ) return 0; @@ -408,12 +408,12 @@ QByteArray debug() << "Will convert image to " << m_format << endl; // open image - const QImage original( path ); + const TQImage original( path ); // save as new image - QImage newformat( original ); - QByteArray *newimage = new QByteArray(); - QBuffer buffer( *newimage ); + TQImage newformat( original ); + TQByteArray *newimage = new TQByteArray(); + TQBuffer buffer( *newimage ); buffer.open( IO_WriteOnly ); if( newformat.save( &buffer, m_format.ascii() ) ) { @@ -427,7 +427,7 @@ QByteArray * Update cover art for a number of tracks */ void -MtpMediaDevice::updateAlbumArt( QPtrList<MediaItem> *items ) +MtpMediaDevice::updateAlbumArt( TQPtrList<MediaItem> *items ) { DEBUG_BLOCK @@ -437,7 +437,7 @@ MtpMediaDevice::updateAlbumArt( QPtrList<MediaItem> *items ) setCanceled( false ); kapp->processEvents( 100 ); - QMap< QString, QPtrList<MediaItem> > albumList; + TQMap< TQString, TQPtrList<MediaItem> > albumList; for( MtpMediaItem *it = dynamic_cast<MtpMediaItem*>(items->first()); it && !(m_canceled); it = dynamic_cast<MtpMediaItem*>(items->next()) ) { @@ -454,7 +454,7 @@ MtpMediaDevice::updateAlbumArt( QPtrList<MediaItem> *items ) int i = 0; setProgress( i, albumList.count() ); kapp->processEvents( 100 ); - QMap< QString, QPtrList<MediaItem> >::Iterator it; + TQMap< TQString, TQPtrList<MediaItem> >::Iterator it; for( it = albumList.begin(); it != albumList.end(); ++it ) { sendAlbumArt( &it.data() ); @@ -469,12 +469,12 @@ MtpMediaDevice::updateAlbumArt( QPtrList<MediaItem> *items ) * Retrieve existing or create new album object. */ LIBMTP_album_t -*MtpMediaDevice::getOrCreateAlbum( QPtrList<MediaItem> *items )//uint32_t track_id, const MetaBundle &bundle ) +*MtpMediaDevice::getOrCreateAlbum( TQPtrList<MediaItem> *items )//uint32_t track_id, const MetaBundle &bundle ) { LIBMTP_album_t *album_object = 0; uint32_t albumid = 0; int ret; - QMap<uint32_t,MtpAlbum*>::Iterator it; + TQMap<uint32_t,MtpAlbum*>::Iterator it; for( it = m_idToAlbum.begin(); it != m_idToAlbum.end(); ++it ) { if( it.data()->album() == items->first()->bundle()->album() ) @@ -548,29 +548,29 @@ LIBMTP_album_t uint32_t MtpMediaDevice::checkFolderStructure( const MetaBundle &bundle, bool create ) { - QString artist = bundle.artist(); + TQString artist = bundle.artist(); if( artist.isEmpty() ) artist = i18n( "Unknown Artist" ); if( bundle.compilation() == MetaBundle::CompilationYes ) artist = i18n( "Various Artists" ); - QString album = bundle.album(); + TQString album = bundle.album(); if( album.isEmpty() ) album = i18n( "Unknown Album" ); - QString genre = bundle.genre(); + TQString genre = bundle.genre(); if( genre.isEmpty() ) genre = i18n( "Unknown Genre" ); m_critical_mutex.lock(); uint32_t parent_id = getDefaultParentId(); - QStringList folders = QStringList::split( "/", m_folderStructure ); // use slash as a dir separator - QString completePath; - for( QStringList::Iterator it = folders.begin(); it != folders.end(); ++it ) + TQStringList folders = TQStringList::split( "/", m_folderStructure ); // use slash as a dir separator + TQString completePath; + for( TQStringList::Iterator it = folders.begin(); it != folders.end(); ++it ) { if( (*it).isEmpty() ) continue; // substitute %a , %b , %g - (*it).replace( QRegExp( "%a" ), artist ) - .replace( QRegExp( "%b" ), album ) - .replace( QRegExp( "%g" ), genre ); + (*it).replace( TQRegExp( "%a" ), artist ) + .replace( TQRegExp( "%b" ), album ) + .replace( TQRegExp( "%g" ), genre ); // check if it exists uint32_t check_folder = subfolderNameToID( (*it).utf8(), m_folders, parent_id ); // create if not exists (if requested) @@ -675,13 +675,13 @@ MtpMediaDevice::folderNameToID( char *name, LIBMTP_folder_t *folderlist ) int MtpMediaDevice::downloadSelectedItemsToCollection() { - QPtrList<MediaItem> items; + TQPtrList<MediaItem> items; m_view->getSelectedLeaves( 0, &items ); - KTempDir tempdir( QString::null ); + KTempDir tempdir( TQString::null ); tempdir.setAutoDelete( true ); KURL::List urls; - QString genericError = i18n( "Could not copy track from device." ); + TQString genericError = i18n( "Could not copy track from device." ); int total,progress; total = items.count(); @@ -695,7 +695,7 @@ MtpMediaDevice::downloadSelectedItemsToCollection() { if( it->type() == MediaItem::TRACK ) { - QString filename = tempdir.name() + it->bundle()->filename(); + TQString filename = tempdir.name() + it->bundle()->filename(); int ret = LIBMTP_Get_Track_To_File( m_device, it->track()->id(), filename.utf8(), progressCallback, this @@ -756,7 +756,7 @@ MediaItem } } uint32_t folderId = checkFolderStructure( bundle, false ); - MediaItem *file = m_fileNameToItem[ QString( "%1/%2" ).arg( folderId ).arg( bundle.filename() ) ]; + MediaItem *file = m_fileNameToItem[ TQString( "%1/%2" ).arg( folderId ).arg( bundle.filename() ) ]; if( file != 0 ) return file; return 0; @@ -766,7 +766,7 @@ MediaItem * Create a new playlist */ MtpMediaItem -*MtpMediaDevice::newPlaylist( const QString &name, MediaItem *parent, QPtrList<MediaItem> items ) +*MtpMediaDevice::newPlaylist( const TQString &name, MediaItem *parent, TQPtrList<MediaItem> items ) { DEBUG_BLOCK MtpMediaItem *item = new MtpMediaItem( parent, this ); @@ -786,7 +786,7 @@ MtpMediaItem * Add an item to a playlist */ void -MtpMediaDevice::addToPlaylist( MediaItem *mlist, MediaItem *after, QPtrList<MediaItem> items ) +MtpMediaDevice::addToPlaylist( MediaItem *mlist, MediaItem *after, TQPtrList<MediaItem> items ) { DEBUG_BLOCK MtpMediaItem *list = dynamic_cast<MtpMediaItem *>( mlist ); @@ -871,7 +871,7 @@ MtpMediaDevice::addToPlaylist( MediaItem *mlist, MediaItem *after, QPtrList<Medi * When a playlist has been renamed, we must save it */ void -MtpMediaDevice::playlistRenamed( QListViewItem *item, const QString &, int ) // SLOT +MtpMediaDevice::playlistRenamed( TQListViewItem *item, const TQString &, int ) // SLOT { DEBUG_BLOCK MtpMediaItem *playlist = static_cast<MtpMediaItem*>( item ); @@ -909,7 +909,7 @@ MtpMediaDevice::playlistFromItem( MtpMediaItem *item ) metadata->no_tracks = 0; } - QString genericError = i18n( "Could not save playlist." ); + TQString genericError = i18n( "Could not save playlist." ); if( item->playlist()->id() == 0 ) { @@ -1028,7 +1028,7 @@ MtpMediaDevice::deleteObject( MtpMediaItem *deleteItem ) else object_id = deleteItem->track()->id(); - QString genericError = i18n( "Could not delete item" ); + TQString genericError = i18n( "Could not delete item" ); debug() << "delete this id : " << object_id << endl; @@ -1050,7 +1050,7 @@ MtpMediaDevice::deleteObject( MtpMediaItem *deleteItem ) // clear cached filename if( deleteItem->type() == MediaItem::TRACK ) - m_fileNameToItem.remove( QString( "%1/%2" ).arg( deleteItem->track()->folderId() ).arg( deleteItem->bundle()->filename() ) ); + m_fileNameToItem.remove( TQString( "%1/%2" ).arg( deleteItem->track()->folderId() ).arg( deleteItem->bundle()->filename() ) ); // remove from the media view delete deleteItem; kapp->processEvents( 100 ); @@ -1092,7 +1092,7 @@ MtpMediaDevice::openDevice( bool silent ) return true; - QString genericError = i18n( "Could not connect to MTP Device" ); + TQString genericError = i18n( "Could not connect to MTP Device" ); m_critical_mutex.lock(); LIBMTP_Init(); @@ -1110,12 +1110,12 @@ MtpMediaDevice::openDevice( bool silent ) } connect( - m_view, SIGNAL( itemRenamed( QListViewItem*, const QString&, int ) ), - this, SLOT( playlistRenamed( QListViewItem*, const QString&, int ) ) + m_view, TQT_SIGNAL( itemRenamed( TQListViewItem*, const TQString&, int ) ), + this, TQT_SLOT( playlistRenamed( TQListViewItem*, const TQString&, int ) ) ); - QString modelname = QString( LIBMTP_Get_Modelname( m_device ) ); - QString ownername = QString( LIBMTP_Get_Friendlyname( m_device ) ); + TQString modelname = TQString( LIBMTP_Get_Modelname( m_device ) ); + TQString ownername = TQString( LIBMTP_Get_Friendlyname( m_device ) ); m_name = modelname; if(! ownername.isEmpty() ) m_name += " (" + ownername + ')'; @@ -1223,12 +1223,12 @@ MtpMediaDevice::getCapacity( KIO::filesize_t *total, KIO::filesize_t *available void MtpMediaDevice::customClicked() { - QString Information; + TQString Information; if( isConnected() ) { - QString batteryLevel; - QString secureTime; - QString supportedFiles; + TQString batteryLevel; + TQString secureTime; + TQString supportedFiles; uint8_t maxbattlevel; uint8_t currbattlevel; @@ -1241,7 +1241,7 @@ MtpMediaDevice::customClicked() m_critical_mutex.unlock(); batteryLevel = i18n("Battery level: ") - + QString::number( (int) ( (float) currbattlevel / (float) maxbattlevel * 100.0 ) ) + + TQString::number( (int) ( (float) currbattlevel / (float) maxbattlevel * 100.0 ) ) + '%'; secureTime = i18n("Secure time: ") + sectime; supportedFiles = i18n("Supported file types: ") @@ -1284,7 +1284,7 @@ MtpMediaDevice::setDisconnected() * Handle clicking of the right mouse button */ void -MtpMediaDevice::rmbPressed( QListViewItem *qitem, const QPoint &point, int ) +MtpMediaDevice::rmbPressed( TQListViewItem *qitem, const TQPoint &point, int ) { enum Actions {RENAME, DOWNLOAD, DELETE, MAKE_PLAYLIST, UPDATE_ALBUM_ART}; @@ -1316,9 +1316,9 @@ MtpMediaDevice::rmbPressed( QListViewItem *qitem, const QPoint &point, int ) { case MAKE_PLAYLIST: { - QPtrList<MediaItem> items; + TQPtrList<MediaItem> items; m_view->getSelectedLeaves( 0, &items ); - QString name = i18n( "New Playlist" ); + TQString name = i18n( "New Playlist" ); newPlaylist( name, m_playlistItem, items ); } break; @@ -1336,7 +1336,7 @@ MtpMediaDevice::rmbPressed( QListViewItem *qitem, const QPoint &point, int ) break; case UPDATE_ALBUM_ART: { - QPtrList<MediaItem> *items = new QPtrList<MediaItem>; + TQPtrList<MediaItem> *items = new TQPtrList<MediaItem>; m_view->getSelectedLeaves( 0, items ); if( items->count() > 100 ) @@ -1346,7 +1346,7 @@ MtpMediaDevice::rmbPressed( QListViewItem *qitem, const QPoint &point, int ) "<p>You are updating cover art for %n tracks. This may take some time.", items->count() ), - QString::null ); + TQString::null ); if( button != KMessageBox::Continue ) return; @@ -1363,15 +1363,15 @@ MtpMediaDevice::rmbPressed( QListViewItem *qitem, const QPoint &point, int ) * Add gui elements to the device configuration */ void -MtpMediaDevice::addConfigElements( QWidget *parent ) +MtpMediaDevice::addConfigElements( TQWidget *parent ) { - m_folderLabel = new QLabel( parent ); + m_folderLabel = new TQLabel( parent ); m_folderLabel->setText( i18n( "Folder structure:" ) ); - m_folderStructureBox = new QLineEdit( parent ); + m_folderStructureBox = new TQLineEdit( parent ); m_folderStructureBox->setText( m_folderStructure ); - QToolTip::add( m_folderStructureBox, + TQToolTip::add( m_folderStructureBox, i18n( "Files copied to the device will be placed in this folder." ) + '\n' + i18n( "/ is used as folder separator." ) + '\n' + i18n( "%a will be replaced with the artist name, ") @@ -1384,7 +1384,7 @@ MtpMediaDevice::addConfigElements( QWidget *parent ) * Remove gui elements from the device configuration */ void -MtpMediaDevice::removeConfigElements( QWidget *parent) +MtpMediaDevice::removeConfigElements( TQWidget *parent) { Q_UNUSED(parent) @@ -1420,7 +1420,7 @@ MtpMediaDevice::loadConfig() MtpMediaItem *MtpMediaDevice::addTrackToView( MtpTrack *track, MtpMediaItem *item ) { - QString artistName = track->bundle()->artist(); + TQString artistName = track->bundle()->artist(); MtpMediaItem *artist = dynamic_cast<MtpMediaItem *>( m_view->findItem( artistName, 0 ) ); if( !artist ) @@ -1431,7 +1431,7 @@ MtpMediaItem artist->setType( MediaItem::ARTIST ); } - QString albumName = track->bundle()->album(); + TQString albumName = track->bundle()->album(); MtpMediaItem *album = dynamic_cast<MtpMediaItem *>( artist->findItem( albumName ) ); if( !album ) { @@ -1447,14 +1447,14 @@ MtpMediaItem { item = new MtpMediaItem( album ); item->m_device = this; - QString titleName = track->bundle()->title(); + TQString titleName = track->bundle()->title(); item->setTrack( track ); item->m_order = track->bundle()->track(); item->setText( 0, titleName ); item->setType( MediaItem::TRACK ); item->setBundle( track->bundle() ); item->track()->setId( track->id() ); - m_fileNameToItem[ QString( "%1/%2" ).arg( track->folderId() ).arg( track->bundle()->filename() ) ] = item; + m_fileNameToItem[ TQString( "%1/%2" ).arg( track->folderId() ).arg( track->bundle()->filename() ) ] = item; m_idToTrack[ track->id() ] = track; } return item; @@ -1472,7 +1472,7 @@ MtpMediaDevice::readMtpMusic() m_critical_mutex.lock(); - QString genericError = i18n( "Could not get music from MTP Device" ); + TQString genericError = i18n( "Could not get music from MTP Device" ); int total = 100; int progress = 0; @@ -1541,7 +1541,7 @@ MtpMediaDevice::readPlaylists() while( playlists != 0 ) { MtpMediaItem *playlist = new MtpMediaItem( m_playlistItem, this ); - playlist->setText( 0, QString::fromUtf8( playlists->name ) ); + playlist->setText( 0, TQString::fromUtf8( playlists->name ) ); playlist->setType( MediaItem::PLAYLIST ); playlist->setPlaylist( new MtpPlaylist() ); playlist->playlist()->setId( playlists->playlist_id ); @@ -1618,15 +1618,15 @@ MtpTrack::readMetaData( LIBMTP_track_t *track ) MetaBundle *bundle = new MetaBundle(); if( track->genre != 0 ) - bundle->setGenre( AtomicString( QString::fromUtf8( track->genre ) ) ); + bundle->setGenre( AtomicString( TQString::fromUtf8( track->genre ) ) ); if( track->artist != 0 ) - bundle->setArtist( AtomicString( QString::fromUtf8( track->artist ) ) ); + bundle->setArtist( AtomicString( TQString::fromUtf8( track->artist ) ) ); if( track->album != 0 ) - bundle->setAlbum( AtomicString( QString::fromUtf8( track->album ) ) ); + bundle->setAlbum( AtomicString( TQString::fromUtf8( track->album ) ) ); if( track->title != 0 ) - bundle->setTitle( AtomicString( QString::fromUtf8( track->title ) ) ); + bundle->setTitle( AtomicString( TQString::fromUtf8( track->title ) ) ); if( track->filename != 0 ) - bundle->setPath( AtomicString( QString::fromUtf8( track->filename ) ) ); + bundle->setPath( AtomicString( TQString::fromUtf8( track->filename ) ) ); // translate codecs to file types if( track->filetype == LIBMTP_FILETYPE_MP3 ) @@ -1639,7 +1639,7 @@ MtpTrack::readMetaData( LIBMTP_track_t *track ) bundle->setFileType( MetaBundle::other ); if( track->date != 0 ) - bundle->setYear( QString( QString::fromUtf8( track->date ) ).mid( 0, 4 ).toUInt() ); + bundle->setYear( TQString( TQString::fromUtf8( track->date ) ).mid( 0, 4 ).toUInt() ); if( track->tracknumber > 0 ) bundle->setTrack( track->tracknumber ); if( track->duration > 0 ) @@ -1665,5 +1665,5 @@ MtpTrack::setBundle( MetaBundle &bundle ) MtpAlbum::MtpAlbum( LIBMTP_album_t *album ) { m_id = album->album_id; - m_album = QString::fromUtf8( album->name ); + m_album = TQString::fromUtf8( album->name ); } diff --git a/amarok/src/mediadevice/mtp/mtpmediadevice.h b/amarok/src/mediadevice/mtp/mtpmediadevice.h index 3f60a89a..57e81114 100644 --- a/amarok/src/mediadevice/mtp/mtpmediadevice.h +++ b/amarok/src/mediadevice/mtp/mtpmediadevice.h @@ -27,8 +27,8 @@ #include "mediabrowser.h" -#include <qptrlist.h> -#include <qmutex.h> +#include <tqptrlist.h> +#include <tqmutex.h> #include <libmtp.h> @@ -81,23 +81,23 @@ class MtpAlbum { public: u_int32_t id() const { return m_id; } void setId( int id ) { m_id = id; } - QString album() const { return m_album; } + TQString album() const { return m_album; } private: u_int32_t m_id; - QString m_album; + TQString m_album; }; class MtpMediaItem : public MediaItem { public: - MtpMediaItem( QListView *parent, QListViewItem *after = 0 ) + MtpMediaItem( TQListView *parent, TQListViewItem *after = 0 ) : MediaItem( parent, after ) {} - MtpMediaItem( QListViewItem *parent, QListViewItem *after = 0 ) + MtpMediaItem( TQListViewItem *parent, TQListViewItem *after = 0 ) : MediaItem( parent, after ) {} - MtpMediaItem( QListView *parent, MediaDevice *dev ) + MtpMediaItem( TQListView *parent, MediaDevice *dev ) : MediaItem( parent ) { init( dev ); } - MtpMediaItem( QListViewItem *parent, MediaDevice *dev ) + MtpMediaItem( TQListViewItem *parent, MediaDevice *dev ) : MediaItem( parent ) { init( dev ); } void init( MediaDevice *dev ) @@ -115,7 +115,7 @@ class MtpMediaItem : public MediaItem MtpTrack *track() { return m_track; } void setPlaylist( MtpPlaylist *playlist ) { m_playlist = playlist; } MtpPlaylist *playlist() { return m_playlist; } - QString filename() { return m_track->bundle()->url().path(); } + TQString filename() { return m_track->bundle()->url().path(); } private: MtpTrack *m_track; @@ -133,14 +133,14 @@ class MtpMediaDevice : public MediaDevice bool isConnected(); LIBMTP_mtpdevice_t *current_device(); void setDisconnected(); - virtual void rmbPressed( QListViewItem *qitem, const QPoint &point, int arg1 ); + virtual void rmbPressed( TQListViewItem *qitem, const TQPoint &point, int arg1 ); virtual void init( MediaBrowser* parent ); - virtual QStringList supportedFiletypes(); + virtual TQStringList supportedFiletypes(); void setFolders( LIBMTP_folder_t *folders ); void cancelTransfer(); void customClicked(); - virtual void addConfigElements( QWidget *parent ); - virtual void removeConfigElements( QWidget *parent ); + virtual void addConfigElements( TQWidget *parent ); + virtual void removeConfigElements( TQWidget *parent ); virtual void applyConfig(); virtual void loadConfig(); static int progressCallback( uint64_t const sent, uint64_t const total, void const * const data ); @@ -158,13 +158,13 @@ class MtpMediaDevice : public MediaDevice void synchronizeDevice(); int deleteItemFromDevice( MediaItem *mediaitem, int flags=DeleteTrack ); - void addToPlaylist( MediaItem *list, MediaItem *after, QPtrList<MediaItem> items ); - MtpMediaItem *newPlaylist( const QString &name, MediaItem *list, QPtrList<MediaItem> items ); + void addToPlaylist( MediaItem *list, MediaItem *after, TQPtrList<MediaItem> items ); + MtpMediaItem *newPlaylist( const TQString &name, MediaItem *list, TQPtrList<MediaItem> items ); bool getCapacity( KIO::filesize_t *total, KIO::filesize_t *available ); virtual void updateRootItems() {}; private slots: - void playlistRenamed( QListViewItem *item, const QString &, int ); + void playlistRenamed( TQListViewItem *item, const TQString &, int ); private: MtpMediaItem *addTrackToView(MtpTrack *track, MtpMediaItem *item=0 ); @@ -181,25 +181,25 @@ class MtpMediaDevice : public MediaDevice void readPlaylists( void ); void readAlbums( void ); void playlistFromItem( MtpMediaItem *item); - QByteArray *getSupportedImage( QString path ); - void sendAlbumArt( QPtrList<MediaItem> *items ); - void updateAlbumArt( QPtrList<MediaItem> *items ); - LIBMTP_album_t *getOrCreateAlbum( QPtrList<MediaItem> *items ); + TQByteArray *getSupportedImage( TQString path ); + void sendAlbumArt( TQPtrList<MediaItem> *items ); + void updateAlbumArt( TQPtrList<MediaItem> *items ); + LIBMTP_album_t *getOrCreateAlbum( TQPtrList<MediaItem> *items ); LIBMTP_mtpdevice_t *m_device; - QMutex m_mutex; - QMutex m_critical_mutex; + TQMutex m_mutex; + TQMutex m_critical_mutex; LIBMTP_folder_t *m_folders; uint32_t m_default_parent_folder; - QString m_folderStructure; - QLineEdit *m_folderStructureBox; - QLabel *m_folderLabel; - QStringList m_supportedFiles; - QPtrList<MediaItem> *m_newTracks; - QMap<int,QString> mtpFileTypes; - QMap<uint32_t,MtpTrack*> m_idToTrack; - QMap<QString,MtpMediaItem*> m_fileNameToItem; - QMap<uint32_t,MtpAlbum*> m_idToAlbum; - QString m_format; + TQString m_folderStructure; + TQLineEdit *m_folderStructureBox; + TQLabel *m_folderLabel; + TQStringList m_supportedFiles; + TQPtrList<MediaItem> *m_newTracks; + TQMap<int,TQString> mtpFileTypes; + TQMap<uint32_t,MtpTrack*> m_idToTrack; + TQMap<TQString,MtpMediaItem*> m_fileNameToItem; + TQMap<uint32_t,MtpAlbum*> m_idToAlbum; + TQString m_format; }; #endif diff --git a/amarok/src/mediadevice/njb/njbmediadevice.cpp b/amarok/src/mediadevice/njb/njbmediadevice.cpp index 07d0dfec..d2125937 100644 --- a/amarok/src/mediadevice/njb/njbmediadevice.cpp +++ b/amarok/src/mediadevice/njb/njbmediadevice.cpp @@ -53,11 +53,11 @@ AMAROK_EXPORT_PLUGIN( NjbMediaDevice ) // Qt -#include <qdir.h> -#include <qlistview.h> -#include <qregexp.h> -#include <qtooltip.h> -#include <quuid.h> +#include <tqdir.h> +#include <tqlistview.h> +#include <tqregexp.h> +#include <tqtooltip.h> +#include <tquuid.h> // posix #include <stdint.h> @@ -65,7 +65,7 @@ AMAROK_EXPORT_PLUGIN( NjbMediaDevice ) #include <time.h> #include <unistd.h> -namespace Amarok { extern KConfig *config( const QString& ); } +namespace Amarok { extern KConfig *config( const TQString& ); } njb_t *NjbMediaDevice::m_njb = 0; // This function has NOT handled the request, so other functions may be called // upon to do so @@ -77,7 +77,7 @@ const int NJB_HANDLED = -1; NjbMediaDevice::NjbMediaDevice(): MediaDevice() { - // listAmarokPlayLists = new QListView(); + // listAmarokPlayLists = new TQListView(); m_name = i18n("NJB Media device"); m_njb = 0; m_connected = false; @@ -88,8 +88,8 @@ NjbMediaDevice::NjbMediaDevice(): MediaDevice() NJB_Set_Debug(0); // or try DD_SUBTRACE KToolBarButton* customButton = MediaBrowser::instance()->getToolBar()->getButton( MediaBrowser::CUSTOM ); customButton->setText( i18n("Special device functions") ); - QToolTip::remove( customButton ); - QToolTip::add( customButton, i18n( "Special functions of your jukebox" ) ); + TQToolTip::remove( customButton ); + TQToolTip::add( customButton, i18n( "Special functions of your jukebox" ) ); } @@ -200,7 +200,7 @@ NjbMediaDevice::openDevice(bool) if( m_njb ) return true; - QString genericError = i18n( "Could not connect to Nomad device" ); + TQString genericError = i18n( "Could not connect to Nomad device" ); NJB_Set_Unicode( NJB_UC_UTF8 ); // I assume that UTF-8 is fine with everyone... int n; @@ -222,8 +222,8 @@ NjbMediaDevice::openDevice(bool) return false; } - QString deviceName = NJB_Get_Device_Name( m_njb, 1 ); - QString owner = NJB_Get_Owner_String( m_njb ); + TQString deviceName = NJB_Get_Device_Name( m_njb, 1 ); + TQString owner = NJB_Get_Owner_String( m_njb ); m_name = deviceName + " (Owned by " + owner + ')'; @@ -288,7 +288,7 @@ NjbMediaDevice::deleteItemFromDevice(MediaItem* item, int flags ) if( isCanceled() ) break; - expandItem( dynamic_cast<QListViewItem *>(item) ); + expandItem( dynamic_cast<TQListViewItem *>(item) ); for( MediaItem *it = dynamic_cast<MediaItem *>( item->firstChild() ); it ; it = next ) { @@ -335,7 +335,7 @@ int NjbMediaDevice::downloadSelectedItems() { /* Copied from ifpmediadevice */ - QString save = QString::null; + TQString save = TQString::null; KURLRequesterDlg dialog( save, 0, 0 ); dialog.setCaption( kapp->makeStdCaption( i18n( "Choose a Download Directory" ) ) ); @@ -347,10 +347,10 @@ NjbMediaDevice::downloadSelectedItems() return -1; destDir.adjustPath( 1 ); //add trailing slash - QDir dir; - QString path; + TQDir dir; + TQString path; - QPtrList<MediaItem> items; + TQPtrList<MediaItem> items; m_view->getSelectedLeaves( 0, &items ); int result = 0; @@ -377,12 +377,12 @@ NjbMediaDevice::downloadToCollection() { // We will first download all files into a temp dir, and then call move to collection. - QPtrList<MediaItem> items; + TQPtrList<MediaItem> items; m_view->getSelectedLeaves( 0, &items ); - KTempDir tempdir( QString::null ); // Default prefix is fine with us + KTempDir tempdir( TQString::null ); // Default prefix is fine with us tempdir.setAutoDelete( true ); // We don't need it once the work is done. - QString path = tempdir.name(), filepath; + TQString path = tempdir.name(), filepath; KURL::List urls; for( MediaItem *it = items.first(); it && !(m_canceled); it = items.next() ) { @@ -393,7 +393,7 @@ NjbMediaDevice::downloadToCollection() debug() << "Dynamic cast to NJB media item failed. " << endl; return -1; } - QString track_id; + TQString track_id; track_id.setNum( auxItem->track()->id() ); filepath = path + auxItem->bundle()->url().path(); @@ -493,7 +493,7 @@ NjbMediaDevice::copyTrackFromDevice( MediaItem *item ) NjbTrack *track((*it)); - QString filename = item->bundle()->directory() + track->bundle()->filename(); + TQString filename = item->bundle()->directory() + track->bundle()->filename(); if( NJB_Get_Track( m_njb, track->id(), track->bundle()->filesize(), filename.utf8(), progressCallback, this) != NJB_SUCCESS ) { @@ -510,7 +510,7 @@ NjbMediaDevice::copyTrackFromDevice( MediaItem *item ) } MediaItem* -NjbMediaDevice::newPlaylist(const QString& name, MediaItem* parent, QPtrList< MediaItem > items) +NjbMediaDevice::newPlaylist(const TQString& name, MediaItem* parent, TQPtrList< MediaItem > items) { DEBUG_BLOCK @@ -556,7 +556,7 @@ NjbMediaDevice::newPlaylist(const QString& name, MediaItem* parent, QPtrList< Me QStringList NjbMediaDevice::supportedFiletypes() { - QStringList supportedFiles; + TQStringList supportedFiles; supportedFiles << "mp3"; supportedFiles << "wav"; supportedFiles << "wma"; @@ -570,13 +570,13 @@ NjbMediaDevice::getTransferDialog() } void -NjbMediaDevice::addConfigElements(QWidget* arg1) +NjbMediaDevice::addConfigElements(TQWidget* arg1) { MediaDevice::addConfigElements(arg1); } void -NjbMediaDevice::addToPlaylist(MediaItem* playlist, MediaItem* after, QPtrList< MediaItem > items) +NjbMediaDevice::addToPlaylist(MediaItem* playlist, MediaItem* after, TQPtrList< MediaItem > items) { MediaDevice::addToPlaylist(playlist, after, items); } @@ -606,7 +606,7 @@ NjbMediaDevice::loadConfig() } void -NjbMediaDevice::removeConfigElements(QWidget* arg1) +NjbMediaDevice::removeConfigElements(TQWidget* arg1) { MediaDevice::removeConfigElements(arg1); } @@ -627,7 +627,7 @@ NjbMediaDevice::trackExists( const MetaBundle & bundle ) } void -NjbMediaDevice::rmbPressed(QListViewItem* qitem, const QPoint& point, int ) +NjbMediaDevice::rmbPressed(TQListViewItem* qitem, const TQPoint& point, int ) { enum Actions { DOWNLOAD, DOWNLOAD_TO_COLLECTION, RENAME, DELETE}; @@ -645,7 +645,7 @@ NjbMediaDevice::rmbPressed(QListViewItem* qitem, const QPoint& point, int ) int id = menu.exec( point ); MediaItem *i; - QPtrList<MediaItem> items; + TQPtrList<MediaItem> items; switch( id ) { case DOWNLOAD: @@ -755,7 +755,7 @@ NjbMediaDevice::readJukeboxMusic( void ) NjbMediaItem * NjbMediaDevice::addTrackToView( NjbTrack *track, NjbMediaItem *item ) { - QString artistName = track->bundle()->artist(); + TQString artistName = track->bundle()->artist(); NjbMediaItem *artist = dynamic_cast<NjbMediaItem *>( m_view->findItem( artistName, 0 ) ); if(!artist) @@ -766,7 +766,7 @@ NjbMediaDevice::addTrackToView( NjbTrack *track, NjbMediaItem *item ) artist->setType( MediaItem::ARTIST ); } - QString albumName = track->bundle()->album(); + TQString albumName = track->bundle()->album(); NjbMediaItem *album = dynamic_cast<NjbMediaItem *>( artist->findItem( albumName ) ); if(!album) { @@ -782,7 +782,7 @@ NjbMediaDevice::addTrackToView( NjbTrack *track, NjbMediaItem *item ) { item = new NjbMediaItem( album ); item->m_device = this; - QString titleName = track->bundle()->title(); + TQString titleName = track->bundle()->title(); item->setTrack( track ); item->setText( 0, titleName ); @@ -801,7 +801,7 @@ NjbMediaDevice::theNjb() } void -NjbMediaDevice::expandItem( QListViewItem *item ) +NjbMediaDevice::expandItem( TQListViewItem *item ) { DEBUG_BLOCK // First clear the item's children to repopulate. @@ -831,7 +831,7 @@ NjbMediaDevice::expandItem( QListViewItem *item ) } NjbMediaItem* -NjbMediaDevice::addAlbums(const QString &artist, NjbMediaItem *item) +NjbMediaDevice::addAlbums(const TQString &artist, NjbMediaItem *item) { for( trackValueList::iterator it = trackList.begin(); it != trackList.end(); it++ ) { @@ -849,7 +849,7 @@ NjbMediaDevice::addAlbums(const QString &artist, NjbMediaItem *item) } NjbMediaItem* -NjbMediaDevice::addTracks(const QString &artist, const QString &album, NjbMediaItem *item) +NjbMediaDevice::addTracks(const TQString &artist, const TQString &album, NjbMediaItem *item) { for( trackValueList::iterator it = trackList.begin(); it != trackList.end(); it++ ) { @@ -884,11 +884,11 @@ NjbMediaDevice::addArtist( NjbTrack *track ) void NjbMediaDevice::customClicked() { - QString Information; - QString tracksFound; - QString powerStatus; - QString batteryLevel; - QString batteryCharging; + TQString Information; + TQString tracksFound; + TQString powerStatus; + TQString batteryLevel; + TQString batteryCharging; if( m_connected ) { @@ -896,7 +896,7 @@ NjbMediaDevice::customClicked() "%n tracks found on device ", trackList.size() ); powerStatus = ( (NJB_Get_Auxpower( m_njb ) == 1) ? i18n("On auxiliary power") : i18n("On main power") ); batteryCharging = ( (NJB_Get_Battery_Charging( m_njb ) == 1) ? i18n("Battery charging") : i18n("Battery not charging") ); - batteryLevel = (i18n("Battery level: ") + QString::number( NJB_Get_Battery_Level( m_njb ) ) ); + batteryLevel = (i18n("Battery level: ") + TQString::number( NJB_Get_Battery_Level( m_njb ) ) ); Information = ( i18n("Player Information for ") + m_name +'\n' + i18n("Power status: ") + powerStatus + '\n' + diff --git a/amarok/src/mediadevice/njb/njbmediadevice.h b/amarok/src/mediadevice/njb/njbmediadevice.h index 277c96cf..ba2a32e8 100644 --- a/amarok/src/mediadevice/njb/njbmediadevice.h +++ b/amarok/src/mediadevice/njb/njbmediadevice.h @@ -29,15 +29,15 @@ #include <transferdialog.h> #include <libnjb.h> -#include <qptrlist.h> -#include <qlistview.h> +#include <tqptrlist.h> +#include <tqlistview.h> #include "playlist.h" #include "track.h" -#include <qcstring.h> -#include <qstring.h> -#include <qvaluelist.h> +#include <tqcstring.h> +#include <tqstring.h> +#include <tqvaluelist.h> // kde #include <kurl.h> @@ -64,10 +64,10 @@ extern trackValueList* theTracks; class NjbMediaItem : public MediaItem { public: - NjbMediaItem( QListView *parent, QListViewItem *after = 0 ) : MediaItem( parent, after ) + NjbMediaItem( TQListView *parent, TQListViewItem *after = 0 ) : MediaItem( parent, after ) {} - NjbMediaItem( QListViewItem *parent, QListViewItem *after = 0 ) : MediaItem( parent, after ) + NjbMediaItem( TQListViewItem *parent, TQListViewItem *after = 0 ) : MediaItem( parent, after ) {} ~NjbMediaItem() @@ -77,7 +77,7 @@ class NjbMediaItem : public MediaItem void setTrack( NjbTrack *track ) { m_track = track; m_track->addItem(this); } NjbTrack *track() { return m_track; } - QString filename() { return m_track->bundle()->url().path(); } + TQString filename() { return m_track->bundle()->url().path(); } private: NjbTrack *m_track; }; @@ -97,30 +97,30 @@ class NjbMediaDevice : public MediaDevice // virtual bool needsManualConfig(); - virtual MediaItem* newPlaylist(const QString& name, MediaItem* parent, QPtrList< MediaItem > items); + virtual MediaItem* newPlaylist(const TQString& name, MediaItem* parent, TQPtrList< MediaItem > items); // virtual MediaItem* tagsChanged(MediaItem* item, const MetaBundle& changed); - virtual QStringList supportedFiletypes(); + virtual TQStringList supportedFiletypes(); virtual bool hasTransferDialog() { return true; } virtual TransferDialog* getTransferDialog(); - virtual void addConfigElements(QWidget* arg1); - virtual void addToDirectory(MediaItem* directory, QPtrList< MediaItem > items) { Q_UNUSED(directory) Q_UNUSED(items) } - virtual void addToPlaylist(MediaItem* playlist, MediaItem* after, QPtrList< MediaItem > items); + virtual void addConfigElements(TQWidget* arg1); + virtual void addToDirectory(MediaItem* directory, TQPtrList< MediaItem > items) { Q_UNUSED(directory) Q_UNUSED(items) } + virtual void addToPlaylist(MediaItem* playlist, MediaItem* after, TQPtrList< MediaItem > items); virtual void applyConfig(); virtual void init(MediaBrowser* parent); virtual void loadConfig(); - virtual void removeConfigElements(QWidget* arg1); - virtual void rmbPressed(QListViewItem* qitem, const QPoint& point, int arg1); + virtual void removeConfigElements(TQWidget* arg1); + virtual void rmbPressed(TQListViewItem* qitem, const TQPoint& point, int arg1); virtual void runTransferDialog(); virtual void customClicked(); - void setDeviceType(const QString& type); + void setDeviceType(const TQString& type); void setSpacesToUnderscores(bool yesno); static njb_t *theNjb(); public slots: - void expandItem( QListViewItem *item ); + void expandItem( TQListViewItem *item ); protected: @@ -159,15 +159,15 @@ class NjbMediaDevice : public MediaDevice void clearItems(); NjbMediaItem *addTrackToView(NjbTrack *track, NjbMediaItem *item=0); - NjbMediaItem* addAlbums( const QString &artist, NjbMediaItem *item ); - NjbMediaItem* addTracks( const QString &artist, const QString &track, NjbMediaItem *item ); + NjbMediaItem* addAlbums( const TQString &artist, NjbMediaItem *item ); + NjbMediaItem* addTracks( const TQString &artist, const TQString &track, NjbMediaItem *item ); NjbMediaItem* addTrack( NjbTrack *track ); NjbMediaItem* addArtist( NjbTrack *track ); TransferDialog *m_td; - QListView *listAmarokPlayLists; - QString devNode; - QString m_errMsg; + TQListView *listAmarokPlayLists; + TQString devNode; + TQString m_errMsg; bool m_connected; // Replaces m_captured from the original code. njb_t njbs[NJB_MAX_DEVICES]; @@ -177,7 +177,7 @@ class NjbMediaDevice : public MediaDevice int m_libcount; bool m_busy; unsigned m_progressStart; - QString m_progressMessage; + TQString m_progressMessage; NjbMediaItem *m_artistItem; NjbMediaItem *m_albumItem; NjbMediaItem *m_allTracksItem; diff --git a/amarok/src/mediadevice/njb/playlist.cpp b/amarok/src/mediadevice/njb/playlist.cpp index dd2cd3bb..d679ce06 100644 --- a/amarok/src/mediadevice/njb/playlist.cpp +++ b/amarok/src/mediadevice/njb/playlist.cpp @@ -113,9 +113,9 @@ NjbPlaylist::setPlaylist( njb_playlist_t* _newlist ) } QString -NjbPlaylist::unescapefilename( const QString& _in ) +NjbPlaylist::unescapefilename( const TQString& _in ) { - QString result = _in; + TQString result = _in; result.replace("%2f","/"); @@ -123,9 +123,9 @@ NjbPlaylist::unescapefilename( const QString& _in ) } QString -NjbPlaylist::escapefilename( const QString& _in ) +NjbPlaylist::escapefilename( const TQString& _in ) { - QString result = _in; + TQString result = _in; result.replace("/","%2f"); @@ -133,9 +133,9 @@ NjbPlaylist::escapefilename( const QString& _in ) } int -NjbPlaylist::setName( const QString& fileName) +NjbPlaylist::setName( const TQString& fileName) { - QString playlistName = fileName; + TQString playlistName = fileName; if( fileName.right( 4) == ".m3u") playlistName.truncate( playlistName.length() - 4); @@ -176,7 +176,7 @@ NjbPlaylist::setName( const QString& fileName) int -NjbPlaylist::addTrack( const QString& fileName) +NjbPlaylist::addTrack( const TQString& fileName) { debug() << __PRETTY_FUNCTION__ << " filename=" << fileName << endl; /* @@ -243,7 +243,7 @@ NjbPlaylist::update( void) QStringList NjbPlaylist::trackNames( void ) const { - QStringList result; + TQStringList result; /* // find tracks in trackList by their ID MetaBundle bundle; @@ -263,7 +263,7 @@ NjbPlaylist::trackNames( void ) const } bool -NjbPlaylist::operator==(const QString& name) const +NjbPlaylist::operator==(const TQString& name) const { return escapefilename(m_playlist->name) == name; } diff --git a/amarok/src/mediadevice/njb/playlist.h b/amarok/src/mediadevice/njb/playlist.h index d419cb60..4a9d6da8 100644 --- a/amarok/src/mediadevice/njb/playlist.h +++ b/amarok/src/mediadevice/njb/playlist.h @@ -23,7 +23,7 @@ #include <libnjb.h> // Qt -#include <qstringlist.h> +#include <tqstringlist.h> class NjbPlaylist { @@ -33,14 +33,14 @@ class NjbPlaylist { NjbPlaylist(const NjbPlaylist& _copy); ~NjbPlaylist( void); - QStringList trackNames( void) const; + TQStringList trackNames( void) const; void operator=(const NjbPlaylist& _copy); - bool operator==(const QString& name) const; + bool operator==(const TQString& name) const; bool operator==(const NjbPlaylist& rval) const; - QString getName(void) const; + TQString getName(void) const; - int setName( const QString& fileName); - int addTrack( const QString& fileName); + int setName( const TQString& fileName); + int addTrack( const TQString& fileName); int update( void); u_int32_t getId(void) const { return m_playlist->plid; } @@ -48,14 +48,14 @@ class NjbPlaylist { protected: void setPlaylist( njb_playlist_t* _newlist ); - static QString unescapefilename( const QString& ); - static QString escapefilename( const QString& ); + static TQString unescapefilename( const TQString& ); + static TQString escapefilename( const TQString& ); private: njb_playlist_t* m_playlist; }; -class playlistValueList: public QValueList<NjbPlaylist> +class playlistValueList: public TQValueList<NjbPlaylist> { public: int readFromDevice( void); diff --git a/amarok/src/mediadevice/njb/track.cpp b/amarok/src/mediadevice/njb/track.cpp index e1545516..24a24534 100644 --- a/amarok/src/mediadevice/njb/track.cpp +++ b/amarok/src/mediadevice/njb/track.cpp @@ -23,8 +23,8 @@ static const char* rcsid __attribute__((unused)) = #include "track.h" #include "njbmediadevice.h" -#include <qregexp.h> -#include <qptrlist.h> +#include <tqregexp.h> +#include <tqptrlist.h> #include <klocale.h> @@ -64,8 +64,8 @@ NjbTrack::NjbTrack( njb_songid_t* song) frame = NJB_Songid_Findframe( song, FR_ARTIST ); if( frame ) { - QString artist = QString::fromUtf8( frame->data.strval ); - artist.replace( QRegExp( "/" ), "-" ); + TQString artist = TQString::fromUtf8( frame->data.strval ); + artist.replace( TQRegExp( "/" ), "-" ); bundle->setArtist( artist ); } else @@ -74,8 +74,8 @@ NjbTrack::NjbTrack( njb_songid_t* song) frame = NJB_Songid_Findframe( song, FR_ALBUM ); if( frame) { - QString album = QString::fromUtf8( frame->data.strval ); - album.replace( QRegExp( "/" ), "-" ); + TQString album = TQString::fromUtf8( frame->data.strval ); + album.replace( TQRegExp( "/" ), "-" ); bundle->setAlbum( album ); } else @@ -84,8 +84,8 @@ NjbTrack::NjbTrack( njb_songid_t* song) frame = NJB_Songid_Findframe( song, FR_TITLE); if( frame ) { - QString title = QString::fromUtf8( frame->data.strval ); - title.replace( QRegExp( "/"), "-"); + TQString title = TQString::fromUtf8( frame->data.strval ); + title.replace( TQRegExp( "/"), "-"); bundle->setTitle( title ); } else @@ -103,18 +103,18 @@ NjbTrack::NjbTrack( njb_songid_t* song) bundle->setTrack( frame->data.u_int32_val ); break; case NJB_TYPE_STRING: - bundle->setTrack( QString::fromUtf8(frame->data.strval).toUInt() ); + bundle->setTrack( TQString::fromUtf8(frame->data.strval).toUInt() ); break; default: bundle->setTrack( 0 ); } } - QString codec; + TQString codec; frame = NJB_Songid_Findframe( song, FR_CODEC); if( frame ) { - codec = QCString( frame->data.strval).lower(); + codec = TQCString( frame->data.strval).lower(); if( codec == "mp3" ) bundle->setFileType( MetaBundle::mp3 ); else if (codec == "wma" ) @@ -129,11 +129,11 @@ NjbTrack::NjbTrack( njb_songid_t* song) } frame = NJB_Songid_Findframe( song, FR_FNAME ); - QString filename; + TQString filename; if( frame ) { //bundle->setUrl( KURL( frame->data.strval ) ); - filename = QString::fromUtf8( frame->data.strval ); + filename = TQString::fromUtf8( frame->data.strval ); } if( filename.isEmpty() ) @@ -156,7 +156,7 @@ NjbTrack::NjbTrack( njb_songid_t* song) bundle->setYear( frame->data.u_int32_val ); break; case NJB_TYPE_STRING: - bundle->setYear( QString::fromUtf8( frame->data.strval ).toInt() ); + bundle->setYear( TQString::fromUtf8( frame->data.strval ).toInt() ); break; default: bundle->setYear( 0 ); @@ -228,7 +228,7 @@ NjbTrack::removeItem( const NjbMediaItem *item ) /* ------------------------------------------------------------------------ */ trackValueList::iterator -trackValueList::findTrackByName( const QString& _filename ) +trackValueList::findTrackByName( const TQString& _filename ) { trackValueList::iterator it; for( it = begin(); it != end(); it++) diff --git a/amarok/src/mediadevice/njb/track.h b/amarok/src/mediadevice/njb/track.h index fc6db0d9..1046375a 100644 --- a/amarok/src/mediadevice/njb/track.h +++ b/amarok/src/mediadevice/njb/track.h @@ -21,7 +21,7 @@ // qt -#include <qstring.h> +#include <tqstring.h> // libnjb #include <libnjb.h> @@ -55,14 +55,14 @@ class NjbTrack { private: unsigned int m_id; MetaBundle m_bundle; - QPtrList<NjbMediaItem> ItemList; + TQPtrList<NjbMediaItem> ItemList; }; -class trackValueList: public QValueList<NjbTrack *> +class trackValueList: public TQValueList<NjbTrack *> { public: - trackValueList::iterator findTrackByName( const QString& ); - trackValueList::const_iterator findTrackByName( const QString& ) const; + trackValueList::iterator findTrackByName( const TQString& ); + trackValueList::const_iterator findTrackByName( const TQString& ) const; trackValueList::iterator findTrackById( unsigned ); trackValueList::const_iterator findTrackById( unsigned ) const; diff --git a/amarok/src/mediadevice/riokarma/riokarmamediadevice.cpp b/amarok/src/mediadevice/riokarma/riokarmamediadevice.cpp index 361da74c..c0556612 100644 --- a/amarok/src/mediadevice/riokarma/riokarmamediadevice.cpp +++ b/amarok/src/mediadevice/riokarma/riokarmamediadevice.cpp @@ -36,9 +36,9 @@ AMAROK_EXPORT_PLUGIN( RioKarmaMediaDevice ) #include <kpopupmenu.h> // Qt -#include <qdir.h> -#include <qlistview.h> -#include <qmap.h> +#include <tqdir.h> +#include <tqlistview.h> +#include <tqmap.h> /** @@ -77,7 +77,7 @@ RioKarmaMediaDevice::isConnected() QStringList RioKarmaMediaDevice::supportedFiletypes() { - QStringList supportedFiles; + TQStringList supportedFiles; supportedFiles << "mp3"; supportedFiles << "ogg"; supportedFiles << "wma"; @@ -93,7 +93,7 @@ MediaItem { DEBUG_BLOCK - QString genericError = i18n( "Could not send track" ); + TQString genericError = i18n( "Could not send track" ); if( m_fileNameToItem[ bundle.filename() ] != 0 ) { @@ -165,7 +165,7 @@ MediaItem * @note Playlists not implemented yet... :-) */ RioKarmaMediaItem -*RioKarmaMediaDevice::newPlaylist( const QString &name, MediaItem *parent, QPtrList<MediaItem> items ) +*RioKarmaMediaDevice::newPlaylist( const TQString &name, MediaItem *parent, TQPtrList<MediaItem> items ) { Q_UNUSED( name ); Q_UNUSED( parent ); @@ -178,7 +178,7 @@ RioKarmaMediaItem * @note Playlists not implemented yet... :-) */ void -RioKarmaMediaDevice::addToPlaylist( MediaItem *mlist, MediaItem *after, QPtrList<MediaItem> items ) +RioKarmaMediaDevice::addToPlaylist( MediaItem *mlist, MediaItem *after, TQPtrList<MediaItem> items ) { Q_UNUSED( mlist ); Q_UNUSED( after ); @@ -284,7 +284,7 @@ RioKarmaMediaDevice::openDevice( bool silent ) Q_UNUSED( silent ); - QDir dir( mountPoint() ); + TQDir dir( mountPoint() ); if( !dir.exists() ) { Amarok::StatusBar::instance()->longMessage( @@ -296,7 +296,7 @@ RioKarmaMediaDevice::openDevice( bool silent ) if( m_rio >= 0 ) return true; - QString genericError = i18n( "Could not connect to Rio Karma" ); + TQString genericError = i18n( "Could not connect to Rio Karma" ); char *mount = qstrdup( mountPoint().utf8() ); m_rio = lk_karma_connect( mount ); @@ -382,7 +382,7 @@ RioKarmaMediaDevice::setDisconnected() * Handle clicking of the right mouse button */ void -RioKarmaMediaDevice::rmbPressed( QListViewItem *qitem, const QPoint &point, int ) +RioKarmaMediaDevice::rmbPressed( TQListViewItem *qitem, const TQPoint &point, int ) { enum Actions {DELETE}; @@ -411,7 +411,7 @@ RioKarmaMediaDevice::rmbPressed( QListViewItem *qitem, const QPoint &point, int RioKarmaMediaItem *RioKarmaMediaDevice::addTrackToView( RioKarmaTrack *track, RioKarmaMediaItem *item ) { - QString artistName = track->bundle()->artist(); + TQString artistName = track->bundle()->artist(); RioKarmaMediaItem *artist = dynamic_cast<RioKarmaMediaItem *>( m_view->findItem( artistName, 0 ) ); if( !artist ) @@ -422,7 +422,7 @@ RioKarmaMediaItem artist->setType( MediaItem::ARTIST ); } - QString albumName = track->bundle()->album(); + TQString albumName = track->bundle()->album(); RioKarmaMediaItem *album = dynamic_cast<RioKarmaMediaItem *>( artist->findItem( albumName ) ); if( !album ) { @@ -438,7 +438,7 @@ RioKarmaMediaItem { item = new RioKarmaMediaItem( album ); item->m_device = this; - QString titleName = track->bundle()->title(); + TQString titleName = track->bundle()->title(); item->setTrack( track ); item->m_order = track->bundle()->track(); item->setText( 0, titleName ); @@ -462,7 +462,7 @@ RioKarmaMediaDevice::readKarmaMusic() clearItems(); - QString genericError = i18n( "Could not get music from Rio Karma" ); + TQString genericError = i18n( "Could not get music from Rio Karma" ); int total = 100; int progress = 0; @@ -556,13 +556,13 @@ RioKarmaTrack::readMetaData() { MetaBundle *bundle = new MetaBundle(); - bundle->setGenre( AtomicString( QString::fromUtf8( lk_properties_get_property( m_id, "genre" ) ) ) ); - bundle->setArtist( AtomicString( QString::fromUtf8( lk_properties_get_property( m_id, "artist" ) ) ) ); - bundle->setAlbum( AtomicString( QString::fromUtf8( lk_properties_get_property( m_id, "source" ) ) ) ); - bundle->setTitle( AtomicString( QString::fromUtf8( lk_properties_get_property( m_id, "title" ) ) ) ); + bundle->setGenre( AtomicString( TQString::fromUtf8( lk_properties_get_property( m_id, "genre" ) ) ) ); + bundle->setArtist( AtomicString( TQString::fromUtf8( lk_properties_get_property( m_id, "artist" ) ) ) ); + bundle->setAlbum( AtomicString( TQString::fromUtf8( lk_properties_get_property( m_id, "source" ) ) ) ); + bundle->setTitle( AtomicString( TQString::fromUtf8( lk_properties_get_property( m_id, "title" ) ) ) ); // translate codecs to file types - QString codec = QCString( lk_properties_get_property( m_id, "codec" ) ); + TQString codec = TQCString( lk_properties_get_property( m_id, "codec" ) ); if( codec == "mp3" ) bundle->setFileType( MetaBundle::mp3 ); else if( codec == "wma" ) @@ -574,9 +574,9 @@ RioKarmaTrack::readMetaData() else bundle->setFileType( MetaBundle::other ); - bundle->setYear( QString( lk_properties_get_property( m_id, "year" ) ).toUInt() ); - bundle->setTrack( QString( lk_properties_get_property( m_id, "tracknr" ) ).toUInt() ); - bundle->setLength( QString( lk_properties_get_property( m_id, "duration" ) ).toUInt() ); + bundle->setYear( TQString( lk_properties_get_property( m_id, "year" ) ).toUInt() ); + bundle->setTrack( TQString( lk_properties_get_property( m_id, "tracknr" ) ).toUInt() ); + bundle->setLength( TQString( lk_properties_get_property( m_id, "duration" ) ).toUInt() ); this->setBundle( *bundle ); } diff --git a/amarok/src/mediadevice/riokarma/riokarmamediadevice.h b/amarok/src/mediadevice/riokarma/riokarmamediadevice.h index 237ab84e..42669448 100644 --- a/amarok/src/mediadevice/riokarma/riokarmamediadevice.h +++ b/amarok/src/mediadevice/riokarma/riokarmamediadevice.h @@ -22,8 +22,8 @@ #include "mediabrowser.h" -#include <qptrlist.h> -#include <qmutex.h> +#include <tqptrlist.h> +#include <tqmutex.h> #include "libkarma/lkarma.h" @@ -48,16 +48,16 @@ class RioKarmaTrack { private: unsigned int m_id; MetaBundle m_bundle; - QPtrList<RioKarmaMediaItem> m_itemList; + TQPtrList<RioKarmaMediaItem> m_itemList; }; class RioKarmaMediaItem : public MediaItem { public: - RioKarmaMediaItem( QListView *parent, QListViewItem *after = 0 ) : MediaItem( parent, after ) + RioKarmaMediaItem( TQListView *parent, TQListViewItem *after = 0 ) : MediaItem( parent, after ) {} - RioKarmaMediaItem( QListViewItem *parent, QListViewItem *after = 0 ) : MediaItem( parent, after ) + RioKarmaMediaItem( TQListViewItem *parent, TQListViewItem *after = 0 ) : MediaItem( parent, after ) {} ~RioKarmaMediaItem() { @@ -65,7 +65,7 @@ class RioKarmaMediaItem : public MediaItem } void setTrack( RioKarmaTrack *track ) { m_track = track; m_track->addItem( this ); } RioKarmaTrack *track() { return m_track; } - QString filename() { return m_track->bundle()->url().path(); } + TQString filename() { return m_track->bundle()->url().path(); } private: RioKarmaTrack *m_track; }; @@ -81,9 +81,9 @@ class RioKarmaMediaDevice : public MediaDevice bool isConnected(); int current_id(); void setDisconnected(); - virtual void rmbPressed( QListViewItem *qitem, const QPoint &point, int arg1 ); + virtual void rmbPressed( TQListViewItem *qitem, const TQPoint &point, int arg1 ); virtual void init( MediaBrowser *parent ); - virtual QStringList supportedFiletypes(); + virtual TQStringList supportedFiletypes(); protected: MediaItem* trackExists( const MetaBundle &bundle ); @@ -97,8 +97,8 @@ class RioKarmaMediaDevice : public MediaDevice void synchronizeDevice(); int deleteItemFromDevice( MediaItem *item, int flags=DeleteTrack ); - void addToPlaylist( MediaItem *list, MediaItem *after, QPtrList<MediaItem> items ); - RioKarmaMediaItem *newPlaylist( const QString &name, MediaItem *list, QPtrList<MediaItem> items ); + void addToPlaylist( MediaItem *list, MediaItem *after, TQPtrList<MediaItem> items ); + RioKarmaMediaItem *newPlaylist( const TQString &name, MediaItem *list, TQPtrList<MediaItem> items ); bool getCapacity( KIO::filesize_t *total, KIO::filesize_t *available ); virtual void updateRootItems() {}; @@ -108,8 +108,8 @@ class RioKarmaMediaDevice : public MediaDevice void clearItems(); int deleteRioTrack( RioKarmaMediaItem *trackItem ); int m_rio; - QMutex m_mutex; - QMap<QString,RioKarmaMediaItem *> m_fileNameToItem; + TQMutex m_mutex; + TQMap<TQString,RioKarmaMediaItem *> m_fileNameToItem; }; |