summaryrefslogtreecommitdiffstats
path: root/kioslave/audiocd/audiocd.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-11 06:00:15 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-11 06:00:15 +0000
commitb1057f437bf65300831a0ccb45b920787c6b318d (patch)
treef8a73db06ca1180d0da0ba6dfbe786197b4f4bc3 /kioslave/audiocd/audiocd.cpp
parent4ddfca384ced9ad654213aef9dc2c3973720b980 (diff)
downloadtdemultimedia-b1057f437bf65300831a0ccb45b920787c6b318d.tar.gz
tdemultimedia-b1057f437bf65300831a0ccb45b920787c6b318d.zip
TQt4 port kdemultimedia
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdemultimedia@1236079 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kioslave/audiocd/audiocd.cpp')
-rw-r--r--kioslave/audiocd/audiocd.cpp78
1 files changed, 39 insertions, 39 deletions
diff --git a/kioslave/audiocd/audiocd.cpp b/kioslave/audiocd/audiocd.cpp
index d092ffda..43f61d21 100644
--- a/kioslave/audiocd/audiocd.cpp
+++ b/kioslave/audiocd/audiocd.cpp
@@ -59,7 +59,7 @@ extern "C"
using namespace KIO;
using namespace KCDDB;
-#define QFL1(x) TQString::fromLatin1(x)
+#define TQFL1(x) TQString::tqfromLatin1(x)
#define DEFAULT_CD_DEVICE "/dev/cdrom"
#define CDDB_INFORMATION "CDDB Information"
@@ -149,7 +149,7 @@ public:
TQString fileNameTemplate; // URL settable
TQString albumTemplate; // URL settable
TQString rsearch;
- TQString rreplace;
+ TQString rtqreplace;
// Current strings for this CD and or cddb selection
TQStringList templateTitles;
@@ -189,7 +189,7 @@ AudioCDEncoder *AudioCDProtocol::encoderFromExtension(const TQString& extension)
AudioCDEncoder *AudioCDProtocol::determineEncoder(const TQString & filename)
{
int len = filename.length();
- int pos = filename.findRev('.');
+ int pos = filename.tqfindRev('.');
return encoderFromExtension(filename.right(len - pos));
}
@@ -251,9 +251,9 @@ struct cdrom_drive * AudioCDProtocol::initRequest(const KURL & url)
// circumstances, so build a representation from
// the unit number and SCSI device name.
//
- TQString devname = TQString::fromLatin1( "/dev/%1%2" )
- .arg( drive->dev->given_dev_name )
- .arg( drive->dev->given_unit_number ) ;
+ TQString devname = TQString::tqfromLatin1( "/dev/%1%2" )
+ .tqarg( drive->dev->given_dev_name )
+ .tqarg( drive->dev->given_unit_number ) ;
kdDebug(7117) << " Using derived name " << devname << endl;
d->cd.setDevice( devname );
}
@@ -326,7 +326,7 @@ struct cdrom_drive * AudioCDProtocol::initRequest(const KURL & url)
TQString name(d->fname);
// Remove extension
- int dot = name.findRev('.');
+ int dot = name.tqfindRev('.');
if (dot >= 0)
name.truncate(dot);
@@ -365,7 +365,7 @@ struct cdrom_drive * AudioCDProtocol::initRequest(const KURL & url)
d->req_track = -1;
// Are we in the directory that lists "full CD" files?
- d->req_allTracks = (dname.contains(d->s_fullCD));
+ d->req_allTracks = (dname.tqcontains(d->s_fullCD));
kdDebug(7117) << "dir=" << dname << " file=" << d->fname
<< " req_track=" << d->req_track << " which_dir=" << d->which_dir << " full CD?=" << d->req_allTracks << endl;
@@ -397,9 +397,9 @@ void AudioCDProtocol::get(const KURL & url)
if (!drive)
return;
- if( d->fname.contains(i18n(CDDB_INFORMATION))){
+ if( d->fname.tqcontains(i18n(CDDB_INFORMATION))){
uint choice = 1;
- if(d->fname != TQString("%1.txt").arg(i18n(CDDB_INFORMATION))){
+ if(d->fname != TQString("%1.txt").tqarg(i18n(CDDB_INFORMATION))){
choice= d->fname.section('_',1,1).section('.',0,0).toInt();
}
uint count = 1;
@@ -417,7 +417,7 @@ void AudioCDProtocol::get(const KURL & url)
}
count++;
}
- if(!found && d->fname.contains(i18n(CDDB_INFORMATION)+":")){
+ if(!found && d->fname.tqcontains(i18n(CDDB_INFORMATION)+":")){
mimeType("text/html");
//data(TQCString( d->fname.latin1() ));
// send an empty TQByteArray to signal end of data.
@@ -465,7 +465,7 @@ void AudioCDProtocol::get(const KURL & url)
unsigned long size = encoder->size(time_secs);
totalSize(size);
- emit mimeType(QFL1(encoder->mimeType()));
+ emit mimeType(TQFL1(encoder->mimeType()));
// Read data (track/disk) from the cd
paranoiaRead(drive, firstSector, lastSector, encoder, url.fileName(), size);
@@ -504,7 +504,7 @@ void AudioCDProtocol::stat(const KURL & url)
UDSAtom atom;
atom.m_uds = KIO::UDS_NAME;
- atom.m_str = url.fileName().replace('/', QFL1("%2F"));
+ atom.m_str = url.fileName().tqreplace('/', TQFL1("%2F"));
kdDebug(7117) << k_funcinfo << atom.m_str << endl;
entry.append(atom);
@@ -610,15 +610,15 @@ void AudioCDProtocol::listDir(const KURL & url)
for ( it = d->cddbList.begin(); it != d->cddbList.end(); ++it ){
(*it).toString();
if(count == 1)
- app_file(entry, TQString("%1.txt").arg(i18n(CDDB_INFORMATION)), ((*it).toString().length())+1);
+ app_file(entry, TQString("%1.txt").tqarg(i18n(CDDB_INFORMATION)), ((*it).toString().length())+1);
else
- app_file(entry, TQString("%1_%2.txt").arg(i18n(CDDB_INFORMATION)).arg(count), ((*it).toString().length())+1);
+ app_file(entry, TQString("%1_%2.txt").tqarg(i18n(CDDB_INFORMATION)).tqarg(count), ((*it).toString().length())+1);
count++;
listEntry(entry, false);
}
// Error
if( count == 1 ) {
- app_file(entry, TQString("%1: %2.txt").arg(i18n(CDDB_INFORMATION)).arg(CDDB::resultToString(d->cddbResult)), ((*it).toString().length())+1);
+ app_file(entry, TQString("%1: %2.txt").tqarg(i18n(CDDB_INFORMATION)).tqarg(CDDB::resultToString(d->cddbResult)), ((*it).toString().length())+1);
count++;
listEntry(entry, false);
}
@@ -838,7 +838,7 @@ void AudioCDProtocol::paranoiaRead(
if (0 == buf) {
kdDebug(7117) << "Unrecoverable error in paranoia_read" << endl;
ok = false;
- error( ERR_SLAVE_DEFINED, i18n( "Error reading audio data for %1 from the CD" ).arg( fileName ) );
+ error( ERR_SLAVE_DEFINED, i18n( "Error reading audio data for %1 from the CD" ).tqarg( fileName ) );
break;
}
@@ -848,7 +848,7 @@ void AudioCDProtocol::paranoiaRead(
if(encoderProcessed == -1){
kdDebug(7117) << "Encoder processing error, stopping." << endl;
ok = false;
- TQString errMsg = i18n( "Couldn't read %1: encoding failed" ).arg( fileName );
+ TQString errMsg = i18n( "Couldn't read %1: encoding failed" ).tqarg( fileName );
TQString details = encoder->lastErrorMessage();
if ( !details.isEmpty() )
errMsg += "\n" + details;
@@ -926,7 +926,7 @@ void AudioCDProtocol::paranoiaRead(
processedSize(processed);
}
else if ( ok ) // i.e. no error message already emitted
- error( ERR_SLAVE_DEFINED, i18n( "Couldn't read %1: encoding failed" ).arg( fileName ) );
+ error( ERR_SLAVE_DEFINED, i18n( "Couldn't read %1: encoding failed" ).tqarg( fileName ) );
paranoia_free(paranoia);
paranoia = 0;
@@ -953,24 +953,24 @@ void AudioCDProtocol::parseURLArgs(const KURL & url)
{
TQString token(*it);
- int equalsPos(token.find('='));
+ int equalsPos(token.tqfind('='));
if (-1 == equalsPos)
continue;
TQString attribute(token.left(equalsPos));
TQString value(token.mid(equalsPos + 1));
- if (attribute == QFL1("device"))
+ if (attribute == TQFL1("device"))
d->device = value;
- else if (attribute == QFL1("paranoia_level"))
+ else if (attribute == TQFL1("paranoia_level"))
d->paranoiaLevel = value.toInt();
- else if (attribute == QFL1("fileNameTemplate"))
+ else if (attribute == TQFL1("fileNameTemplate"))
d->fileNameTemplate = value;
- else if (attribute == QFL1("albumNameTemplate"))
+ else if (attribute == TQFL1("albumNameTemplate"))
d->albumTemplate = value;
- else if (attribute == QFL1("cddbChoice"))
+ else if (attribute == TQFL1("cddbChoice"))
d->cddbUserChoice = value.toInt();
- else if (attribute == QFL1("niceLevel")){
+ else if (attribute == TQFL1("niceLevel")){
int niceLevel = value.toInt();
if(setpriority(PRIO_PROCESS, getpid(), niceLevel) != 0)
kdDebug(7117) << "Setting nice level to (" << niceLevel << ") failed." << endl;
@@ -984,12 +984,12 @@ void AudioCDProtocol::parseURLArgs(const KURL & url)
*/
void AudioCDProtocol::loadSettings()
{
- KConfig *config = new KConfig(QFL1("kcmaudiocdrc"), true /*readonly*/, false /*no kdeglobals*/);
+ KConfig *config = new KConfig(TQFL1("kcmaudiocdrc"), true /*readonly*/, false /*no kdeglobals*/);
- config->setGroup(QFL1("CDDA"));
+ config->setGroup(TQFL1("CDDA"));
- if (!config->readBoolEntry(QFL1("autosearch"),true)) {
- d->device = config->readEntry(QFL1("device"),QFL1(DEFAULT_CD_DEVICE));
+ if (!config->readBoolEntry(TQFL1("autosearch"),true)) {
+ d->device = config->readEntry(TQFL1("device"),TQFL1(DEFAULT_CD_DEVICE));
}
d->paranoiaLevel = 1; // enable paranoia error correction, but allow skipping
@@ -1016,7 +1016,7 @@ void AudioCDProtocol::loadSettings()
d->fileNameTemplate = config->readEntry("file_name_template", "%{albumartist} - %{number} - %{title}");
d->albumTemplate = config->readEntry("album_template", "%{albumartist} - %{albumtitle}");
d->rsearch = config->readEntry("regexp_search");
- d->rreplace = config->readEntry("regexp_replace");
+ d->rtqreplace = config->readEntry("regexp_tqreplace");
// if the regular expressions are enclosed in qoutes. remove them
// otherwise it is not possible to search for a space " ", since an empty (only spaces) value is not
// supported by KConfig, so the space has to be qouted, but then here the regexp searches really for " "
@@ -1026,9 +1026,9 @@ void AudioCDProtocol::loadSettings()
{
d->rsearch=d->rsearch.mid(1, d->rsearch.length()-2);
}
- if (qoutedString.exactMatch(d->rreplace))
+ if (qoutedString.exactMatch(d->rtqreplace))
{
- d->rreplace=d->rreplace.mid(1, d->rreplace.length()-2);
+ d->rtqreplace=d->rtqreplace.mid(1, d->rtqreplace.length()-2);
}
// Tell the encoders to load their settings
@@ -1058,7 +1058,7 @@ void AudioCDProtocol::generateTemplateTitles()
{
for (unsigned int i = 0; i < d->tracks; i++){
TQString n;
- d->templateTitles.append( i18n("Track %1").arg(n.sprintf("%02d", i + 1)));
+ d->templateTitles.append( i18n("Track %1").tqarg(n.sprintf("%02d", i + 1)));
}
return;
}
@@ -1076,12 +1076,12 @@ void AudioCDProtocol::generateTemplateTitles()
macros["title"] = (info.trackInfoList[i].title);
TQString n;
macros["number"] = n.sprintf("%02d", i + 1);
- //macros["number"] = TQString("%1").arg(i+1, 2, 10);
+ //macros["number"] = TQString("%1").tqarg(i+1, 2, 10);
macros["genre"] = info.genre;
macros["year"] = TQString::number(info.year);
- TQString title = KMacroExpander::expandMacros(d->fileNameTemplate, macros, '%').replace('/', QFL1("%2F"));
- title.replace( TQRegExp(d->rsearch), d->rreplace );
+ TQString title = KMacroExpander::expandMacros(d->fileNameTemplate, macros, '%').tqreplace('/', TQFL1("%2F"));
+ title.tqreplace( TQRegExp(d->rsearch), d->rtqreplace );
d->templateTitles.append(title);
}
@@ -1090,8 +1090,8 @@ void AudioCDProtocol::generateTemplateTitles()
macros["albumtitle"] = info.title;
macros["genre"] = info.genre;
macros["year"] = TQString::number(info.year);
- d->templateAlbumName = KMacroExpander::expandMacros(d->albumTemplate, macros, '%').replace('/', QFL1("%2F"));
- d->templateAlbumName.replace( TQRegExp(d->rsearch), d->rreplace );
+ d->templateAlbumName = KMacroExpander::expandMacros(d->albumTemplate, macros, '%').tqreplace('/', TQFL1("%2F"));
+ d->templateAlbumName.tqreplace( TQRegExp(d->rsearch), d->rtqreplace );
}
/**