rename the following methods:

tqfind find
tqreplace replace
tqcontains contains


git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/k3b@1246075 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 12 years ago
parent 6d99e1e138
commit 33881ea444

@ -234,7 +234,7 @@ void K3bSetup2::updatePrograms()
d->binListMap.insert( b, bi );
// check the item on first insertion or if it was checked before
bi->setOn( checkMap.tqcontains(b) ? checkMap[b] : true );
bi->setOn( checkMap.contains(b) ? checkMap[b] : true );
int perm = s.st_mode & 0007777;
@ -289,12 +289,12 @@ void K3bSetup2::updateDevices()
K3bDevice::Device* device = *it;
// check the item on first insertion or if it was checked before
TQCheckListItem* item = createDeviceItem( device->blockDeviceName() );
item->setOn( checkMap.tqcontains(device->blockDeviceName()) ? checkMap[device->blockDeviceName()] : true );
item->setOn( checkMap.contains(device->blockDeviceName()) ? checkMap[device->blockDeviceName()] : true );
item->setText( 0, device->vendor() + " " + device->description() );
if( !device->genericDevice().isEmpty() ) {
TQCheckListItem* item = createDeviceItem( device->genericDevice() );
item->setOn( checkMap.tqcontains(device->genericDevice()) ? checkMap[device->genericDevice()] : true );
item->setOn( checkMap.contains(device->genericDevice()) ? checkMap[device->genericDevice()] : true );
item->setText( 0, device->vendor() + " " + device->description() + " (" + i18n("Generic SCSI Device") + ")" );
}
}

@ -171,7 +171,7 @@ void K3bCddb::slotQueryFinished( K3bCddbQuery* query )
K3bCddbQuery* K3bCddb::getQuery( const TQString& s )
{
TQStringList buf = TQStringList::split( ":", s.mid( s.tqfind(" ")+1 ) );
TQStringList buf = TQStringList::split( ":", s.mid( s.find(" ")+1 ) );
TQString server = buf[0];
int port = buf[1].toInt();

@ -117,7 +117,7 @@ TQString K3bCddbLocalQuery::preparePath( const TQString& p )
{
TQString path = p;
if( path.startsWith( "~" ) )
path.tqreplace( 0, 1, TQDir::homeDirPath() );
path.replace( 0, 1, TQDir::homeDirPath() );
else if( !path.startsWith( "/" ) )
path.prepend( TQDir::homeDirPath() );
if( path[path.length()-1] != '/' )

@ -40,7 +40,7 @@ void K3bCddbLocalSubmit::doSubmit()
{
TQString path = m_cddbDir;
if( path.startsWith( "~" ) )
path.tqreplace( 0, 1, TQDir::homeDirPath() + "/" );
path.replace( 0, 1, TQDir::homeDirPath() + "/" );
else if( !path.startsWith( "/" ) )
path.prepend( TQDir::homeDirPath() + "/" );
if( path[path.length()-1] != '/' )

@ -108,7 +108,7 @@ bool K3bCddbQuery::parseEntry( TQTextStream& stream, K3bCddbResultEntry& entry )
}
else if( line.startsWith( "TTITLE" ) ) {
int eqSgnPos = line.tqfind( "=" );
int eqSgnPos = line.find( "=" );
bool ok;
uint trackNum = (uint)line.mid( 6, eqSgnPos - 6 ).toInt( &ok );
if( !ok )
@ -129,7 +129,7 @@ bool K3bCddbQuery::parseEntry( TQTextStream& stream, K3bCddbResultEntry& entry )
}
else if( line.startsWith( "EXTT" ) ) {
int eqSgnPos = line.tqfind( "=" );
int eqSgnPos = line.find( "=" );
bool ok;
uint trackNum = (uint)line.mid( 4, eqSgnPos - 4 ).toInt( &ok );
if( !ok )
@ -158,7 +158,7 @@ bool K3bCddbQuery::parseEntry( TQTextStream& stream, K3bCddbResultEntry& entry )
// if no " / " delimiter is present title and artist are the same
// -------------------------------------------------------------------
TQString fullTitle = entry.cdTitle;
int splitPos = fullTitle.tqfind( " / " );
int splitPos = fullTitle.find( " / " );
if( splitPos < 0 )
entry.cdArtist = fullTitle;
else {
@ -171,7 +171,7 @@ bool K3bCddbQuery::parseEntry( TQTextStream& stream, K3bCddbResultEntry& entry )
for( TQStringList::iterator it = entry.titles.begin();
it != entry.titles.end(); ++it ) {
TQString fullTitle = *it;
int splitPos = fullTitle.tqfind( " / " );
int splitPos = fullTitle.find( " / " );
if( splitPos < 0 )
entry.artists.append( entry.cdArtist );
else {
@ -185,23 +185,23 @@ bool K3bCddbQuery::parseEntry( TQTextStream& stream, K3bCddbResultEntry& entry )
// replace all "\\n" with "\n"
for( TQStringList::iterator it = entry.titles.begin();
it != entry.titles.end(); ++it ) {
(*it).tqreplace( "\\\\\\\\n", "\\n" );
(*it).replace( "\\\\\\\\n", "\\n" );
}
for( TQStringList::iterator it = entry.artists.begin();
it != entry.artists.end(); ++it ) {
(*it).tqreplace( "\\\\\\\\n", "\\n" );
(*it).replace( "\\\\\\\\n", "\\n" );
}
for( TQStringList::iterator it = entry.extInfos.begin();
it != entry.extInfos.end(); ++it ) {
(*it).tqreplace( "\\\\\\\\n", "\\n" );
(*it).replace( "\\\\\\\\n", "\\n" );
}
entry.cdTitle.tqreplace( "\\\\\\\\n", "\\n" );
entry.cdArtist.tqreplace( "\\\\\\\\n", "\\n" );
entry.cdExtInfo.tqreplace( "\\\\\\\\n", "\\n" );
entry.genre.tqreplace( "\\\\\\\\n", "\\n" );
entry.cdTitle.replace( "\\\\\\\\n", "\\n" );
entry.cdArtist.replace( "\\\\\\\\n", "\\n" );
entry.cdExtInfo.replace( "\\\\\\\\n", "\\n" );
entry.genre.replace( "\\\\\\\\n", "\\n" );
return true;
}
@ -254,7 +254,7 @@ bool K3bCddbQuery::parseMatchHeader( const TQString& line, K3bCddbResultHeader&
header.category = line.section( ' ', 0, 0 );
header.discid = line.section( ' ', 1, 1 );
header.title = line.mid( header.category.length() + header.discid.length() + 2 );
int slashPos = header.title.tqfind( "/" );
int slashPos = header.title.find( "/" );
if( slashPos > 0 ) {
header.artist = header.title.left(slashPos).stripWhiteSpace();
header.title = header.title.mid( slashPos+1 ).stripWhiteSpace();

@ -346,7 +346,7 @@ void K3bCore::unblockDevice( K3bDevice::Device* dev )
bool K3bCore::internalBlockDevice( K3bDevice::Device* dev )
{
if( !d->blockedDevices.tqcontains( dev ) ) {
if( !d->blockedDevices.contains( dev ) ) {
d->blockedDevices.append( dev );
return true;
}

@ -101,7 +101,7 @@ static TQString& debianWeirdnessHack( TQString& path )
TQFile f( path );
f.open( IO_ReadOnly );
TQString s = TQTextStream( &f ).read();
if( s.tqcontains( "cdrecord.mmap" ) && s.tqcontains( "cdrecord.shm" ) ) {
if( s.contains( "cdrecord.mmap" ) && s.contains( "cdrecord.shm" ) ) {
kdDebug() << "(K3bCdrecordProgram) Found Debian Wrapper script." << endl;
TQString ext;
if( K3b::kernelVersion().versionString().left(3) > "2.2" )
@ -155,23 +155,23 @@ bool K3bCdrecordProgram::scan( const TQString& p )
if( vp.start( KProcess::Block, KProcess::AllOutput ) ) {
int pos = -1;
if( wodim ) {
pos = out.output().tqfind( "Wodim" );
pos = out.output().find( "Wodim" );
}
else if( m_dvdPro ) {
pos = out.output().tqfind( "Cdrecord-ProDVD" );
pos = out.output().find( "Cdrecord-ProDVD" );
}
else {
pos = out.output().tqfind( "Cdrecord" );
pos = out.output().find( "Cdrecord" );
}
if( pos < 0 )
return false;
pos = out.output().tqfind( TQRegExp("[0-9]"), pos );
pos = out.output().find( TQRegExp("[0-9]"), pos );
if( pos < 0 )
return false;
int endPos = out.output().tqfind( TQRegExp("\\s"), pos+1 );
int endPos = out.output().find( TQRegExp("\\s"), pos+1 );
if( endPos < 0 )
return false;
@ -182,8 +182,8 @@ bool K3bCdrecordProgram::scan( const TQString& p )
if( wodim )
bin->addFeature( "wodim" );
pos = out.output().tqfind( "Copyright") + 14;
endPos = out.output().tqfind( "\n", pos );
pos = out.output().find( "Copyright") + 14;
endPos = out.output().find( "\n", pos );
// cdrecord does not use local encoding for the copyright statement but plain latin1
bin->copyright = TQString::tqfromLatin1( out.output().mid( pos, endPos-pos ).local8Bit() ).stripWhiteSpace();
@ -203,17 +203,17 @@ bool K3bCdrecordProgram::scan( const TQString& p )
out.setProcess( &fp );
fp << path << "-help";
if( fp.start( KProcess::Block, KProcess::AllOutput ) ) {
if( out.output().tqcontains( "gracetime" ) )
if( out.output().contains( "gracetime" ) )
bin->addFeature( "gracetime" );
if( out.output().tqcontains( "-overburn" ) )
if( out.output().contains( "-overburn" ) )
bin->addFeature( "overburn" );
if( out.output().tqcontains( "-text" ) )
if( out.output().contains( "-text" ) )
bin->addFeature( "cdtext" );
if( out.output().tqcontains( "-clone" ) )
if( out.output().contains( "-clone" ) )
bin->addFeature( "clone" );
if( out.output().tqcontains( "-tao" ) )
if( out.output().contains( "-tao" ) )
bin->addFeature( "tao" );
if( out.output().tqcontains( "cuefile=" ) &&
if( out.output().contains( "cuefile=" ) &&
( wodim || bin->version > K3bVersion( 2, 1, -1, "a14") ) ) // cuefile handling was still buggy in a14
bin->addFeature( "cuefile" );
@ -222,7 +222,7 @@ bool K3bCdrecordProgram::scan( const TQString& p )
// just double-checked and the help page is proper but there is no harm in having
// two checks)
// and the version check does not handle versions like 2.01-dvd properly
if( out.output().tqcontains( "-xamix" ) ||
if( out.output().contains( "-xamix" ) ||
bin->version >= K3bVersion( 2, 1, -1, "a12" ) ||
wodim )
bin->addFeature( "xamix" );
@ -303,18 +303,18 @@ bool K3bMkisofsProgram::scan( const TQString& p )
if( vp.start( KProcess::Block, KProcess::AllOutput ) ) {
int pos = -1;
if( genisoimage )
pos = out.output().tqfind( "genisoimage" );
pos = out.output().find( "genisoimage" );
else
pos = out.output().tqfind( "mkisofs" );
pos = out.output().find( "mkisofs" );
if( pos < 0 )
return false;
pos = out.output().tqfind( TQRegExp("[0-9]"), pos );
pos = out.output().find( TQRegExp("[0-9]"), pos );
if( pos < 0 )
return false;
int endPos = out.output().tqfind( ' ', pos+1 );
int endPos = out.output().find( ' ', pos+1 );
if( endPos < 0 )
return false;
@ -337,15 +337,15 @@ bool K3bMkisofsProgram::scan( const TQString& p )
fp << path << "-help";
out.setProcess( &fp );
if( fp.start( KProcess::Block, KProcess::AllOutput ) ) {
if( out.output().tqcontains( "-udf" ) )
if( out.output().contains( "-udf" ) )
bin->addFeature( "udf" );
if( out.output().tqcontains( "-dvd-video" ) )
if( out.output().contains( "-dvd-video" ) )
bin->addFeature( "dvd-video" );
if( out.output().tqcontains( "-joliet-long" ) )
if( out.output().contains( "-joliet-long" ) )
bin->addFeature( "joliet-long" );
if( out.output().tqcontains( "-xa" ) )
if( out.output().contains( "-xa" ) )
bin->addFeature( "xa" );
if( out.output().tqcontains( "-sectype" ) )
if( out.output().contains( "-sectype" ) )
bin->addFeature( "sectype" );
// check if we run mkisofs as root
@ -418,17 +418,17 @@ bool K3bReadcdProgram::scan( const TQString& p )
if( vp.start( KProcess::Block, KProcess::AllOutput ) ) {
int pos = -1;
if( readom )
pos = out.output().tqfind( "readom" );
pos = out.output().find( "readom" );
else
pos = out.output().tqfind( "readcd" );
pos = out.output().find( "readcd" );
if( pos < 0 )
return false;
pos = out.output().tqfind( TQRegExp("[0-9]"), pos );
pos = out.output().find( TQRegExp("[0-9]"), pos );
if( pos < 0 )
return false;
int endPos = out.output().tqfind( ' ', pos+1 );
int endPos = out.output().find( ' ', pos+1 );
if( endPos < 0 )
return false;
@ -451,7 +451,7 @@ bool K3bReadcdProgram::scan( const TQString& p )
fp << path << "-help";
out.setProcess( &fp );
if( fp.start( KProcess::Block, KProcess::AllOutput ) ) {
if( out.output().tqcontains( "-clone" ) )
if( out.output().contains( "-clone" ) )
bin->addFeature( "clone" );
// check if we run mkisofs as root
@ -507,15 +507,15 @@ bool K3bCdrdaoProgram::scan( const TQString& p )
vp << path ;
K3bProcessOutputCollector out( &vp );
if( vp.start( KProcess::Block, KProcess::AllOutput ) ) {
int pos = out.output().tqfind( "Cdrdao version" );
int pos = out.output().find( "Cdrdao version" );
if( pos < 0 )
return false;
pos = out.output().tqfind( TQRegExp("[0-9]"), pos );
pos = out.output().find( TQRegExp("[0-9]"), pos );
if( pos < 0 )
return false;
int endPos = out.output().tqfind( ' ', pos+1 );
int endPos = out.output().find( ' ', pos+1 );
if( endPos < 0 )
return false;
@ -523,8 +523,8 @@ bool K3bCdrdaoProgram::scan( const TQString& p )
bin->path = path;
bin->version = out.output().mid( pos, endPos-pos );
pos = out.output().tqfind( "(C)", endPos+1 ) + 4;
endPos = out.output().tqfind( '\n', pos );
pos = out.output().find( "(C)", endPos+1 ) + 4;
endPos = out.output().find( '\n', pos );
bin->copyright = out.output().mid( pos, endPos-pos );
}
else {
@ -539,12 +539,12 @@ bool K3bCdrdaoProgram::scan( const TQString& p )
fp << path << "write" << "-h";
out.setProcess( &fp );
if( fp.start( KProcess::Block, KProcess::AllOutput ) ) {
if( out.output().tqcontains( "--overburn" ) )
if( out.output().contains( "--overburn" ) )
bin->addFeature( "overburn" );
if( out.output().tqcontains( "--multi" ) )
if( out.output().contains( "--multi" ) )
bin->addFeature( "multisession" );
if( out.output().tqcontains( "--buffer-under-run-protection" ) )
if( out.output().contains( "--buffer-under-run-protection" ) )
bin->addFeature( "disable-burnproof" );
// check if we run cdrdao as root
@ -605,13 +605,13 @@ bool K3bTranscodeProgram::scan( const TQString& p )
vp << appPath << "-v";
K3bProcessOutputCollector out( &vp );
if( vp.start( KProcess::Block, KProcess::AllOutput ) ) {
int pos = out.output().tqfind( "transcode v" );
int pos = out.output().find( "transcode v" );
if( pos < 0 )
return false;
pos += 11;
int endPos = out.output().tqfind( TQRegExp("[\\s\\)]"), pos+1 );
int endPos = out.output().find( TQRegExp("[\\s\\)]"), pos+1 );
if( endPos < 0 )
return false;
@ -679,13 +679,13 @@ bool K3bVcdbuilderProgram::scan( const TQString& p )
vp << path << "-V";
K3bProcessOutputCollector out( &vp );
if( vp.start( KProcess::Block, KProcess::AllOutput ) ) {
int pos = out.output().tqfind( "GNU VCDImager" );
int pos = out.output().find( "GNU VCDImager" );
if( pos < 0 )
return false;
pos += 14;
int endPos = out.output().tqfind( TQRegExp("[\\n\\)]"), pos+1 );
int endPos = out.output().find( TQRegExp("[\\n\\)]"), pos+1 );
if( endPos < 0 )
return false;
@ -693,8 +693,8 @@ bool K3bVcdbuilderProgram::scan( const TQString& p )
bin->path = path;
bin->version = out.output().mid( pos, endPos-pos ).stripWhiteSpace();
pos = out.output().tqfind( "Copyright" ) + 14;
endPos = out.output().tqfind( "\n", pos );
pos = out.output().find( "Copyright" ) + 14;
endPos = out.output().find( "\n", pos );
bin->copyright = out.output().mid( pos, endPos-pos ).stripWhiteSpace();
}
else {
@ -737,15 +737,15 @@ bool K3bNormalizeProgram::scan( const TQString& p )
vp << path << "--version";
if( vp.start( KProcess::Block, KProcess::AllOutput ) ) {
int pos = out.output().tqfind( "normalize" );
int pos = out.output().find( "normalize" );
if( pos < 0 )
return false;
pos = out.output().tqfind( TQRegExp("\\d"), pos );
pos = out.output().find( TQRegExp("\\d"), pos );
if( pos < 0 )
return false;
int endPos = out.output().tqfind( TQRegExp("\\s"), pos+1 );
int endPos = out.output().find( TQRegExp("\\s"), pos+1 );
if( endPos < 0 )
return false;
@ -753,8 +753,8 @@ bool K3bNormalizeProgram::scan( const TQString& p )
bin->path = path;
bin->version = out.output().mid( pos, endPos-pos );
pos = out.output().tqfind( "Copyright" )+14;
endPos = out.output().tqfind( "\n", pos );
pos = out.output().find( "Copyright" )+14;
endPos = out.output().find( "\n", pos );
bin->copyright = out.output().mid( pos, endPos-pos ).stripWhiteSpace();
}
else {
@ -796,15 +796,15 @@ bool K3bGrowisofsProgram::scan( const TQString& p )
vp << path << "-version";
if( vp.start( KProcess::Block, KProcess::AllOutput ) ) {
int pos = out.output().tqfind( "growisofs" );
int pos = out.output().find( "growisofs" );
if( pos < 0 )
return false;
pos = out.output().tqfind( TQRegExp("\\d"), pos );
pos = out.output().find( TQRegExp("\\d"), pos );
if( pos < 0 )
return false;
int endPos = out.output().tqfind( ",", pos+1 );
int endPos = out.output().find( ",", pos+1 );
if( endPos < 0 )
return false;
@ -863,18 +863,18 @@ bool K3bDvdformatProgram::scan( const TQString& p )
if( vp.start( KProcess::Block, KProcess::AllOutput ) ) {
// different locales make searching for the +- char difficult
// so we simply ignore it.
int pos = out.output().tqfind( TQRegExp("DVD.*RAM format utility") );
int pos = out.output().find( TQRegExp("DVD.*RAM format utility") );
if( pos < 0 )
return false;
pos = out.output().tqfind( "version", pos );
pos = out.output().find( "version", pos );
if( pos < 0 )
return false;
pos += 8;
// the version ends in a dot.
int endPos = out.output().tqfind( TQRegExp("\\.\\D"), pos );
int endPos = out.output().find( TQRegExp("\\.\\D"), pos );
if( endPos < 0 )
return false;
@ -931,7 +931,7 @@ bool K3bDvdBooktypeProgram::scan( const TQString& p )
vp << path;
if( vp.start( KProcess::Block, KProcess::AllOutput ) ) {
int pos = out.output().tqfind( "dvd+rw-booktype" );
int pos = out.output().find( "dvd+rw-booktype" );
if( pos < 0 )
return false;
@ -980,18 +980,18 @@ bool K3bCdda2wavProgram::scan( const TQString& p )
vp << path << "-h";
if( vp.start( KProcess::Block, KProcess::AllOutput ) ) {
int pos = out.output().tqfind( "cdda2wav" );
int pos = out.output().find( "cdda2wav" );
if( pos < 0 )
return false;
pos = out.output().tqfind( "Version", pos );
pos = out.output().find( "Version", pos );
if( pos < 0 )
return false;
pos += 8;
// the version does not end in a space but the kernel info
int endPos = out.output().tqfind( TQRegExp("[^\\d\\.]"), pos );
int endPos = out.output().find( TQRegExp("[^\\d\\.]"), pos );
if( endPos < 0 )
return false;
@ -1001,15 +1001,15 @@ bool K3bCdda2wavProgram::scan( const TQString& p )
// features (we do this since the cdda2wav help says that the short
// options will disappear soon)
if( out.output().tqfind( "-info-only" ) )
if( out.output().find( "-info-only" ) )
bin->addFeature( "info-only" ); // otherwise use the -J option
if( out.output().tqfind( "-no-infofile" ) )
if( out.output().find( "-no-infofile" ) )
bin->addFeature( "no-infofile" ); // otherwise use the -H option
if( out.output().tqfind( "-gui" ) )
if( out.output().find( "-gui" ) )
bin->addFeature( "gui" ); // otherwise use the -g option
if( out.output().tqfind( "-bulk" ) )
if( out.output().find( "-bulk" ) )
bin->addFeature( "bulk" ); // otherwise use the -B option
if( out.output().tqfind( "dev=" ) )
if( out.output().find( "dev=" ) )
bin->addFeature( "dev" ); // otherwise use the -B option
}
else {

@ -61,7 +61,7 @@ const TQString& K3bExternalBin::name() const
bool K3bExternalBin::hasFeature( const TQString& f ) const
{
return m_features.tqcontains( f );
return m_features.contains( f );
}
@ -113,7 +113,7 @@ const K3bExternalBin* K3bExternalProgram::mostRecentBin() const
void K3bExternalProgram::addBin( K3bExternalBin* bin )
{
if( !m_bins.tqcontains( bin ) ) {
if( !m_bins.contains( bin ) ) {
// insertion sort
// the first bin in the list is always the one used
// so we default to using the newest one
@ -127,8 +127,8 @@ void K3bExternalProgram::addBin( K3bExternalBin* bin )
void K3bExternalProgram::setDefault( const K3bExternalBin* bin )
{
if( m_bins.tqcontains( bin ) )
m_bins.take( m_bins.tqfind( bin ) );
if( m_bins.contains( bin ) )
m_bins.take( m_bins.find( bin ) );
// the first bin in the list is always the one used
m_bins.insert( 0, bin );
@ -148,7 +148,7 @@ void K3bExternalProgram::setDefault( const TQString& path )
void K3bExternalProgram::addUserParameter( const TQString& p )
{
if( !m_userParameters.tqcontains( p ) )
if( !m_userParameters.contains( p ) )
m_userParameters.append(p);
}
@ -230,7 +230,7 @@ bool K3bExternalBinManager::saveConfig( KConfig* c )
bool K3bExternalBinManager::foundBin( const TQString& name )
{
if( m_programs.tqfind( name ) == m_programs.end() )
if( m_programs.find( name ) == m_programs.end() )
return false;
else
return (m_programs[name]->defaultBin() != 0);
@ -239,7 +239,7 @@ bool K3bExternalBinManager::foundBin( const TQString& name )
const TQString& K3bExternalBinManager::binPath( const TQString& name )
{
if( m_programs.tqfind( name ) == m_programs.end() )
if( m_programs.find( name ) == m_programs.end() )
return m_noPath;
if( m_programs[name]->defaultBin() != 0 )
@ -251,7 +251,7 @@ const TQString& K3bExternalBinManager::binPath( const TQString& name )
const K3bExternalBin* K3bExternalBinManager::binObject( const TQString& name )
{
if( m_programs.tqfind( name ) == m_programs.end() )
if( m_programs.find( name ) == m_programs.end() )
return 0;
return m_programs[name]->defaultBin();
@ -287,7 +287,7 @@ void K3bExternalBinManager::search()
TQString p = *it;
if( p[p.length()-1] == '/' )
p.truncate( p.length()-1 );
if( !paths.tqcontains( p ) && !paths.tqcontains( p + "/" ) )
if( !paths.contains( p ) && !paths.contains( p + "/" ) )
paths.append(p);
}
@ -299,7 +299,7 @@ void K3bExternalBinManager::search()
TQString p = *it;
if( p[p.length()-1] == '/' )
p.truncate( p.length()-1 );
if( !paths.tqcontains( p ) && !paths.tqcontains( p + "/" ) )
if( !paths.contains( p ) && !paths.contains( p + "/" ) )
paths.append(p);
}
}
@ -334,7 +334,7 @@ void K3bExternalBinManager::search()
K3bExternalProgram* K3bExternalBinManager::program( const TQString& name ) const
{
if( m_programs.tqfind( name ) == m_programs.end() )
if( m_programs.find( name ) == m_programs.end() )
return 0;
else
return m_programs[name];
@ -363,7 +363,7 @@ void K3bExternalBinManager::setSearchPath( const TQStringList& list )
loadDefaultSearchPath();
for( TQStringList::const_iterator it = list.begin(); it != list.end(); ++it ) {
if( !m_searchPath.tqcontains( *it ) )
if( !m_searchPath.contains( *it ) )
m_searchPath.append( *it );
}
}
@ -371,7 +371,7 @@ void K3bExternalBinManager::setSearchPath( const TQStringList& list )
void K3bExternalBinManager::addSearchPath( const TQString& path )
{
if( !m_searchPath.tqcontains( path ) )
if( !m_searchPath.contains( path ) )
m_searchPath.append( path );
}

@ -195,7 +195,7 @@ TQString K3b::parentDir( const TQString& path )
if( path[path.length()-1] == '/' )
tqparent.truncate( tqparent.length()-1 );
int pos = tqparent.tqfindRev( '/' );
int pos = tqparent.findRev( '/' );
if( pos >= 0 )
tqparent.truncate( pos+1 );
else // relative path, do anything...
@ -313,7 +313,7 @@ TQString K3b::cutFilename( const TQString& name, unsigned int len )
TQString ret = name;
// determine extension (we think of an extension to be at most 5 chars in length)
int pos = name.tqfind( '.', -6 );
int pos = name.find( '.', -6 );
if( pos > 0 )
len -= (name.length() - pos);
@ -332,7 +332,7 @@ TQString K3b::cutFilename( const TQString& name, unsigned int len )
TQString K3b::removeFilenameExtension( const TQString& name )
{
TQString v = name;
int dotpos = v.tqfindRev( '.' );
int dotpos = v.findRev( '.' );
if( dotpos > 0 )
v.truncate( dotpos );
return v;
@ -344,7 +344,7 @@ TQString K3b::appendNumberToFilename( const TQString& name, int num, unsigned in
// determine extension (we think of an extension to be at most 5 chars in length)
TQString result = name;
TQString ext;
int pos = name.tqfind( '.', -6 );
int pos = name.find( '.', -6 );
if( pos > 0 ) {
ext = name.mid(pos);
result.truncate( pos );
@ -426,7 +426,7 @@ TQString K3b::resolveLink( const TQString& file )
if( !p.startsWith( "/" ) )
p.prepend( f.dirPath(true) + "/" );
f.setFile( p );
if( steps.tqcontains( f.absFilePath() ) ) {
if( steps.contains( f.absFilePath() ) ) {
kdDebug() << "(K3b) symlink loop detected." << endl;
break;
}

@ -101,7 +101,7 @@ void K3bVersion::setVersion( const TQString& v )
// suffix = s and num = -1 is returned
void K3bVersion::splitVersionString( const TQString& s, int& num, TQString& suffix )
{
int pos = s.tqfind( TQRegExp("\\D") );
int pos = s.find( TQRegExp("\\D") );
if( pos < 0 ) {
num = s.toInt();
suffix = "";

@ -96,7 +96,7 @@ bool K3bBinImageWritingJob::prepareWriter()
TQFile f( m_tocFile );
if( f.open( IO_ReadOnly ) ) {
TQTextStream fStr( &f );
if( fStr.read().tqcontains( "MODE1/2352" ) ) {
if( fStr.read().contains( "MODE1/2352" ) ) {
kdDebug() << "(K3bBinImageWritingJob) cuefile contains MODE1/2352 track. using cdrdao." << endl;
usedWritingApp = K3b::CDRDAO;
}

@ -311,7 +311,7 @@ void K3bCdCopyJob::slotDiskInfoReady( K3bDevice::DeviceHandler* dh )
}
unsigned long avail, size;
TQString pathToTest = m_tempPath.left( m_tempPath.tqfindRev( '/' ) );
TQString pathToTest = m_tempPath.left( m_tempPath.findRev( '/' ) );
if( !K3b::kbFreeOnFs( pathToTest, size, avail ) ) {
emit infoMessage( i18n("Unable to determine free space in temporary directory '%1'.").tqarg(pathToTest), ERROR );
d->error = true;

@ -95,7 +95,7 @@ void K3bCdda2wavReader::start( bool onlyInfo )
d->cdda2wavBin = k3bcore->externalBinManager()->binObject( "cdda2wav" );
if( !d->cdda2wavBin ) {
emit infoMessage( i18n("Could not tqfind %1 executable.").tqarg("cdda2wav"), ERROR );
emit infoMessage( i18n("Could not find %1 executable.").tqarg("cdda2wav"), ERROR );
jobFinished(false);
d->running = false;
return;
@ -181,9 +181,9 @@ void K3bCdda2wavReader::slotProcessLine( const TQString& line )
static TQRegExp rx( "T\\d\\d:" );
if( rx.exactMatch( line.left(4) ) || line.startsWith( "Leadout" ) ) {
int pos = line.tqfind( " " );
int endpos = line.tqfind( TQRegExp( "\\d" ), pos );
endpos = line.tqfind( " ", endpos );
int pos = line.find( " " );
int endpos = line.find( TQRegExp( "\\d" ), pos );
endpos = line.find( " ", endpos );
bool ok;
int offset = line.mid( pos, endpos-pos ).toInt(&ok);
if( ok )
@ -198,12 +198,12 @@ void K3bCdda2wavReader::slotProcessLine( const TQString& line )
emit nextTrack( d->currentTrack, d->trackOffsets.count() );
}
else if( line.tqcontains("successfully recorded") ) {
else if( line.contains("successfully recorded") ) {
d->currentTrack++;
emit nextTrack( d->currentTrack, d->trackOffsets.count() );
}
else if( line.tqcontains("%") ) {
else if( line.contains("%") ) {
// parse progress
bool ok;
int p = line.left(3).toInt(&ok);

@ -85,7 +85,7 @@ void K3bCloneJob::start()
//
const K3bExternalBin* cdrecordBin = k3bcore->externalBinManager()->binObject( "cdrecord" );
if( !cdrecordBin ) {
emit infoMessage( i18n("Could not tqfind %1 executable.").tqarg("cdrecord"), ERROR );
emit infoMessage( i18n("Could not find %1 executable.").tqarg("cdrecord"), ERROR );
jobFinished(false);
m_running = false;
return;

@ -314,7 +314,7 @@ void K3bDvdCopyJob::slotDiskInfoReady( K3bDevice::DeviceHandler* dh )
//
KIO::filesize_t imageSpaceNeeded = (KIO::filesize_t)(d->lastSector.lba()+1)*2048;
unsigned long avail, size;
TQString pathToTest = m_imagePath.left( m_imagePath.tqfindRev( '/' ) );
TQString pathToTest = m_imagePath.left( m_imagePath.findRev( '/' ) );
if( !K3b::kbFreeOnFs( pathToTest, size, avail ) ) {
emit infoMessage( i18n("Unable to determine free space in temporary directory '%1'.").tqarg(pathToTest), ERROR );
jobFinished(false);

@ -218,15 +218,15 @@ void K3bDvdFormattingJob::slotStderrLine( const TQString& line )
emit debuggingOutput( "dvd+rw-format", line );
// parsing for the -gui mode (since dvd+rw-format 4.6)
int pos = line.tqfind( "blanking" );
int pos = line.find( "blanking" );
if( pos < 0 )
pos = line.tqfind( "formatting" );
pos = line.find( "formatting" );
if( pos >= 0 ) {
pos = line.tqfind( TQRegExp( "\\d" ), pos );
pos = line.find( TQRegExp( "\\d" ), pos );
}
// parsing for \b\b... stuff
else if( !line.startsWith("*") ) {
pos = line.tqfind( TQRegExp( "\\d" ) );
pos = line.find( TQRegExp( "\\d" ) );
}
else if( line.startsWith( ":-(" ) ) {
if( line.startsWith( ":-( unable to proceed with format" ) ) {
@ -235,7 +235,7 @@ void K3bDvdFormattingJob::slotStderrLine( const TQString& line )
}
if( pos >= 0 ) {
int endPos = line.tqfind( TQRegExp("[^\\d\\.]"), pos ) - 1;
int endPos = line.find( TQRegExp("[^\\d\\.]"), pos ) - 1;
bool ok;
int progress = (int)(line.mid( pos, endPos - pos ).toDouble(&ok));
if( ok ) {
@ -472,7 +472,7 @@ void K3bDvdFormattingJob::startFormatting( const K3bDevice::DiskInfo& diskInfo )
d->dvdFormatBin = k3bcore->externalBinManager()->binObject( "dvd+rw-format" );
if( !d->dvdFormatBin ) {
emit infoMessage( i18n("Could not tqfind %1 executable.").tqarg("dvd+rw-format"), ERROR );
emit infoMessage( i18n("Could not find %1 executable.").tqarg("dvd+rw-format"), ERROR );
d->running = false;
jobFinished(false);
return;

@ -104,7 +104,7 @@ void K3bReadcdReader::start()
// the first thing to do is to check for readcd
d->readcdBinObject = k3bcore->externalBinManager()->binObject( "readcd" );
if( !d->readcdBinObject ) {
emit infoMessage( i18n("Could not tqfind %1 executable.").tqarg("readcd"), ERROR );
emit infoMessage( i18n("Could not find %1 executable.").tqarg("readcd"), ERROR );
jobFinished(false);
return;
}
@ -243,7 +243,7 @@ void K3bReadcdReader::slotStdLine( const TQString& line )
else if( line.startsWith( "addr:" ) ) {
bool ok;
long currentReadBlock = line.mid( 6, line.tqfind("cnt")-7 ).toInt(&ok);
long currentReadBlock = line.mid( 6, line.find("cnt")-7 ).toInt(&ok);
if( d->firstSector < d->lastSector )
currentReadBlock -= d->firstSector.lba();
if( ok ) {
@ -260,37 +260,37 @@ void K3bReadcdReader::slotStdLine( const TQString& line )
}
else
kdError() << "(K3bReadcdReader) currentReadBlock parsing error in line: "
<< line.mid( 6, line.tqfind("cnt")-7 ) << endl;
<< line.mid( 6, line.find("cnt")-7 ) << endl;
}
else if( line.tqcontains("Cannot read source disk") ) {
else if( line.contains("Cannot read source disk") ) {
emit infoMessage( i18n("Cannot read source disk."), ERROR );
}
else if( (pos = line.tqfind("Retrying from sector")) >= 0 ) {
else if( (pos = line.find("Retrying from sector")) >= 0 ) {
// parse the sector
pos += 21;
bool ok;
int problemSector = line.mid( pos, line.tqfind( TQRegExp("\\D"), pos )-pos ).toInt(&ok);
int problemSector = line.mid( pos, line.find( TQRegExp("\\D"), pos )-pos ).toInt(&ok);
if( !ok ) {
kdError() << "(K3bReadcdReader) problemSector parsing error in line: "
<< line.mid( pos, line.tqfind( TQRegExp("\\D"), pos )-pos ) << endl;
<< line.mid( pos, line.find( TQRegExp("\\D"), pos )-pos ) << endl;
}
emit infoMessage( i18n("Retrying from sector %1.").tqarg(problemSector), INFO );
}
else if( (pos = line.tqfind("Error on sector")) >= 0 ) {
else if( (pos = line.find("Error on sector")) >= 0 ) {
d->unreadableBlocks++;
pos += 16;
bool ok;
int problemSector = line.mid( pos, line.tqfind( TQRegExp("\\D"), pos )-pos ).toInt(&ok);
int problemSector = line.mid( pos, line.find( TQRegExp("\\D"), pos )-pos ).toInt(&ok);
if( !ok ) {
kdError() << "(K3bReadcdReader) problemSector parsing error in line: "
<< line.mid( pos, line.tqfind( TQRegExp("\\D"), pos )-pos ) << endl;
<< line.mid( pos, line.find( TQRegExp("\\D"), pos )-pos ) << endl;
}
if( line.tqcontains( "not corrected") ) {
if( line.contains( "not corrected") ) {
emit infoMessage( i18n("Uncorrected error in sector %1").tqarg(problemSector), ERROR );
}
else {

@ -206,8 +206,8 @@ void K3bVideoDVDTitleDetectClippingJob::slotTranscodeStderr( const TQString& lin
// parse progress
// encoding frame [185], 24.02 fps, 93.0%, ETA: 0:00:00, ( 0| 0| 0)
if( line.startsWith( "encoding frame" ) ) {
int pos1 = line.tqfind( '[', 15 );
int pos2 = line.tqfind( ']', pos1+1 );
int pos1 = line.find( '[', 15 );
int pos2 = line.find( ']', pos1+1 );
if( pos1 > 0 && pos2 > 0 ) {
bool ok;
int encodedFrames = line.mid( pos1+1, pos2-pos1-1 ).toInt( &ok );
@ -235,7 +235,7 @@ void K3bVideoDVDTitleDetectClippingJob::slotTranscodeStderr( const TQString& lin
// [detectclipping#0] valid area: X: 5..719 Y: 72..507 -> -j 72,6,68,0
else if( line.startsWith( "[detectclipping" ) ) {
int pos = line.tqfind( "-j" );
int pos = line.find( "-j" );
if( pos > 0 ) {
TQStringList values = TQStringList::split( ',', line.mid( pos+3 ) );
m_clippingTop = TQMIN( m_clippingTop, values[0].toInt() );

@ -385,8 +385,8 @@ void K3bVideoDVDTitleTranscodingJob::slotTranscodeStderr( const TQString& line )
// parse progress
// encoding frames [000000-000144], 27.58 fps, EMT: 0:00:05, ( 0| 0| 0)
if( line.startsWith( "encoding frame" ) ) {
int pos1 = line.tqfind( '-', 15 );
int pos2 = line.tqfind( ']', pos1+1 );
int pos1 = line.find( '-', 15 );
int pos2 = line.find( ']', pos1+1 );
if( pos1 > 0 && pos2 > 0 ) {
bool ok;
int encodedFrames = line.mid( pos1+1, pos2-pos1-1 ).toInt( &ok );

@ -504,7 +504,7 @@ void K3bAudioDecoder::cleanup()
TQString K3bAudioDecoder::metaInfo( MetaDataField f )
{
if( d->metaInfoMap.tqcontains( f ) )
if( d->metaInfoMap.contains( f ) )
return d->metaInfoMap[f];
// fall back to KFileMetaInfo

@ -63,7 +63,7 @@ TQStringList K3bPluginManager::groups() const
TQPtrList<K3bPlugin> fl;
for( TQPtrListIterator<K3bPlugin> it( d->plugins );
it.current(); ++it ) {
if( !grps.tqcontains( it.current()->group() ) )
if( !grps.contains( it.current()->group() ) )
grps.append( it.current()->group() );
}

@ -382,7 +382,7 @@ K3bAudioDecoder* K3bAudioDoc::getDecoderForUrl( const KURL& url, bool* reused )
K3bAudioDecoder* decoder = 0;
// check if we already have a proper decoder
if( m_decoderPresenceMap.tqcontains( url.path() ) ) {
if( m_decoderPresenceMap.contains( url.path() ) ) {
decoder = m_decoderPresenceMap[url.path()];
*reused = true;
}
@ -997,7 +997,7 @@ void K3bAudioDoc::slotTrackRemoved( K3bAudioTrack* track )
void K3bAudioDoc::increaseDecoderUsage( K3bAudioDecoder* decoder )
{
kdDebug() << "(K3bAudioDoc::increaseDecoderUsage)" << endl;
if( !m_decoderUsageCounterMap.tqcontains( decoder ) ) {
if( !m_decoderUsageCounterMap.contains( decoder ) ) {
m_decoderUsageCounterMap[decoder] = 1;
m_decoderPresenceMap[decoder->filename()] = decoder;
}

@ -121,13 +121,13 @@ void K3bAudioNormalizeJob::slotStdLine( const TQString& line )
}
}
else if( line.tqcontains( "already normalized" ) ) {
else if( line.contains( "already normalized" ) ) {
// no normalization necessary for the current track
emit infoMessage( i18n("Track %1 is already normalized.").tqarg(m_currentTrack), INFO );
m_currentTrack++;
}
else if( line.tqcontains( "--% done") ) {
else if( line.contains( "--% done") ) {
if( m_currentAction == ADJUSTING_LEVELS ) {
emit newTask( i18n("Adjusting volume level for track %1 of %2").tqarg(m_currentTrack).tqarg(m_files.count()) );
kdDebug() << "(K3bAudioNormalizeJob) adjusting level for track "
@ -148,7 +148,7 @@ void K3bAudioNormalizeJob::slotStdLine( const TQString& line )
m_currentTrack++;
}
else if( int pos = line.tqfind( "% done" ) > 0 ) {
else if( int pos = line.find( "% done" ) > 0 ) {
// parse progress: "XXX% done" and "batch XXX% done"
pos -= 3;
bool ok;

@ -165,7 +165,7 @@ void K3bDataDoc::addUrls( const KURL::List& l, K3bDirItem* dir )
TQString name( k3bname );
if( cnt > 0 )
name += TQString("_%1").tqarg(cnt);
if( K3bDataItem* oldItem = dir->tqfind( name ) ) {
if( K3bDataItem* oldItem = dir->find( name ) ) {
if( f.isDir() && oldItem->isDir() ) {
// ok, just reuse the dir
newDirItem = static_cast<K3bDirItem*>(oldItem);
@ -215,7 +215,7 @@ bool K3bDataDoc::nameAlreadyInDir( const TQString& name, K3bDirItem* dir )
if( !dir )
return false;
else
return ( dir->tqfind( name ) != 0 );
return ( dir->find( name ) != 0 );
}
@ -275,7 +275,7 @@ bool K3bDataDoc::loadDocumentData( TQDomElement* rootElem )
TQDomNodeList nodes = rootElem->childNodes();
if( nodes.item(0).nodeName() != "general" ) {
kdDebug() << "(K3bDataDoc) could not tqfind 'general' section." << endl;
kdDebug() << "(K3bDataDoc) could not find 'general' section." << endl;
return false;
}
if( !readGeneralDocumentData( nodes.item(0).toElement() ) )
@ -285,7 +285,7 @@ bool K3bDataDoc::loadDocumentData( TQDomElement* rootElem )
// parse options
// -----------------------------------------------------------------
if( nodes.item(1).nodeName() != "options" ) {
kdDebug() << "(K3bDataDoc) could not tqfind 'options' section." << endl;
kdDebug() << "(K3bDataDoc) could not find 'options' section." << endl;
return false;
}
if( !loadDocumentDataOptions( nodes.item(1).toElement() ) )
@ -297,7 +297,7 @@ bool K3bDataDoc::loadDocumentData( TQDomElement* rootElem )
// parse header
// -----------------------------------------------------------------
if( nodes.item(2).nodeName() != "header" ) {
kdDebug() << "(K3bDataDoc) could not tqfind 'header' section." << endl;
kdDebug() << "(K3bDataDoc) could not find 'header' section." << endl;
return false;
}
if( !loadDocumentDataHeader( nodes.item(2).toElement() ) )
@ -309,7 +309,7 @@ bool K3bDataDoc::loadDocumentData( TQDomElement* rootElem )
// parse files
// -----------------------------------------------------------------
if( nodes.item(3).nodeName() != "files" ) {
kdDebug() << "(K3bDataDoc) could not tqfind 'files' section." << endl;
kdDebug() << "(K3bDataDoc) could not find 'files' section." << endl;
return false;
}
@ -428,7 +428,7 @@ bool K3bDataDoc::loadDocumentDataOptions( TQDomElement elem )
else if( e.text() == "extended" )
m_isoOptions.setWhiteSpaceTreatment( K3bIsoOptions::extended );
else if( e.text() == "extended" )
m_isoOptions.setWhiteSpaceTreatment( K3bIsoOptions::tqreplace );
m_isoOptions.setWhiteSpaceTreatment( K3bIsoOptions::replace );
else
m_isoOptions.setWhiteSpaceTreatment( K3bIsoOptions::noChange );
}
@ -565,7 +565,7 @@ bool K3bDataDoc::loadDataItem( TQDomElement& elem, K3bDirItem* tqparent )
else if( elem.nodeName() == "directory" ) {
// This is for the VideoDVD project which already contains the *_TS folders
K3bDirItem* newDirItem = 0;
if( K3bDataItem* item = tqparent->tqfind( elem.attributeNode( "name" ).value() ) ) {
if( K3bDataItem* item = tqparent->find( elem.attributeNode( "name" ).value() ) ) {
if( item->isDir() ) {
newDirItem = static_cast<K3bDirItem*>(item);
}