diff options
Diffstat (limited to 'src/config.cpp')
-rwxr-xr-x | src/config.cpp | 444 |
1 files changed, 222 insertions, 222 deletions
diff --git a/src/config.cpp b/src/config.cpp index b8b1904..0c6995c 100755 --- a/src/config.cpp +++ b/src/config.cpp @@ -6,8 +6,8 @@ #include "ripperpluginloader.h" #include "options.h" -#include <qdir.h> -#include <qfile.h> +#include <tqdir.h> +#include <tqfile.h> #include <klocale.h> #include <kglobal.h> @@ -59,13 +59,13 @@ void Config::read() readProfiles(); KConfig *conf = kapp->config(); - QStringList listDefaults; + TQStringList listDefaults; int intDefault; bool boolDefault; - QString ripper; - QString encoder; - QString decoder; - QString replaygain; + TQString ripper; + TQString encoder; + TQString decoder; + TQString replaygain; int rank; conf->setGroup( "General" ) ; @@ -79,10 +79,10 @@ void Config::read() conf->setGroup( "Backends" ); listDefaults.clear(); - QString datadir = locateLocal( "data", "soundkonverter/bin/" ); + TQString datadir = locateLocal( "data", "soundkonverter/bin/" ); datadir.remove( datadir.length() - 1, 1 ); listDefaults.append( datadir ); - listDefaults.append( QDir::homeDirPath() + "/bin" ); + listDefaults.append( TQDir::homeDirPath() + "/bin" ); listDefaults.append( "/usr/local/bin" ); listDefaults.append( "/usr/bin" ); data.environment.directories = conf->readListEntry( "directories", listDefaults ); @@ -102,10 +102,10 @@ void Config::read() data.general.lastTab = conf->readNumEntry( "lastTab", 0 ); data.general.defaultProfile = conf->readEntry( "defaultProfile", i18n("Last used") ); data.general.defaultFormat = conf->readEntry( "defaultFormat", i18n("Last used") ); -// data.general.defaultOutputDirectory = conf->readEntry( "defaultOutputDirectory", QDir::homeDirPath() + "/soundKonverter/%b/%d - %n - %a - %t" ); - data.general.specifyOutputDirectory = conf->readEntry( "specifyOutputDirectory", QDir::homeDirPath() + "/soundKonverter" ); - data.general.metaDataOutputDirectory = conf->readEntry( "metaDataOutputDirectory", QDir::homeDirPath() + "/soundKonverter/%b/%d - %n - %a - %t" ); - data.general.copyStructureOutputDirectory = conf->readEntry( "copyStructureOutputDirectory", QDir::homeDirPath() + "/soundKonverter" ); +// data.general.defaultOutputDirectory = conf->readEntry( "defaultOutputDirectory", TQDir::homeDirPath() + "/soundKonverter/%b/%d - %n - %a - %t" ); + data.general.specifyOutputDirectory = conf->readEntry( "specifyOutputDirectory", TQDir::homeDirPath() + "/soundKonverter" ); + data.general.metaDataOutputDirectory = conf->readEntry( "metaDataOutputDirectory", TQDir::homeDirPath() + "/soundKonverter/%b/%d - %n - %a - %t" ); + data.general.copyStructureOutputDirectory = conf->readEntry( "copyStructureOutputDirectory", TQDir::homeDirPath() + "/soundKonverter" ); data.general.useVFATNames = conf->readBoolEntry( "useVFATNames", true ); data.general.conflictHandling = conf->readNumEntry( "conflictHandling", 0 ); data.general.priority = conf->readNumEntry( "priority", 10 ); @@ -120,10 +120,10 @@ void Config::read() conf->setGroup( "Environment" ); listDefaults.clear(); - QString datadir = locateLocal( "data", "soundkonverter/bin/" ); + TQString datadir = locateLocal( "data", "soundkonverter/bin/" ); datadir.remove( datadir.length() - 1, 1 ); listDefaults.append( datadir ); - listDefaults.append( QDir::homeDirPath() + "/bin" ); + listDefaults.append( TQDir::homeDirPath() + "/bin" ); listDefaults.append( "/usr/local/bin" ); listDefaults.append( "/usr/bin" ); data.environment.directories = conf->readListEntry( "directories", listDefaults ); @@ -136,7 +136,7 @@ void Config::read() if( ripper == "kio_audiocd" ) rank = 10000; else rank = 60; // kio_audiocd ranking currentRipper = 0; // this is a valid ripper (kio_audiocd) - for( QValueList<RipperPlugin*>::Iterator b = rippers.begin(); b != rippers.end(); ++b ) { + for( TQValueList<RipperPlugin*>::Iterator b = rippers.begin(); b != rippers.end(); ++b ) { binaries[ (*b)->rip.bin ] = ""; if( (*b)->rip.rank > rank ) { rank = (*b)->rip.rank; @@ -148,30 +148,30 @@ void Config::read() } } - for( QValueList<FormatItem>::Iterator it = formats.begin(); it != formats.end(); ++it ) + for( TQValueList<FormatItem>::Iterator it = formats.begin(); it != formats.end(); ++it ) { - for( QValueList<ConvertPlugin*>::Iterator b = (*it).encoders.begin(); b != (*it).encoders.end(); ++b ) { + for( TQValueList<ConvertPlugin*>::Iterator b = (*it).encoders.begin(); b != (*it).encoders.end(); ++b ) { binaries[ (*b)->enc.bin ] = ""; } - for( QValueList<ConvertPlugin*>::Iterator b = (*it).decoders.begin(); b != (*it).decoders.end(); ++b ) { + for( TQValueList<ConvertPlugin*>::Iterator b = (*it).decoders.begin(); b != (*it).decoders.end(); ++b ) { binaries[ (*b)->dec.bin ] = ""; } - for( QValueList<ReplayGainPlugin*>::Iterator b = (*it).replaygains.begin(); b != (*it).replaygains.end(); ++b ) { + for( TQValueList<ReplayGainPlugin*>::Iterator b = (*it).replaygains.begin(); b != (*it).replaygains.end(); ++b ) { binaries[ (*b)->replaygain.bin ] = ""; } - for( QMap<QString, QString>::Iterator b = binaries.begin(); b != binaries.end(); ++b ) { - for( QStringList::Iterator c = data.environment.directories.begin(); c != data.environment.directories.end(); ++c ) + for( TQMap<TQString, TQString>::Iterator b = binaries.begin(); b != binaries.end(); ++b ) { + for( TQStringList::Iterator c = data.environment.directories.begin(); c != data.environment.directories.end(); ++c ) { - if( b.data() == "" && QFile::exists((*c) + "/" + b.key()) ) { + if( b.data() == "" && TQFile::exists((*c) + "/" + b.key()) ) { b.data() = (*c) + "/" + b.key(); } } } - QStringList foundPrograms; - for( QMap<QString, QString>::Iterator b = binaries.begin(); b != binaries.end(); ++b ) { + TQStringList foundPrograms; + for( TQMap<TQString, TQString>::Iterator b = binaries.begin(); b != binaries.end(); ++b ) { if( b.data() != "" ) { foundPrograms.append( b.data() ); } @@ -184,7 +184,7 @@ void Config::read() } } - for( QValueList<FormatItem>::Iterator it = formats.begin(); it != formats.end(); ++it ) + for( TQValueList<FormatItem>::Iterator it = formats.begin(); it != formats.end(); ++it ) { conf->setGroup( (*it).mime_types.first() ); encoder = conf->readEntry( "encoder" ); @@ -196,7 +196,7 @@ void Config::read() (*it).replaygain = 0; rank = 0; - for( QValueList<ConvertPlugin*>::Iterator b = (*it).encoders.begin(); b != (*it).encoders.end(); ++b ) { + for( TQValueList<ConvertPlugin*>::Iterator b = (*it).encoders.begin(); b != (*it).encoders.end(); ++b ) { if( (*b)->enc.rank > rank && binaries[(*b)->enc.bin] != "" ) { rank = (*b)->enc.rank; (*it).encoder = (*b); @@ -208,7 +208,7 @@ void Config::read() } rank = 0; - for( QValueList<ConvertPlugin*>::Iterator b = (*it).decoders.begin(); b != (*it).decoders.end(); ++b ) { + for( TQValueList<ConvertPlugin*>::Iterator b = (*it).decoders.begin(); b != (*it).decoders.end(); ++b ) { if( (*b)->dec.rank > rank && binaries[(*b)->dec.bin] != "" ) { rank = (*b)->dec.rank; (*it).decoder = (*b); @@ -220,7 +220,7 @@ void Config::read() } rank = 0; - for( QValueList<ReplayGainPlugin*>::Iterator b = (*it).replaygains.begin(); b != (*it).replaygains.end(); ++b ) { + for( TQValueList<ReplayGainPlugin*>::Iterator b = (*it).replaygains.begin(); b != (*it).replaygains.end(); ++b ) { if( (*b)->replaygain.rank > rank && binaries[(*b)->replaygain.bin] != "" ) { rank = (*b)->replaygain.rank; (*it).replaygain = (*b); @@ -259,7 +259,7 @@ void Config::read() void Config::write( bool sync ) { - QTime time; + TQTime time; time.start(); writeProfiles(); @@ -271,7 +271,7 @@ void Config::write( bool sync ) conf->setGroup( "Ripper" ); conf->writeEntry( "ripper", (currentRipper)?currentRipper->rip.bin:"kio_audiocd" ); - for( QValueList<FormatItem>::Iterator it = formats.begin(); it != formats.end(); ++it ) + for( TQValueList<FormatItem>::Iterator it = formats.begin(); it != formats.end(); ++it ) { conf->setGroup( (*it).mime_types.first() ); if( (*it).encoder ) conf->writeEntry( "encoder", (*it).encoder->enc.bin ); @@ -306,7 +306,7 @@ void Config::write( bool sync ) conf->setGroup( "Environment" ); conf->writeEntry( "directories", data.environment.directories ); data.environment.foundPrograms.clear(); - for( QMap<QString, QString>::Iterator b = binaries.begin(); b != binaries.end(); ++b ) { + for( TQMap<TQString, TQString>::Iterator b = binaries.begin(); b != binaries.end(); ++b ) { if( b.data() != "" ) { data.environment.foundPrograms.append( b.data() ); } @@ -317,24 +317,24 @@ void Config::write( bool sync ) emit configChanged(); - logger->log( 1000, "wrote preferences: " + QString::number(time.elapsed()) ); + logger->log( 1000, "wrote preferences: " + TQString::number(time.elapsed()) ); } void Config::readProfiles() { int version; - QString name; + TQString name; ConversionOptions options; - QDomDocument domTree; - QFile opmlFile( locateLocal("data","soundkonverter/profiles.xml") ); + TQDomDocument domTree; + TQFile opmlFile( locateLocal("data","soundkonverter/profiles.xml") ); if( !opmlFile.open( IO_ReadOnly ) ) return; if( !domTree.setContent( &opmlFile ) ) return; opmlFile.close(); - QDomElement root = domTree.documentElement(); + TQDomElement root = domTree.documentElement(); if( root.attribute("type") != "profiles" ) return; - QDomNode node, sub1Node, sub2Node; + TQDomNode node, sub1Node, sub2Node; node = root.firstChild(); while( !node.isNull() ) { @@ -403,20 +403,20 @@ void Config::readProfiles() void Config::writeProfiles() { - QDomDocument domTree; - QDomElement root = domTree.createElement( "soundkonverter" ); + TQDomDocument domTree; + TQDomElement root = domTree.createElement( "soundkonverter" ); root.setAttribute( "type", "profiles" ); domTree.appendChild( root ); - QDomElement info = domTree.createElement( "info" ); + TQDomElement info = domTree.createElement( "info" ); info.setAttribute( "version", "300" ); root.appendChild( info ); - for( QValueList<ProfileData>::Iterator it = profiles.begin(); it != profiles.end(); ++it ) { - QDomElement profile = domTree.createElement( "profile" ); + for( TQValueList<ProfileData>::Iterator it = profiles.begin(); it != profiles.end(); ++it ) { + TQDomElement profile = domTree.createElement( "profile" ); profile.setAttribute( "name", (*it).name ); - QDomElement encodingOptions = domTree.createElement( "encodingOptions" ); + TQDomElement encodingOptions = domTree.createElement( "encodingOptions" ); encodingOptions.setAttribute( "sFormat", (*it).options.encodingOptions.sFormat ); encodingOptions.setAttribute( "sQualityMode", (*it).options.encodingOptions.sQualityMode ); @@ -426,21 +426,21 @@ void Config::writeProfiles() encodingOptions.setAttribute( "iMinBitrate", (*it).options.encodingOptions.iMinBitrate ); encodingOptions.setAttribute( "iMaxBitrate", (*it).options.encodingOptions.iMaxBitrate ); - QDomElement samplingRate = domTree.createElement( "samplingRate" ); + TQDomElement samplingRate = domTree.createElement( "samplingRate" ); samplingRate.setAttribute( "bEnabled", (*it).options.encodingOptions.samplingRate.bEnabled ); samplingRate.setAttribute( "iSamplingRate", (*it).options.encodingOptions.samplingRate.iSamplingRate ); encodingOptions.appendChild( samplingRate ); - QDomElement channels = domTree.createElement( "channels" ); + TQDomElement channels = domTree.createElement( "channels" ); channels.setAttribute( "bEnabled", (*it).options.encodingOptions.channels.bEnabled ); channels.setAttribute( "sChannels", (*it).options.encodingOptions.channels.sChannels ); encodingOptions.appendChild( channels ); - QDomElement replaygain = domTree.createElement( "replaygain" ); + TQDomElement replaygain = domTree.createElement( "replaygain" ); replaygain.setAttribute( "bEnabled", (*it).options.encodingOptions.replaygain.bEnabled ); @@ -450,7 +450,7 @@ void Config::writeProfiles() profile.appendChild( encodingOptions ); - QDomElement outputOptions = domTree.createElement( "outputOptions" ); + TQDomElement outputOptions = domTree.createElement( "outputOptions" ); outputOptions.setAttribute( "mode", int((*it).options.outputOptions.mode) ); outputOptions.setAttribute( "directory", (*it).options.outputOptions.directory ); @@ -460,10 +460,10 @@ void Config::writeProfiles() root.appendChild( profile ); } - QFile opmlFile( locateLocal("data","soundkonverter/profiles.xml") ); + TQFile opmlFile( locateLocal("data","soundkonverter/profiles.xml") ); if( !opmlFile.open( IO_WriteOnly ) ) return; - QTextStream ts( &opmlFile ); + TQTextStream ts( &opmlFile ); ts << domTree.toString(); opmlFile.close(); @@ -472,24 +472,24 @@ void Config::writeProfiles() void Config::writeServiceMenu() { int num; - QString content; - QFile file; + TQString content; + TQFile file; num = 0; content = ""; content += "[Desktop Entry]\n"; content += "ServiceTypes="; - for( QValueList<FormatItem>::Iterator it = formats.begin(); it != formats.end(); ++it ) { + for( TQValueList<FormatItem>::Iterator it = formats.begin(); it != formats.end(); ++it ) { // if( (*it).encoder != 0 && binaries[(*it).encoder->enc.bin] != "" && (*it).mime_types.first() != "application/octet-stream" ) { // if( !(*it).encoder->enc.lossy.enabled && !(*it).encoder->enc.lossless.enabled && !(*it).encoder->enc.hybrid.enabled ) continue; -// for( QStringList::Iterator b = (*it).mime_types.begin(); b != (*it).mime_types.end(); ++b ) { +// for( TQStringList::Iterator b = (*it).mime_types.begin(); b != (*it).mime_types.end(); ++b ) { // content += (*b) + ","; // num++; // } // } if( (*it).decoder != 0 && binaries[(*it).decoder->dec.bin] != "" && (*it).mime_types.first() != "application/octet-stream" ) { - for( QStringList::Iterator b = (*it).mime_types.begin(); b != (*it).mime_types.end(); ++b ) { + for( TQStringList::Iterator b = (*it).mime_types.begin(); b != (*it).mime_types.end(); ++b ) { content += (*b) + ","; num++; } @@ -511,7 +511,7 @@ void Config::writeServiceMenu() file.setName( locateLocal("data","konqueror/servicemenus/")+"convert_with_soundkonverter.desktop" ); if ( file.open( IO_WriteOnly ) ) { - QTextStream stream( &file ); + TQTextStream stream( &file ); stream << content; file.close(); } @@ -522,9 +522,9 @@ void Config::writeServiceMenu() content += "[Desktop Entry]\n"; content += "ServiceTypes="; - for( QValueList<FormatItem>::Iterator it = formats.begin(); it != formats.end(); ++it ) { + for( TQValueList<FormatItem>::Iterator it = formats.begin(); it != formats.end(); ++it ) { if( (*it).replaygain != 0 && binaries[(*it).replaygain->replaygain.bin] != "" && (*it).mime_types.first() != "application/octet-stream" ) { - for( QStringList::Iterator b = (*it).mime_types.begin(); b != (*it).mime_types.end(); ++b ) { + for( TQStringList::Iterator b = (*it).mime_types.begin(); b != (*it).mime_types.end(); ++b ) { content += (*b) + ","; num++; } @@ -546,7 +546,7 @@ void Config::writeServiceMenu() file.setName( locateLocal("data","konqueror/servicemenus/")+"add_replaygain_with_soundkonverter.desktop" ); if( file.open(IO_WriteOnly) ) { - QTextStream st( &file ); + TQTextStream st( &file ); st << content; file.close(); } @@ -556,8 +556,8 @@ void Config::writeServiceMenu() void Config::writeAmarokScript() { int num, num1, num2; - QString content, content1, content2; - QFile file; + TQString content, content1, content2; + TQFile file; num = 0; content = ""; @@ -566,11 +566,11 @@ void Config::writeAmarokScript() content += "[Transcode]\n"; content += "target_formats = "; - for( QValueList<FormatItem>::Iterator it = formats.begin(); it != formats.end(); ++it ) { + for( TQValueList<FormatItem>::Iterator it = formats.begin(); it != formats.end(); ++it ) { if( (*it).encoder != 0 && binaries[(*it).encoder->enc.bin] != "" && (*it).mime_types.first() != "application/octet-stream" ) { if( !(*it).encoder->enc.lossy.enabled && !(*it).encoder->enc.lossless.enabled && !(*it).encoder->enc.hybrid.enabled ) continue; - for( QStringList::Iterator b = (*it).extensions.begin(); b != (*it).extensions.end(); ++b ) { - if( content.find(" "+(*b).lower()+" ") == -1 ) content += (*b).lower() + " "; + for( TQStringList::Iterator b = (*it).extensions.begin(); b != (*it).extensions.end(); ++b ) { + if( content.tqfind(" "+(*b).lower()+" ") == -1 ) content += (*b).lower() + " "; num++; } } @@ -583,7 +583,7 @@ void Config::writeAmarokScript() file.setName( locateLocal("data","amarok/scripts/soundKonverter/")+"soundKonverter.spec" ); if( file.open(IO_WriteOnly) ) { - QTextStream st( &file ); + TQTextStream st( &file ); st << content; file.close(); } @@ -593,17 +593,17 @@ void Config::writeAmarokScript() content = content1 = content2 = ""; // NOTE duplicate entries won't be shown to the user at any time, so they aren't filtered - for( QValueList<FormatItem>::Iterator it = formats.begin(); it != formats.end(); ++it ) { + for( TQValueList<FormatItem>::Iterator it = formats.begin(); it != formats.end(); ++it ) { if( (*it).encoder != 0 && binaries[(*it).encoder->enc.bin] != "" && (*it).mime_types.first() != "application/octet-stream" ) { if( (*it).encoder->enc.lossless.enabled ) { - for( QStringList::Iterator b = (*it).extensions.begin(); b != (*it).extensions.end(); ++b ) { - if( content1.find(","+(*b).lower()+",") == -1 ) content1 += (*b).lower() + ","; // NOTE the first entry will be shown twice + for( TQStringList::Iterator b = (*it).extensions.begin(); b != (*it).extensions.end(); ++b ) { + if( content1.tqfind(","+(*b).lower()+",") == -1 ) content1 += (*b).lower() + ","; // NOTE the first entry will be shown twice num1++; } } if( (*it).encoder->enc.hybrid.enabled ) { - for( QStringList::Iterator b = (*it).extensions.begin(); b != (*it).extensions.end(); ++b ) { - if( content2.find(","+(*b).lower()+",") == -1 ) content2 += (*b).lower() + ","; // NOTE the first entry will be shown twice + for( TQStringList::Iterator b = (*it).extensions.begin(); b != (*it).extensions.end(); ++b ) { + if( content2.tqfind(","+(*b).lower()+",") == -1 ) content2 += (*b).lower() + ","; // NOTE the first entry will be shown twice num2++; } } @@ -632,17 +632,17 @@ void Config::writeAmarokScript() { file.setName( locateLocal("data","amarok/scripts/soundKonverter/")+"formats" ); if( file.open(IO_WriteOnly) ) { - QTextStream st( &file ); + TQTextStream st( &file ); st << content; file.close(); } } KStandardDirs* stdDirs = new KStandardDirs(); - if( !QFile::exists(locateLocal("data","amarok/scripts/soundKonverter/soundKonverter.rb")) ) { + if( !TQFile::exists(locateLocal("data","amarok/scripts/soundKonverter/soundKonverter.rb")) ) { KIO::NetAccess::file_copy( stdDirs->findResource("data","soundkonverter/amarokscript/soundKonverter.rb"), locateLocal("data","amarok/scripts/soundKonverter/soundKonverter.rb"), 0755, true ); } - if( !QFile::exists(locateLocal("data","amarok/scripts/soundKonverter/README")) ) { + if( !TQFile::exists(locateLocal("data","amarok/scripts/soundKonverter/README")) ) { KIO::NetAccess::file_copy( stdDirs->findResource("data","soundkonverter/amarokscript/README"), locateLocal("data","amarok/scripts/soundKonverter/README"), -1, true ); } delete stdDirs; @@ -657,15 +657,15 @@ void Config::loadPlugins() //kdDebug() << "entering: `" << "Config::loadPlugins()" << "'" << endl; logger->log( 1000, "entering: `Config::loadPlugins()'" ); - QStringList list; - QDir dir; - QString correction_file_mime_type; + TQStringList list; + TQDir dir; + TQString correction_file_mime_type; /** a map that holds the _identifier_ and the _version_ number of all plugins */ - QMap<QString, PluginMapData> pluginMap; + TQMap<TQString, PluginMapData> pluginMap; int version; - QString identifier; + TQString identifier; int i; ConvertPluginLoader* convertPluginLoader = new ConvertPluginLoader(); @@ -673,29 +673,29 @@ void Config::loadPlugins() RipperPluginLoader* ripperPluginLoader = new RipperPluginLoader(); KStandardDirs stddir; - QStringList directories = stddir.findDirs( "data", "soundkonverter/plugins/" ); - for( QStringList::Iterator a = directories.begin(); a != directories.end(); ++a ) + TQStringList directories = stddir.findDirs( "data", "soundkonverter/plugins/" ); + for( TQStringList::Iterator a = directories.begin(); a != directories.end(); ++a ) { //kdDebug() << " searching directory: `" << *a << "'" << endl; logger->log( 1000, " searching directory: `" + *a + "'" ); dir.setPath( *a ); - list = dir.entryList( "*", QDir::All, QDir::Name ); - for( QStringList::Iterator b = list.begin(); b != list.end(); ++b ) + list = dir.entryList( "*", TQDir::All, TQDir::Name ); + for( TQStringList::Iterator b = list.begin(); b != list.end(); ++b ) { if( *b != "." && *b != ".." && (*b).right(19) == ".soundkonverter.xml" ) { //kdDebug() << " found file: `" << *b << "'" << endl; logger->log( 1000, " found file: `" + *b + "'" ); - if( convertPluginLoader->verifyFile( QString(*a).append(*b) ) != -1 ) + if( convertPluginLoader->verifyFile( TQString(*a).append(*b) ) != -1 ) { - version = convertPluginLoader->verifyFile( QString(*a).append(*b) ); + version = convertPluginLoader->verifyFile( TQString(*a).append(*b) ); identifier = *b; identifier.remove( identifier.length() - 19, 19 ); - i = identifier.findRev( "-" ); + i = identifier.tqfindRev( "-" ); identifier.remove( i, identifier.length() - i ); -// i = identifier.find( "." ); +// i = identifier.tqfind( "." ); // identifier.remove( 0, i + 1 ); - if( !pluginMap.contains(identifier) ) { + if( !pluginMap.tqcontains(identifier) ) { PluginMapData data; data.version = 0; pluginMap.insert( identifier, data ); @@ -703,21 +703,21 @@ void Config::loadPlugins() if( pluginMap[identifier].version < version ) { pluginMap[identifier].version = version; - pluginMap[identifier].filename = QString(*a).append(*b); + pluginMap[identifier].filename = TQString(*a).append(*b); pluginMap[identifier].type = "converter"; logger->log( 1000, " updating version for: `" + identifier + "'" ); } } - else if( replaygainPluginLoader->verifyFile( QString(*a).append(*b) ) != -1 ) + else if( replaygainPluginLoader->verifyFile( TQString(*a).append(*b) ) != -1 ) { - version = replaygainPluginLoader->verifyFile( QString(*a).append(*b) ); + version = replaygainPluginLoader->verifyFile( TQString(*a).append(*b) ); identifier = *b; identifier.remove( identifier.length() - 19, 19 ); - i = identifier.findRev( "-" ); + i = identifier.tqfindRev( "-" ); identifier.remove( i, identifier.length() - i ); -// i = identifier.find( "." ); +// i = identifier.tqfind( "." ); // identifier.remove( 0, i + 1 ); - if( !pluginMap.contains(identifier) ) { + if( !pluginMap.tqcontains(identifier) ) { PluginMapData data; data.version = 0; pluginMap.insert( identifier, data ); @@ -725,21 +725,21 @@ void Config::loadPlugins() if( pluginMap[identifier].version < version ) { pluginMap[identifier].version = version; - pluginMap[identifier].filename = QString(*a).append(*b); + pluginMap[identifier].filename = TQString(*a).append(*b); pluginMap[identifier].type = "replaygain"; logger->log( 1000, " updating version for: `" + identifier + "'" ); } } - else if( ripperPluginLoader->verifyFile( QString(*a).append(*b) ) != -1 ) + else if( ripperPluginLoader->verifyFile( TQString(*a).append(*b) ) != -1 ) { - version = ripperPluginLoader->verifyFile( QString(*a).append(*b) ); + version = ripperPluginLoader->verifyFile( TQString(*a).append(*b) ); identifier = *b; identifier.remove( identifier.length() - 19, 19 ); - i = identifier.findRev( "-" ); + i = identifier.tqfindRev( "-" ); identifier.remove( i, identifier.length() - i ); -// i = identifier.find( "." ); +// i = identifier.tqfind( "." ); // identifier.remove( 0, i + 1 ); - if( !pluginMap.contains(identifier) ) { + if( !pluginMap.tqcontains(identifier) ) { PluginMapData data; data.version = 0; pluginMap.insert( identifier, data ); @@ -747,7 +747,7 @@ void Config::loadPlugins() if( pluginMap[identifier].version < version ) { pluginMap[identifier].version = version; - pluginMap[identifier].filename = QString(*a).append(*b); + pluginMap[identifier].filename = TQString(*a).append(*b); pluginMap[identifier].type = "ripper"; logger->log( 1000, " updating version for: `" + identifier + "'" ); } @@ -761,7 +761,7 @@ void Config::loadPlugins() } } - for( QMap<QString, PluginMapData>::Iterator a = pluginMap.begin(); a != pluginMap.end(); ++a ) { + for( TQMap<TQString, PluginMapData>::Iterator a = pluginMap.begin(); a != pluginMap.end(); ++a ) { if( a.data().type == "converter" ) { ConvertPlugin* plugin = convertPluginLoader->loadFile( a.data().filename ); @@ -773,7 +773,7 @@ void Config::loadPlugins() } if( plugin->enc.enabled ) { - for( QStringList::Iterator b = plugin->enc.mime_types.begin(); b != plugin->enc.mime_types.end(); ++b ) + for( TQStringList::Iterator b = plugin->enc.mime_types.begin(); b != plugin->enc.mime_types.end(); ++b ) { //kdDebug() << " registering encoder for: `" << *b << "'" << endl; logger->log( 1000, " registering encoder for: `" + *b + "'" ); @@ -782,7 +782,7 @@ void Config::loadPlugins() } if( plugin->dec.enabled ) { - for( QStringList::Iterator b = plugin->dec.mime_types.begin(); b != plugin->dec.mime_types.end(); ++b ) + for( TQStringList::Iterator b = plugin->dec.mime_types.begin(); b != plugin->dec.mime_types.end(); ++b ) { //kdDebug() << " registering decoder for: `" << *b << "'" << endl; logger->log( 1000, " registering decoder for: `" + *b + "'" ); @@ -804,7 +804,7 @@ void Config::loadPlugins() ReplayGainPlugin* plugin = replaygainPluginLoader->loadFile( a.data().filename ); if( plugin->info.version != -1 ) { - for( QStringList::Iterator b = plugin->replaygain.mime_types.begin(); b != plugin->replaygain.mime_types.end(); ++b ) + for( TQStringList::Iterator b = plugin->replaygain.mime_types.begin(); b != plugin->replaygain.mime_types.end(); ++b ) { //kdDebug() << " registering replaygain for: `" << *b << "'" << endl; logger->log( 1000, " registering replaygain for: `" + *b + "'" ); @@ -852,36 +852,36 @@ void Config::loadPlugins() // directories = stddir.findDirs( "data", "soundkonverter/format_infos/"+language+"/" ); // if( directories.isEmpty() ) directories = stddir.findDirs( "data", "soundkonverter/format_infos/en/" ); directories = stddir.findDirs( "data", "soundkonverter/format_infos/" ); - for( QStringList::Iterator a = directories.begin(); a != directories.end(); ++a ) + for( TQStringList::Iterator a = directories.begin(); a != directories.end(); ++a ) { //kdDebug() << " searching directory: `" << *a << "'" << endl; logger->log( 1000, " searching directory: `" + *a + "'" ); dir.setPath( *a ); - list = dir.entryList( "*", QDir::All, QDir::Name ); - for( QStringList::Iterator b = list.begin(); b != list.end(); ++b ) + list = dir.entryList( "*", TQDir::All, TQDir::Name ); + for( TQStringList::Iterator b = list.begin(); b != list.end(); ++b ) { if( *b != "." && *b != ".." && (*b).right(4) == ".xml" ) { //kdDebug() << " found file: `" << *b << "'" << endl; logger->log( 1000, " found file: `" + *b + "'" ); - if( formatInfoLoader->verifyFile( QString(*a).append(*b) ) ) + if( formatInfoLoader->verifyFile( TQString(*a).append(*b) ) ) { - FormatInfo* formatInfo = formatInfoLoader->loadFile( QString(*a).append(*b) ); + FormatInfo* formatInfo = formatInfoLoader->loadFile( TQString(*a).append(*b) ); - for( QValueList<FormatItem>::Iterator c = formats.begin(); c != formats.end(); ++c ) { - for( QStringList::Iterator d = formatInfo->mime_types.begin(); d != formatInfo->mime_types.end(); ++d ) { - if( (*c).mime_types.findIndex(*d) != -1 ) { + for( TQValueList<FormatItem>::Iterator c = formats.begin(); c != formats.end(); ++c ) { + for( TQStringList::Iterator d = formatInfo->mime_types.begin(); d != formatInfo->mime_types.end(); ++d ) { + if( (*c).mime_types.tqfindIndex(*d) != -1 ) { (*c).description = "<p>" + formatInfo->description + "</p>"; - (*c).description.replace("\\n","</p>\n<p>"); - for( QStringList::Iterator d = formatInfo->urls.begin(); d != formatInfo->urls.end(); ++d ) { + (*c).description.tqreplace("\\n","</p>\n<p>"); + for( TQStringList::Iterator d = formatInfo->urls.begin(); d != formatInfo->urls.end(); ++d ) { (*c).description += "\n<p><a href=\"" + (*d) + "\">" + (*d) + "</a></p>"; } (*c).compressionType = formatInfo->compressionType; (*c).size = formatInfo->size; // add extensions for mime types logger->log( 1000, " found mime type: `" + *d + "'" ); - QStringList extensions = KMimeType::mimeType( *d )->patterns(); - for( QStringList::Iterator c = extensions.begin(); c != extensions.end(); ++c ) { + TQStringList extensions = KMimeType::mimeType( *d )->patterns(); + for( TQStringList::Iterator c = extensions.begin(); c != extensions.end(); ++c ) { (*c).remove( 0, 2 ); logger->log( 1000, " adding extension: `" + *c + "'" ); } @@ -890,16 +890,16 @@ void Config::loadPlugins() extensions = formatInfo->extensions; if( !extensions.isEmpty() ) { logger->log( 1000, " found extensions..." ); - for( QStringList::Iterator c = extensions.begin(); c != extensions.end(); ++c ) { + for( TQStringList::Iterator c = extensions.begin(); c != extensions.end(); ++c ) { logger->log( 1000, " adding extension: `" + *c + "'" ); } (*c).extensions += extensions; } // add extensions for correction file mime types - for( QStringList::Iterator d = (*c).correction_file_mime_types.begin(); d != (*c).correction_file_mime_types.end(); ++d ) { + for( TQStringList::Iterator d = (*c).correction_file_mime_types.begin(); d != (*c).correction_file_mime_types.end(); ++d ) { logger->log( 1000, " found correction mime type: `" + *d + "'" ); - QStringList extensions = KMimeType::mimeType( *d )->patterns(); - for( QStringList::Iterator e = extensions.begin(); e != extensions.end(); ++e ) { + TQStringList extensions = KMimeType::mimeType( *d )->patterns(); + for( TQStringList::Iterator e = extensions.begin(); e != extensions.end(); ++e ) { (*e).remove( 0, 2 ); logger->log( 1000, " adding correction extension: `" + *e + "'" ); (*c).correction_file_extensions += (*e); @@ -916,17 +916,17 @@ void Config::loadPlugins() delete formatInfoLoader; } -void Config::registerFormatFeatures( const QString &mime_type, +void Config::registerFormatFeatures( const TQString &mime_type, ConvertPlugin* encoder, ConvertPlugin* decoder, ReplayGainPlugin* replaygain/*, RepairPlugin* repairer*/, - const QString &correction_file_mime_type ) + const TQString &correction_file_mime_type ) { //kdDebug() << " entering: `" << "Config::registerFormatFeatures( ... )" << "'" << endl; logger->log( 1000, " entering: `Config::registerFormatFeatures( ... )'" ); // iterate through all file formats and search for an existing one - for( QValueList<FormatItem>::Iterator it = formats.begin(); it != formats.end(); ++it ) { - if( (*it).mime_types.findIndex(mime_type) != -1 ) { // we found an existing entry for our file format + for( TQValueList<FormatItem>::Iterator it = formats.begin(); it != formats.end(); ++it ) { + if( (*it).mime_types.tqfindIndex(mime_type) != -1 ) { // we found an existing entry for our file format //kdDebug() << " found an existing entry: `" << mime_type << "'" << endl; logger->log( 1000, " found an existing entry: `" + mime_type + "'" ); @@ -948,7 +948,7 @@ void Config::registerFormatFeatures( const QString &mime_type, logger->log( 1000, " creating a new entry: `" + mime_type + "'" ); // well it seems, we haven't found an entry. create a new! - QValueList<FormatItem>::Iterator newItem = formats.append( FormatItem() ); + TQValueList<FormatItem>::Iterator newItem = formats.append( FormatItem() ); (*newItem).mime_types = mime_type; if( encoder != 0 ) (*newItem).encoders.append( encoder ); // if( encoder != 0 ) (*newItem).encoder = encoder; @@ -961,10 +961,10 @@ void Config::registerFormatFeatures( const QString &mime_type, } -/*void Config::registerFileFormat( const QString &mime_type, const QString &option, const QString &value ) +/*void Config::registerFileFormat( const TQString &mime_type, const TQString &option, const TQString &value ) { // iterate through all file formats and search for an existing one - for( QValueList<FormatItem>::Iterator it = formats.begin(); it != formats.end(); ++it ) { + for( TQValueList<FormatItem>::Iterator it = formats.begin(); it != formats.end(); ++it ) { if( (*it).mime_types.findIndex(mime_type) != -1 ) { // we found an existing entry for our file format if( option == "mime_type" ) (*it).mime_types.append( value ); //else if( option == "description" ) // TODO implement a qmap ?! @@ -981,7 +981,7 @@ void Config::registerFormatFeatures( const QString &mime_type, } // well it seems, we haven't found an entry. create a new! - QValueList<FormatItem>::Iterator newItem = formats.append( FormatItem() ); + TQValueList<FormatItem>::Iterator newItem = formats.append( FormatItem() ); if( option == "mime_type" ) (*newItem).mime_types.append( value ); //else if( option == "description" ) // TODO implement a qmap ?! else if( option == "size" ) (*newItem).size = value.toInt(); @@ -992,11 +992,11 @@ void Config::registerFormatFeatures( const QString &mime_type, } }*/ -ConvertPlugin* Config::encoderForFormat( const QString &format ) +ConvertPlugin* Config::encoderForFormat( const TQString &format ) { // iterate through all file formats and search for our format in mime_types and extensions - for( QValueList<FormatItem>::Iterator it = formats.begin(); it != formats.end(); ++it ) { - if( (*it).mime_types.findIndex(format) != -1 || (*it).extensions.findIndex(format) != -1 ) { // we found it + for( TQValueList<FormatItem>::Iterator it = formats.begin(); it != formats.end(); ++it ) { + if( (*it).mime_types.tqfindIndex(format) != -1 || (*it).extensions.tqfindIndex(format) != -1 ) { // we found it return (*it).encoder; } } @@ -1004,11 +1004,11 @@ ConvertPlugin* Config::encoderForFormat( const QString &format ) return 0; } -ConvertPlugin* Config::decoderForFormat( const QString &format ) +ConvertPlugin* Config::decoderForFormat( const TQString &format ) { // iterate through all file formats and search for our format in mime_types and extensions - for( QValueList<FormatItem>::Iterator it = formats.begin(); it != formats.end(); ++it ) { - if( (*it).mime_types.findIndex(format) != -1 || (*it).extensions.findIndex(format) != -1 ) { // we found it + for( TQValueList<FormatItem>::Iterator it = formats.begin(); it != formats.end(); ++it ) { + if( (*it).mime_types.tqfindIndex(format) != -1 || (*it).extensions.tqfindIndex(format) != -1 ) { // we found it return (*it).decoder; } } @@ -1016,11 +1016,11 @@ ConvertPlugin* Config::decoderForFormat( const QString &format ) return 0; } -ReplayGainPlugin* Config::replaygainForFormat( const QString &format ) +ReplayGainPlugin* Config::replaygainForFormat( const TQString &format ) { // iterate through all file formats and search for our format in mime_types and extensions - for( QValueList<FormatItem>::Iterator it = formats.begin(); it != formats.end(); ++it ) { - if( (*it).mime_types.findIndex(format) != -1 || (*it).extensions.findIndex(format) != -1 ) { // we found it + for( TQValueList<FormatItem>::Iterator it = formats.begin(); it != formats.end(); ++it ) { + if( (*it).mime_types.tqfindIndex(format) != -1 || (*it).extensions.tqfindIndex(format) != -1 ) { // we found it return (*it).replaygain; } } @@ -1028,11 +1028,11 @@ ReplayGainPlugin* Config::replaygainForFormat( const QString &format ) return 0; } -FormatItem* Config::getFormatItem( const QString &format ) +FormatItem* Config::getFormatItem( const TQString &format ) { // iterate through all file formats and search for our format in mime_types and extensions - for( QValueList<FormatItem>::Iterator it = formats.begin(); it != formats.end(); ++it ) { - if( (*it).mime_types.findIndex(format) != -1 || (*it).extensions.findIndex(format) != -1 ) { // we found it + for( TQValueList<FormatItem>::Iterator it = formats.begin(); it != formats.end(); ++it ) { + if( (*it).mime_types.tqfindIndex(format) != -1 || (*it).extensions.tqfindIndex(format) != -1 ) { // we found it return &(*it); } } @@ -1042,23 +1042,23 @@ FormatItem* Config::getFormatItem( const QString &format ) // NOTE speed up the following 3 functions (cache the data) (use the extensions variable in FormatItem) // NOTE seems to be called too often ??? -QStringList Config::allFormats() +TQStringList Config::allFormats() { - QStringList list; + TQStringList list; //kdDebug() << "entering: `" << "Config::allFormats()" << "'" << endl; logger->log( 1000, "entering: `Config::allFormats()'" ); - for( QValueList<FormatItem>::Iterator it = formats.begin(); it != formats.end(); ++it ) { + for( TQValueList<FormatItem>::Iterator it = formats.begin(); it != formats.end(); ++it ) { //kdDebug() << " mime type: `" << (*it).mime_types.first() << "'" << endl; logger->log( 1000, " mime type: `" + (*it).mime_types.first() + "'" ); if( (*it).mime_types.first() != "application/octet-stream" ) { -// QString extension = KMimeType::mimeType( (*it).mime_types.first() )->patterns().first().lower(); +// TQString extension = KMimeType::mimeType( (*it).mime_types.first() )->patterns().first().lower(); // extension.remove( 0, 2 ); - QString extension = (*it).extensions.first().lower(); + TQString extension = (*it).extensions.first().lower(); //kdDebug() << " extension: `" << extension << "'" << endl; logger->log( 1000, " extension: `" + extension + "'" ); - if( !extension.isEmpty() && !list.contains(extension) ) { + if( !extension.isEmpty() && !list.tqcontains(extension) ) { list.append( extension ); //kdDebug() << " (added)" << endl; logger->log( 1000, " (added)" ); @@ -1069,24 +1069,24 @@ QStringList Config::allFormats() return list; } -QStringList Config::allEncodableFormats() +TQStringList Config::allEncodableFormats() { - QStringList list; + TQStringList list; //kdDebug() << "entering: `" << "Config::allEncodableFormats()" << "'" << endl; logger->log( 1000, "entering: `Config::allEncodableFormats()'" ); - for( QValueList<FormatItem>::Iterator it = formats.begin(); it != formats.end(); ++it ) { + for( TQValueList<FormatItem>::Iterator it = formats.begin(); it != formats.end(); ++it ) { //kdDebug() << " mime type: `" << (*it).mime_types.first() << "'" << endl; logger->log( 1000, " mime type: `" + (*it).mime_types.first() + "'" ); if( (*it).encoder != 0 && binaries[(*it).encoder->enc.bin] != "" && (*it).mime_types.first() != "application/octet-stream" ) { if( !(*it).encoder->enc.lossy.enabled && !(*it).encoder->enc.lossless.enabled && !(*it).encoder->enc.hybrid.enabled ) continue; -// QString extension = KMimeType::mimeType( (*it).mime_types.first() )->patterns().first().lower(); +// TQString extension = KMimeType::mimeType( (*it).mime_types.first() )->patterns().first().lower(); // extension.remove( 0, 2 ); - QString extension = (*it).extensions.first().lower(); + TQString extension = (*it).extensions.first().lower(); //kdDebug() << " extension: `" << extension << "'" << endl; logger->log( 1000, " extension: `" + extension + "'" ); - if( !extension.isEmpty() && !list.contains(extension) ) { + if( !extension.isEmpty() && !list.tqcontains(extension) ) { list.append( extension ); //kdDebug() << " (added)" << endl; logger->log( 1000, " (added)" ); @@ -1097,23 +1097,23 @@ QStringList Config::allEncodableFormats() return list; } -QStringList Config::allLossyEncodableFormats() +TQStringList Config::allLossyEncodableFormats() { - QStringList list; + TQStringList list; //kdDebug() << "entering: `" << "Config::allLossyEncodableFormats()" << "'" << endl; // logger->log( 1000, "entering: `Config::allLossyEncodableFormats()'" ); - for( QValueList<FormatItem>::Iterator it = formats.begin(); it != formats.end(); ++it ) { + for( TQValueList<FormatItem>::Iterator it = formats.begin(); it != formats.end(); ++it ) { //kdDebug() << " mime type: `" << (*it).mime_types.first() << "'" << endl; // logger->log( 1000, " mime type: `" + (*it).mime_types.first() + "'" ); if( (*it).encoder != 0 && binaries[(*it).encoder->enc.bin] != "" && (*it).encoder->enc.lossy.enabled && (*it).compressionType & FormatInfo::lossy && (*it).mime_types.first() != "application/octet-stream" ) { -// QString extension = KMimeType::mimeType( (*it).mime_types.first() )->patterns().first().lower(); +// TQString extension = KMimeType::mimeType( (*it).mime_types.first() )->patterns().first().lower(); // extension.remove( 0, 2 ); - QString extension = (*it).extensions.first().lower(); + TQString extension = (*it).extensions.first().lower(); //kdDebug() << " extension: `" << extension << "'" << endl; // logger->log( 1000, " extension: `" + extension + "'" ); - if( !extension.isEmpty() && !list.contains(extension) ) { + if( !extension.isEmpty() && !list.tqcontains(extension) ) { list.append( extension ); //kdDebug() << " (added)" << endl; // logger->log( 1000, " (added)" ); @@ -1124,23 +1124,23 @@ QStringList Config::allLossyEncodableFormats() return list; } -QStringList Config::allLosslessEncodableFormats() +TQStringList Config::allLosslessEncodableFormats() { - QStringList list; + TQStringList list; //kdDebug() << "entering: `" << "Config::allLosslessEncodableFormats()" << "'" << endl; logger->log( 1000, "entering: `Config::allLosslessEncodableFormats()'" ); - for( QValueList<FormatItem>::Iterator it = formats.begin(); it != formats.end(); ++it ) { + for( TQValueList<FormatItem>::Iterator it = formats.begin(); it != formats.end(); ++it ) { //kdDebug() << " mime type: `" << (*it).mime_types.first() << "'" << endl; logger->log( 1000, " mime type: `" + (*it).mime_types.first() + "'" ); if( (*it).encoder != 0 && binaries[(*it).encoder->enc.bin] != "" && (*it).encoder->enc.lossless.enabled && (*it).compressionType & FormatInfo::lossless && (*it).mime_types.first() != "application/octet-stream" ) { -// QString extension = KMimeType::mimeType( (*it).mime_types.first() )->patterns().first().lower(); +// TQString extension = KMimeType::mimeType( (*it).mime_types.first() )->patterns().first().lower(); // extension.remove( 0, 2 ); - QString extension = (*it).extensions.first().lower(); + TQString extension = (*it).extensions.first().lower(); //kdDebug() << " extension: `" << extension << "'" << endl; logger->log( 1000, " extension: `" + extension + "'" ); - if( !extension.isEmpty() && !list.contains(extension) ) { + if( !extension.isEmpty() && !list.tqcontains(extension) ) { list.append( extension ); //kdDebug() << " (added)" << endl; logger->log( 1000, " (added)" ); @@ -1151,23 +1151,23 @@ QStringList Config::allLosslessEncodableFormats() return list; } -QStringList Config::allHybridEncodableFormats() +TQStringList Config::allHybridEncodableFormats() { - QStringList list; + TQStringList list; //kdDebug() << "entering: `" << "Config::allHybridEncodableFormats()" << "'" << endl; logger->log( 1000, "entering: `Config::allHybridEncodableFormats()'" ); - for( QValueList<FormatItem>::Iterator it = formats.begin(); it != formats.end(); ++it ) { + for( TQValueList<FormatItem>::Iterator it = formats.begin(); it != formats.end(); ++it ) { //kdDebug() << " mime type: `" << (*it).mime_types.first() << "'" << endl; logger->log( 1000, " mime type: `" + (*it).mime_types.first() + "'" ); if( (*it).encoder != 0 && binaries[(*it).encoder->enc.bin] != "" && (*it).encoder->enc.hybrid.enabled && (*it).compressionType & FormatInfo::hybrid && (*it).mime_types.first() != "application/octet-stream" ) { -// QString extension = KMimeType::mimeType( (*it).mime_types.first() )->patterns().first().lower(); +// TQString extension = KMimeType::mimeType( (*it).mime_types.first() )->patterns().first().lower(); // extension.remove( 0, 2 ); - QString extension = (*it).extensions.first().lower(); + TQString extension = (*it).extensions.first().lower(); //kdDebug() << " extension: `" << extension << "'" << endl; logger->log( 1000, " extension: `" + extension + "'" ); - if( !extension.isEmpty() && !list.contains(extension) ) { + if( !extension.isEmpty() && !list.tqcontains(extension) ) { list.append( extension ); //kdDebug() << " (added)" << endl; logger->log( 1000, " (added)" ); @@ -1178,11 +1178,11 @@ QStringList Config::allHybridEncodableFormats() return list; } -QString Config::getCorrectionExtension( const QString &format ) +TQString Config::getCorrectionExtension( const TQString &format ) { // iterate through all file formats and search for our format - for( QValueList<FormatItem>::Iterator it = formats.begin(); it != formats.end(); ++it ) { - if( (*it).mime_types.findIndex(format) != -1 || (*it).extensions.findIndex(format) != -1 ) { // we found it + for( TQValueList<FormatItem>::Iterator it = formats.begin(); it != formats.end(); ++it ) { + if( (*it).mime_types.tqfindIndex(format) != -1 || (*it).extensions.tqfindIndex(format) != -1 ) { // we found it return (*it).correction_file_extensions.first(); } } @@ -1190,11 +1190,11 @@ QString Config::getCorrectionExtension( const QString &format ) return ""; } -QString Config::getFormatDescription( const QString &format ) // NOTE could be removed +TQString Config::getFormatDescription( const TQString &format ) // NOTE could be removed { // iterate through all file formats and search for our format - for( QValueList<FormatItem>::Iterator it = formats.begin(); it != formats.end(); ++it ) { - if( (*it).mime_types.findIndex(format) != -1 || (*it).extensions.findIndex(format) != -1 ) { // we found it + for( TQValueList<FormatItem>::Iterator it = formats.begin(); it != formats.end(); ++it ) { + if( (*it).mime_types.tqfindIndex(format) != -1 || (*it).extensions.tqfindIndex(format) != -1 ) { // we found it return (*it).description; } } @@ -1202,7 +1202,7 @@ QString Config::getFormatDescription( const QString &format ) // NOTE could be r return ""; } -void Config::addProfile( const QString &name, const ConversionOptions& profile ) +void Config::addProfile( const TQString &name, const ConversionOptions& profile ) { ProfileData profileData; profileData.name = name; @@ -1212,9 +1212,9 @@ void Config::addProfile( const QString &name, const ConversionOptions& profile ) emit configChanged(); } -void Config::removeProfile( const QString &name ) +void Config::removeProfile( const TQString &name ) { - for( QValueList<ProfileData>::Iterator it = profiles.begin(); it != profiles.end(); ++it ) { + for( TQValueList<ProfileData>::Iterator it = profiles.begin(); it != profiles.end(); ++it ) { if( (*it).name == name ) { profiles.remove( it ); if( name != i18n("Last used") && name != "Last used" ) writeProfiles(); // will only be saved at app exit, when saving everything anyway @@ -1224,9 +1224,9 @@ void Config::removeProfile( const QString &name ) emit configChanged(); } -ConversionOptions Config::getProfile( const QString &name ) +ConversionOptions Config::getProfile( const TQString &name ) { - for( QValueList<ProfileData>::Iterator it = profiles.begin(); it != profiles.end(); ++it ) { + for( TQValueList<ProfileData>::Iterator it = profiles.begin(); it != profiles.end(); ++it ) { if( /*(*it).name != i18n("Last used") &&*/ (*it).name == name ) { return (*it).options; } @@ -1237,7 +1237,7 @@ ConversionOptions Config::getProfile( const QString &name ) return options; } -QString Config::getProfileName( const ConversionOptions& options ) +TQString Config::getProfileName( const ConversionOptions& options ) { if( options.encodingOptions.sQualityMode == i18n("Lossless") ) { return i18n("Lossless"); @@ -1247,7 +1247,7 @@ QString Config::getProfileName( const ConversionOptions& options ) return i18n("Hybrid"); } - for( QValueList<ProfileData>::Iterator it = profiles.begin(); it != profiles.end(); ++it ) { + for( TQValueList<ProfileData>::Iterator it = profiles.begin(); it != profiles.end(); ++it ) { if( (*it).name != i18n("Last used") && (*it).options.nearlyEqual( options ) ) { return (*it).name; } @@ -1365,23 +1365,23 @@ QString Config::getProfileName( const ConversionOptions& options ) return i18n("User defined"); } -QStringList Config::getAllProfiles() +TQStringList Config::getAllProfiles() { - QStringList list; + TQStringList list; - for( QValueList<ProfileData>::Iterator it = profiles.begin(); it != profiles.end(); ++it ) { + for( TQValueList<ProfileData>::Iterator it = profiles.begin(); it != profiles.end(); ++it ) { /*if( (*it).name != i18n("Last used") )*/ list += (*it).name; } return list; } -bool Config::acceptFile( const QString& format ) +bool Config::acceptFile( const TQString& format ) { if( format == "audio/x-wav" || format == "wav" ) return true; - for( QValueList<FormatItem>::Iterator it = formats.begin(); it != formats.end(); ++it ) { - if( (*it).mime_types.findIndex(format) != -1 || (*it).extensions.findIndex(format) != -1 ) { // we found it + for( TQValueList<FormatItem>::Iterator it = formats.begin(); it != formats.end(); ++it ) { + if( (*it).mime_types.tqfindIndex(format) != -1 || (*it).extensions.tqfindIndex(format) != -1 ) { // we found it if( (*it).decoder != 0 ) return true; } } @@ -1389,10 +1389,10 @@ bool Config::acceptFile( const QString& format ) return false; } -bool Config::acceptReplayGainFile( const QString& format ) +bool Config::acceptReplayGainFile( const TQString& format ) { - for( QValueList<FormatItem>::Iterator it = formats.begin(); it != formats.end(); ++it ) { - if( (*it).mime_types.findIndex(format) != -1 || (*it).extensions.findIndex(format) != -1 ) { // we found it + for( TQValueList<FormatItem>::Iterator it = formats.begin(); it != formats.end(); ++it ) { + if( (*it).mime_types.tqfindIndex(format) != -1 || (*it).extensions.tqfindIndex(format) != -1 ) { // we found it if( (*it).replaygain != 0 ) return true; } } @@ -1400,33 +1400,33 @@ bool Config::acceptReplayGainFile( const QString& format ) return false; } -QString Config::fileFilter( bool wav ) +TQString Config::fileFilter( bool wav ) { - QString filter1; + TQString filter1; if( wav ) filter1 += "*.wav *.WAV *.Wav"; - QString filter2; + TQString filter2; if( wav ) filter2 += "\n*.wav *.WAV *.Wav|wav " + i18n("files") + " (*.wav)"; - QString temp; + TQString temp; - for( QValueList<FormatItem>::Iterator a = formats.begin(); a != formats.end(); ++a ) { + for( TQValueList<FormatItem>::Iterator a = formats.begin(); a != formats.end(); ++a ) { if( (*a).decoder != 0 ) { temp = ""; - for( QStringList::Iterator b = (*a).extensions.begin(); b != (*a).extensions.end(); ++b ) { + for( TQStringList::Iterator b = (*a).extensions.begin(); b != (*a).extensions.end(); ++b ) { filter1 += " *." + (*b); - if( !temp.contains(*b,false) ) temp += " *." + (*b).lower(); + if( !temp.tqcontains(*b,false) ) temp += " *." + (*b).lower(); } //temp.stripWhiteSpace(); // NOTE doesn't work if( temp != "" && temp.length() < 80 ) { temp.remove( 0, 1 ); temp = "\n" + temp + "|" + (*a).extensions.first() + " " + i18n("files") + " (" + temp + ")"; - if( !filter2.contains(temp) ) { // HACK when unsing multiple mime types, there were too much entries + if( !filter2.tqcontains(temp) ) { // HACK when unsing multiple mime types, there were too much entries filter2 += temp; } } else if( temp != "" ) { temp.remove( 0, 1 ); temp = "\n" + temp + "|" + (*a).extensions.first() + " " + i18n("files"); - if( !filter2.contains(temp) ) { // HACK when unsing multiple mime types, there were too much entries + if( !filter2.tqcontains(temp) ) { // HACK when unsing multiple mime types, there were too much entries filter2 += temp; } } @@ -1439,21 +1439,21 @@ QString Config::fileFilter( bool wav ) return filter1 + "|" + i18n("all supported formats") + "\n*.*|" + i18n("all formats") + filter2; } -QStringList Config::fileTypes( bool wav ) +TQStringList Config::fileTypes( bool wav ) { - QStringList types; + TQStringList types; if( wav ) types.append( "wav" ); - QString temp; + TQString temp; - for( QValueList<FormatItem>::Iterator a = formats.begin(); a != formats.end(); ++a ) { + for( TQValueList<FormatItem>::Iterator a = formats.begin(); a != formats.end(); ++a ) { if( (*a).decoder != 0 ) { temp = ""; - for( QStringList::Iterator b = (*a).extensions.begin(); b != (*a).extensions.end(); ++b ) { - if( !temp.contains(*b,false) ) temp.append( (*b).lower() + ", " ); + for( TQStringList::Iterator b = (*a).extensions.begin(); b != (*a).extensions.end(); ++b ) { + if( !temp.tqcontains(*b,false) ) temp.append( (*b).lower() + ", " ); } if( temp != "" ) { temp = temp.left( temp.length() - 2 ); - if( types.findIndex(temp) == -1 ) types.append( temp ); + if( types.tqfindIndex(temp) == -1 ) types.append( temp ); } } } @@ -1461,18 +1461,18 @@ QStringList Config::fileTypes( bool wav ) return types; } -QString Config::replayGainFilter() +TQString Config::replayGainFilter() { - QString filter1; - QString filter2; - QString temp; + TQString filter1; + TQString filter2; + TQString temp; - for( QValueList<FormatItem>::Iterator a = formats.begin(); a != formats.end(); ++a ) { + for( TQValueList<FormatItem>::Iterator a = formats.begin(); a != formats.end(); ++a ) { if( (*a).replaygain != 0 ) { temp = ""; - for( QStringList::Iterator b = (*a).extensions.begin(); b != (*a).extensions.end(); ++b ) { + for( TQStringList::Iterator b = (*a).extensions.begin(); b != (*a).extensions.end(); ++b ) { filter1 += " *." + (*b); - if( !temp.contains(*b,false) ) temp += " *." + (*b).lower(); + if( !temp.tqcontains(*b,false) ) temp += " *." + (*b).lower(); } //temp.stripWhiteSpace(); // NOTE doesn't work if( temp != "" && temp.length() < 80 ) { @@ -1492,20 +1492,20 @@ QString Config::replayGainFilter() return filter1 + "|" + i18n("all supported formats") + "\n*.*|" + i18n("all formats") + filter2; } -QStringList Config::replayGainFileTypes() +TQStringList Config::replayGainFileTypes() { - QStringList types; - QString temp; + TQStringList types; + TQString temp; - for( QValueList<FormatItem>::Iterator a = formats.begin(); a != formats.end(); ++a ) { + for( TQValueList<FormatItem>::Iterator a = formats.begin(); a != formats.end(); ++a ) { if( (*a).replaygain != 0 ) { temp = ""; - for( QStringList::Iterator b = (*a).extensions.begin(); b != (*a).extensions.end(); ++b ) { - if( !temp.contains(*b,false) ) temp.append( (*b).lower() + ", " ); + for( TQStringList::Iterator b = (*a).extensions.begin(); b != (*a).extensions.end(); ++b ) { + if( !temp.tqcontains(*b,false) ) temp.append( (*b).lower() + ", " ); } if( temp != "" ) { temp = temp.left( temp.length() - 2 ); - if( types.findIndex(temp) == -1 ) types.append( temp ); + if( types.tqfindIndex(temp) == -1 ) types.append( temp ); } } } |