Fix Qt4 compilation

git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/amarok@1230334 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 14 years ago
parent bc3dc02016
commit 98ba28489b

@ -643,7 +643,7 @@ yauapEngine::getAudioCDContents(const TQString &device, KURL::List &urls)
Engine::SimpleMetaBundle b; Engine::SimpleMetaBundle b;
char* saveptr; char* saveptr;
KURL url = TQString("cdda://").append( strtok_r(reply_ptr,"=",&saveptr)); KURL url = TQString(TQString("cdda://").append( strtok_r(reply_ptr,"=",&saveptr)));
urls << url; urls << url;
debug() << url << endl; debug() << url << endl;
b.title = TQString( i18n( "Track %1" ) ).tqarg( i+1 ); b.title = TQString( i18n( "Track %1" ) ).tqarg( i+1 );

@ -532,7 +532,7 @@ DaapClient::passwordPrompt()
KPasswordEdit* m_input; KPasswordEdit* m_input;
}; };
Daap::Reader* callback = dynamic_cast<Daap::Reader*>( const_cast<TQObject*>( sender() ) ); Daap::Reader* callback = dynamic_cast<Daap::Reader*>( const_cast<TQT_BASE_OBJECT_NAME*>( sender() ) );
if (!callback) { if (!callback) {
debug() << "No callback!" << endl; debug() << "No callback!" << endl;
return; return;
@ -817,7 +817,7 @@ DaapDownloader::doJob()
KTempFile* tempNewFile = new KTempFile( TQString(), '.' + TQFileInfo( (*urlIt).path() ).extension() ); KTempFile* tempNewFile = new KTempFile( TQString(), '.' + TQFileInfo( (*urlIt).path() ).extension() );
tempNewFile->setAutoDelete( true ); tempNewFile->setAutoDelete( true );
m_tempFileList.append( tempNewFile ); m_tempFileList.append( tempNewFile );
http->getDaap( (*urlIt).path() + (*urlIt).query(), tempNewFile->file() ); http->getDaap( (*urlIt).path() + (*urlIt).query(), TQT_TQIODEVICE(tempNewFile->file()) );
while( !m_ready && !isAborted() ) while( !m_ready && !isAborted() )
{ {
msleep( 100 ); //Sleep 100 msec msleep( 100 ); //Sleep 100 msec

@ -167,7 +167,13 @@ class ServerItem : public TQObject, public MediaItem
static const int ANIMATION_INTERVAL = 250; static const int ANIMATION_INTERVAL = 250;
}; };
#ifdef Q_MOC_RUN
// MOC_SKIP_BEGIN
class DaapDownloader : public JobBase
// MOC_SKIP_END
#else
class DaapDownloader : public ThreadManager::Job class DaapDownloader : public ThreadManager::Job
#endif
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT TQ_OBJECT

@ -47,7 +47,7 @@ TQDataStream&
ContentFetcher::results() ContentFetcher::results()
{ {
TQBuffer* bytes = new TQBuffer( readAll() ); TQBuffer* bytes = new TQBuffer( readAll() );
TQIODevice* stream = KFilterDev::device( bytes, "application/x-gzip", false ); TQIODevice* stream = KFilterDev::device( TQT_TQIODEVICE(bytes), "application/x-gzip", false );
stream->open( IO_ReadOnly ); stream->open( IO_ReadOnly );
TQDataStream* ds = new TQDataStream( stream ); TQDataStream* ds = new TQDataStream( stream );
return *ds; return *ds;

@ -170,7 +170,7 @@ Reader::logoutRequest()
void void
Reader::logoutRequest( int, bool ) Reader::logoutRequest( int, bool )
{ {
const_cast<TQObject*>(sender())->deleteLater(); const_cast<TQT_BASE_OBJECT_NAME*>(sender())->deleteLater();
deleteLater(); deleteLater();
} }
@ -418,7 +418,7 @@ Reader::addElement( Map &tqparentMap, char* tag, TQVariant element )
void void
Reader::fetchingError( const TQString& error ) Reader::fetchingError( const TQString& error )
{ {
const_cast< TQObject* >( sender() )->deleteLater(); const_cast<TQT_BASE_OBJECT_NAME*>( sender() )->deleteLater();
emit httpError( error ); emit httpError( error );
} }
#include "reader.moc" #include "reader.moc"

@ -62,7 +62,7 @@ DaapServer::readSql()
line.remove( 0, sqlPrefix.length() ); line.remove( 0, sqlPrefix.length() );
debug() << "sql run " << line << endl; debug() << "sql run " << line << endl;
m_server->writeStdin( CollectionDB::instance()->query( line ).join("\n") ); m_server->writeStdin( CollectionDB::instance()->query( line ).join("\n") );
m_server->writeStdin( "**** END SQL ****" ); m_server->writeStdin( TQString("**** END SQL ****") );
} }
else if( line.startsWith( serverStartPrefix ) ) else if( line.startsWith( serverStartPrefix ) )
{ {

@ -419,7 +419,7 @@ IfpMediaDevice::copyTrackToDevice( const MetaBundle& bundle )
const TQCString dest = TQFile::encodeName( cleanPath(directory + newFilename) ); const TQCString dest = TQFile::encodeName( cleanPath(directory + newFilename) );
kapp->processEvents( 100 ); kapp->tqprocessEvents( 100 );
int result = uploadTrack( src, dest ); int result = uploadTrack( src, dest );
if( !result ) //success if( !result ) //success
@ -486,7 +486,7 @@ IfpMediaDevice::filetransferCallback( void *pData, struct ifp_transfer_status *p
{ {
// will be called by 'ifp_upload_file' by callback // will be called by 'ifp_upload_file' by callback
kapp->processEvents( 100 ); kapp->tqprocessEvents( 100 );
IfpMediaDevice *that = static_cast<IfpMediaDevice *>(pData); IfpMediaDevice *that = static_cast<IfpMediaDevice *>(pData);
@ -526,14 +526,14 @@ IfpMediaDevice::deleteItemFromDevice( MediaItem *item, int /*flags*/ )
case MediaItem::DIRECTORY: case MediaItem::DIRECTORY:
err = ifp_delete_dir_recursive( &m_ifpdev, encodedPath ); err = ifp_delete_dir_recursive( &m_ifpdev, encodedPath );
debug() << "Deleting folder: " << encodedPath << endl; debug() << "Deleting folder: " << encodedPath << endl;
checkResult( err, i18n("Directory cannot be deleted: '%1'").tqarg(encodedPath) ); checkResult( err, i18n("Directory cannot be deleted: '%1'").tqarg(encodedPath.data()) );
break; break;
default: default:
err = ifp_delete( &m_ifpdev, encodedPath ); err = ifp_delete( &m_ifpdev, encodedPath );
debug() << "Deleting file: " << encodedPath << endl; debug() << "Deleting file: " << encodedPath << endl;
count += 1; count += 1;
checkResult( err, i18n("File does not exist: '%1'").tqarg(encodedPath) ); checkResult( err, i18n("File does not exist: '%1'").tqarg(encodedPath.data()) );
break; break;
} }
if( err == 0 ) //success if( err == 0 ) //success
@ -587,9 +587,9 @@ IfpMediaDevice::addTrackToList( int type, TQString name, int /*size*/ )
else if( type == IFP_FILE ) //file else if( type == IFP_FILE ) //file
{ {
if( name.endsWith( "mp3", false ) || name.endsWith( "wma", false ) || if( name.tqendsWith( "mp3", false ) || name.tqendsWith( "wma", false ) ||
name.endsWith( "wav", false ) || name.endsWith( "ogg", false ) || name.tqendsWith( "wav", false ) || name.tqendsWith( "ogg", false ) ||
name.endsWith( "asf", false ) ) name.tqendsWith( "asf", false ) )
m_last->setType( MediaItem::TRACK ); m_last->setType( MediaItem::TRACK );

@ -139,7 +139,7 @@ MtpMediaDevice::progressCallback( uint64_t const sent, uint64_t const total, voi
Q_UNUSED( sent ); Q_UNUSED( sent );
Q_UNUSED( total ); Q_UNUSED( total );
kapp->processEvents( 100 ); kapp->tqprocessEvents( 100 );
MtpMediaDevice *dev = (MtpMediaDevice*)(data); MtpMediaDevice *dev = (MtpMediaDevice*)(data);
@ -188,12 +188,12 @@ MediaItem
// fallback to checking the extension (e.g. .wma, .ogg, etc) // fallback to checking the extension (e.g. .wma, .ogg, etc)
debug() << "No filetype found by Amarok filetype" << endl; debug() << "No filetype found by Amarok filetype" << endl;
const TQString extension = bundle.url().path().section( ".", -1 ).lower(); const TQString extension = TQString(bundle.url().path().section( ".", -1 )).lower();
int libmtp_type = m_supportedFiles.findIndex( extension ); int libmtp_type = m_supportedFiles.tqfindIndex( extension );
if( libmtp_type >= 0 ) if( libmtp_type >= 0 )
{ {
int keyIndex = mtpFileTypes.values().findIndex( extension ); int keyIndex = mtpFileTypes.values().tqfindIndex( extension );
libmtp_type = mtpFileTypes.keys()[keyIndex]; libmtp_type = mtpFileTypes.keys()[keyIndex];
trackmeta->filetype = (LIBMTP_filetype_t) libmtp_type; trackmeta->filetype = (LIBMTP_filetype_t) libmtp_type;
debug() << "set filetype to " << libmtp_type << " based on extension of ." << extension << endl; debug() << "set filetype to " << libmtp_type << " based on extension of ." << extension << endl;
@ -321,7 +321,7 @@ MediaItem
LIBMTP_destroy_track_t( trackmeta ); LIBMTP_destroy_track_t( trackmeta );
kapp->processEvents( 100 ); kapp->tqprocessEvents( 100 );
// add track to view and to new tracks list // add track to view and to new tracks list
MediaItem *newItem = addTrackToView( taggedTrack ); MediaItem *newItem = addTrackToView( taggedTrack );
@ -436,7 +436,7 @@ MtpMediaDevice::updateAlbumArt( TQPtrList<MediaItem> *items )
setCanceled( false ); setCanceled( false );
kapp->processEvents( 100 ); kapp->tqprocessEvents( 100 );
TQMap< TQString, TQPtrList<MediaItem> > albumList; TQMap< TQString, TQPtrList<MediaItem> > albumList;
for( MtpMediaItem *it = dynamic_cast<MtpMediaItem*>(items->first()); it && !(m_canceled); it = dynamic_cast<MtpMediaItem*>(items->next()) ) for( MtpMediaItem *it = dynamic_cast<MtpMediaItem*>(items->first()); it && !(m_canceled); it = dynamic_cast<MtpMediaItem*>(items->next()) )
@ -453,14 +453,14 @@ MtpMediaDevice::updateAlbumArt( TQPtrList<MediaItem> *items )
} }
int i = 0; int i = 0;
setProgress( i, albumList.count() ); setProgress( i, albumList.count() );
kapp->processEvents( 100 ); kapp->tqprocessEvents( 100 );
TQMap< TQString, TQPtrList<MediaItem> >::Iterator it; TQMap< TQString, TQPtrList<MediaItem> >::Iterator it;
for( it = albumList.begin(); it != albumList.end(); ++it ) for( it = albumList.begin(); it != albumList.end(); ++it )
{ {
sendAlbumArt( &it.data() ); sendAlbumArt( &it.data() );
setProgress( ++i ); setProgress( ++i );
if( i % 20 == 0 ) if( i % 20 == 0 )
kapp->processEvents( 100 ); kapp->tqprocessEvents( 100 );
} }
hideProgress(); hideProgress();
} }
@ -744,7 +744,7 @@ MtpMediaDevice::synchronizeDevice()
MediaItem MediaItem
*MtpMediaDevice::trackExists( const MetaBundle &bundle ) *MtpMediaDevice::trackExists( const MetaBundle &bundle )
{ {
MediaItem *artist = dynamic_cast<MediaItem *>( m_view->findItem( bundle.artist(), 0 ) ); MediaItem *artist = dynamic_cast<MediaItem *>( m_view->tqfindItem( bundle.artist(), 0 ) );
if( artist ) if( artist )
{ {
MediaItem *album = dynamic_cast<MediaItem *>( artist->findItem( bundle.album() ) ); MediaItem *album = dynamic_cast<MediaItem *>( artist->findItem( bundle.album() ) );
@ -1053,7 +1053,7 @@ MtpMediaDevice::deleteObject( MtpMediaItem *deleteItem )
m_fileNameToItem.remove( TQString( "%1/%2" ).tqarg( deleteItem->track()->folderId() ).tqarg( deleteItem->bundle()->filename() ) ); m_fileNameToItem.remove( TQString( "%1/%2" ).tqarg( deleteItem->track()->folderId() ).tqarg( deleteItem->bundle()->filename() ) );
// remove from the media view // remove from the media view
delete deleteItem; delete deleteItem;
kapp->processEvents( 100 ); kapp->tqprocessEvents( 100 );
return 1; return 1;
} }
@ -1137,11 +1137,11 @@ MtpMediaDevice::openDevice( bool silent )
m_supportedFiles << mtpFileTypes[ filetypes[ i ] ]; m_supportedFiles << mtpFileTypes[ filetypes[ i ] ];
} }
// find supported image types (for album art). // find supported image types (for album art).
if( m_supportedFiles.findIndex( "jpg" ) ) if( m_supportedFiles.tqfindIndex( "jpg" ) )
m_format = "JPEG"; m_format = "JPEG";
else if( m_supportedFiles.findIndex( "png" ) ) else if( m_supportedFiles.tqfindIndex( "png" ) )
m_format = "PNG"; m_format = "PNG";
else if( m_supportedFiles.findIndex( "gif" ) ) else if( m_supportedFiles.tqfindIndex( "gif" ) )
m_format = "GIF"; m_format = "GIF";
free( filetypes ); free( filetypes );
m_critical_mutex.unlock(); m_critical_mutex.unlock();
@ -1422,7 +1422,7 @@ MtpMediaItem
{ {
TQString artistName = track->bundle()->artist(); TQString artistName = track->bundle()->artist();
MtpMediaItem *artist = dynamic_cast<MtpMediaItem *>( m_view->findItem( artistName, 0 ) ); MtpMediaItem *artist = dynamic_cast<MtpMediaItem *>( m_view->tqfindItem( artistName, 0 ) );
if( !artist ) if( !artist )
{ {
artist = new MtpMediaItem(m_view); artist = new MtpMediaItem(m_view);
@ -1478,7 +1478,7 @@ MtpMediaDevice::readMtpMusic()
int progress = 0; int progress = 0;
setProgress( progress, total ); // we don't know how many tracks. fake progress bar. setProgress( progress, total ); // we don't know how many tracks. fake progress bar.
kapp->processEvents( 100 ); kapp->tqprocessEvents( 100 );
LIBMTP_track_t *tracks = LIBMTP_Get_Tracklisting_With_Callback( m_device, progressCallback, this ); LIBMTP_track_t *tracks = LIBMTP_Get_Tracklisting_With_Callback( m_device, progressCallback, this );
@ -1512,7 +1512,7 @@ MtpMediaDevice::readMtpMusic()
progress++; progress++;
setProgress( progress ); setProgress( progress );
if( progress % 50 == 0 ) if( progress % 50 == 0 )
kapp->processEvents( 100 ); kapp->tqprocessEvents( 100 );
} }
} }
@ -1562,7 +1562,7 @@ MtpMediaDevice::readPlaylists()
tmp = playlists; tmp = playlists;
playlists = playlists->next; playlists = playlists->next;
LIBMTP_destroy_playlist_t( tmp ); LIBMTP_destroy_playlist_t( tmp );
kapp->processEvents( 50 ); kapp->tqprocessEvents( 50 );
} }
} }
} }
@ -1585,7 +1585,7 @@ MtpMediaDevice::readAlbums()
tmp = albums; tmp = albums;
albums = albums->next; albums = albums->next;
LIBMTP_destroy_album_t( tmp ); LIBMTP_destroy_album_t( tmp );
kapp->processEvents( 50 ); kapp->tqprocessEvents( 50 );
} }
} }
} }

@ -380,7 +380,7 @@ NjbMediaDevice::downloadToCollection()
TQPtrList<MediaItem> items; TQPtrList<MediaItem> items;
m_view->getSelectedLeaves( 0, &items ); m_view->getSelectedLeaves( 0, &items );
KTempDir tempdir; // 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. tempdir.setAutoDelete( true ); // We don't need it once the work is done.
TQString path = tempdir.name(), filepath; TQString path = tempdir.name(), filepath;
KURL::List urls; KURL::List urls;
@ -452,7 +452,7 @@ NjbMediaDevice::copyTrackToDevice(const MetaBundle& bundle)
njb_songid_t* songid = NJB_Songid_New(); njb_songid_t* songid = NJB_Songid_New();
taggedTrack->writeToSongid( songid ); taggedTrack->writeToSongid( songid );
m_busy = true; m_busy = true;
kapp->processEvents( 100 ); kapp->tqprocessEvents( 100 );
if(NJB_Send_Track (m_njb, bundle.url().path().utf8(), songid, progressCallback, this, &id) != NJB_SUCCESS) if(NJB_Send_Track (m_njb, bundle.url().path().utf8(), songid, progressCallback, this, &id) != NJB_SUCCESS)
{ {
debug() << ": NJB_Send_Track failed\n"; debug() << ": NJB_Send_Track failed\n";
@ -614,7 +614,7 @@ NjbMediaDevice::removeConfigElements(TQWidget* arg1)
MediaItem * MediaItem *
NjbMediaDevice::trackExists( const MetaBundle & bundle ) NjbMediaDevice::trackExists( const MetaBundle & bundle )
{ {
MediaItem *artist = dynamic_cast<MediaItem *>( m_view->findItem( bundle.artist(), 0 ) ); MediaItem *artist = dynamic_cast<MediaItem *>( m_view->tqfindItem( bundle.artist(), 0 ) );
if ( artist ) if ( artist )
{ {
MediaItem *album = dynamic_cast<MediaItem *>( artist->findItem( bundle.album() ) ); MediaItem *album = dynamic_cast<MediaItem *>( artist->findItem( bundle.album() ) );
@ -687,7 +687,7 @@ NjbMediaDevice::runTransferDialog()
int int
NjbMediaDevice::progressCallback( u_int64_t sent, u_int64_t total, const char* /*buf*/, unsigned /*len*/, void* data) NjbMediaDevice::progressCallback( u_int64_t sent, u_int64_t total, const char* /*buf*/, unsigned /*len*/, void* data)
{ {
kapp->processEvents( 100 ); kapp->tqprocessEvents( 100 );
NjbMediaDevice *njb_media = reinterpret_cast<NjbMediaDevice*>(data); NjbMediaDevice *njb_media = reinterpret_cast<NjbMediaDevice*>(data);
@ -733,11 +733,11 @@ NjbMediaDevice::readJukeboxMusic( void )
m_playlistItem->m_order = -5; m_playlistItem->m_order = -5;
m_playlistItem->setType( MediaItem::PLAYLISTSROOT );*/ m_playlistItem->setType( MediaItem::PLAYLISTSROOT );*/
kapp->processEvents( 100 ); kapp->tqprocessEvents( 100 );
for( trackValueList::iterator it = trackList.begin(); it != trackList.end(); it++ ) for( trackValueList::iterator it = trackList.begin(); it != trackList.end(); it++ )
{ {
if( m_view->findItem( ((*it)->bundle()->artist().string()), 0 ) == 0 ) if( m_view->tqfindItem( ((*it)->bundle()->artist().string()), 0 ) == 0 )
{ {
NjbMediaItem *artist = new NjbMediaItem( m_view ); NjbMediaItem *artist = new NjbMediaItem( m_view );
artist->setText( 0, (*it)->bundle()->artist() ); artist->setText( 0, (*it)->bundle()->artist() );
@ -757,7 +757,7 @@ NjbMediaDevice::addTrackToView( NjbTrack *track, NjbMediaItem *item )
{ {
TQString artistName = track->bundle()->artist(); TQString artistName = track->bundle()->artist();
NjbMediaItem *artist = dynamic_cast<NjbMediaItem *>( m_view->findItem( artistName, 0 ) ); NjbMediaItem *artist = dynamic_cast<NjbMediaItem *>( m_view->tqfindItem( artistName, 0 ) );
if(!artist) if(!artist)
{ {
artist = new NjbMediaItem(m_view); artist = new NjbMediaItem(m_view);
@ -869,7 +869,7 @@ NjbMediaDevice::addTracks(const TQString &artist, const TQString &album, NjbMedi
NjbMediaItem* NjbMediaItem*
NjbMediaDevice::addArtist( NjbTrack *track ) NjbMediaDevice::addArtist( NjbTrack *track )
{ {
if( m_view->findItem( track->bundle()->artist().string(), 0 ) == 0 ) if( m_view->tqfindItem( track->bundle()->artist().string(), 0 ) == 0 )
{ {
NjbMediaItem *artist = new NjbMediaItem( m_view ); NjbMediaItem *artist = new NjbMediaItem( m_view );
artist->setText( 0, track->bundle()->artist() ); artist->setText( 0, track->bundle()->artist() );
@ -878,7 +878,7 @@ NjbMediaDevice::addArtist( NjbTrack *track )
artist->setBundle( track->bundle() ); artist->setBundle( track->bundle() );
artist->m_device = this; artist->m_device = this;
} }
return dynamic_cast<NjbMediaItem *>( m_view->findItem( track->bundle()->artist().string(), 0 ) ); return dynamic_cast<NjbMediaItem *>( m_view->tqfindItem( track->bundle()->artist().string(), 0 ) );
} }
void void

@ -85,7 +85,7 @@ class NjbMediaItem : public MediaItem
class NjbMediaDevice : public MediaDevice class NjbMediaDevice : public MediaDevice
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT TQ_OBJECT
public: public:
NjbMediaDevice(); NjbMediaDevice();

Loading…
Cancel
Save