diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-11 06:00:15 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-11 06:00:15 +0000 |
commit | b1057f437bf65300831a0ccb45b920787c6b318d (patch) | |
tree | f8a73db06ca1180d0da0ba6dfbe786197b4f4bc3 /kaudiocreator/encoder.cpp | |
parent | 4ddfca384ced9ad654213aef9dc2c3973720b980 (diff) | |
download | tdemultimedia-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 'kaudiocreator/encoder.cpp')
-rw-r--r-- | kaudiocreator/encoder.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/kaudiocreator/encoder.cpp b/kaudiocreator/encoder.cpp index ced2fcac..a0567fbf 100644 --- a/kaudiocreator/encoder.cpp +++ b/kaudiocreator/encoder.cpp @@ -37,7 +37,7 @@ /** * Constructor, load settings. */ -Encoder::Encoder( TQObject* parent, const char* name):TQObject(parent,name),reportCount(0) { +Encoder::Encoder( TQObject* tqparent, const char* name):TQObject(tqparent,name),reportCount(0) { loadSettings(); } @@ -53,11 +53,11 @@ void Encoder::loadSettings() { EncoderPrefs* Encoder::loadEncoder( int encoder ){ EncoderPrefs* prefs; - TQString currentEncoderGroup = TQString("Encoder_%1").arg(encoder); + TQString currentEncoderGroup = TQString("Encoder_%1").tqarg(encoder); prefs = EncoderPrefs::prefs(currentEncoderGroup); if ( !EncoderPrefs::hasPrefs(currentEncoderGroup) ) { KMessageBox::sorry(0, i18n("No encoder has been selected.\nPlease select an encoder in the configuration."), i18n("No Encoder Selected")); - prefs->setCommandLine(TQString::null); + prefs->setCommandLine(TQString()); } return prefs; @@ -132,8 +132,8 @@ void Encoder::removeJob(int id ) { * @param job the job to encode. */ void Encoder::encodeWav(Job *job ) { - emit(addJob(job, i18n("Encoding (%1): %2 - %3").arg(loadEncoder(job->encoder)->extension()) - .arg(job->track_artist).arg(job->track_title))); + emit(addJob(job, i18n("Encoding (%1): %2 - %3").tqarg(loadEncoder(job->encoder)->extension()) + .tqarg(job->track_artist).tqarg(job->track_title))); pendingJobs.append(job); tendToNewJobs(); } @@ -160,7 +160,7 @@ void Encoder::tendToNewJobs() { EncoderPrefs* prefs = loadEncoder(job->encoder); TQString desiredFile = Prefs::fileFormat(); - desiredFile.replace( TQRegExp("~"), TQDir::homeDirPath() ); + desiredFile.tqreplace( TQRegExp("~"), TQDir::homeDirPath() ); { TQMap <TQString,TQString> map; map.insert("extension", prefs->extension()); @@ -185,7 +185,7 @@ void Encoder::tendToNewJobs() { } } - int lastSlash = desiredFile.findRev('/',-1); + int lastSlash = desiredFile.tqfindRev('/',-1); if ( lastSlash == -1 || !(KStandardDirs::makeDir( desiredFile.mid(0,lastSlash), 0775)) ) { KMessageBox::sorry(0, i18n("Cannot place file, unable to make directories."), i18n("Encoding Failed")); @@ -211,7 +211,7 @@ void Encoder::tendToNewJobs() { KShellProcess *proc = new KShellProcess(); proc->setPriority(Prefs::niceLevel()); - *proc << TQFile::encodeName(command); + *proc << TQFile::encodeName(command).data(); connect(proc, TQT_SIGNAL(receivedStdout(KProcess *, char *, int )), this, TQT_SLOT(receivedThreadOutput(KProcess *, char *, int ))); connect(proc, TQT_SIGNAL(receivedStderr(KProcess *, char *, int )), @@ -225,7 +225,7 @@ void Encoder::tendToNewJobs() { } /** - * We have received some output from a thread. See if it contains %. + * We have received some output from a thread. See if it tqcontains %. * @param proc the process that has new output. * @param buffer the output from the process * @param buflen the length of the buffer. @@ -235,7 +235,7 @@ void Encoder::receivedThreadOutput(KProcess *process, char *buffer, int length ) kdDebug(60002) << buffer << endl; // Make sure we have a job to send an update too. - if(jobs.find((KShellProcess*)process) == jobs.end()){ + if(jobs.tqfind((KShellProcess*)process) == jobs.end()){ kdDebug(60002) << "Encoder::receivedThreadOutput Job doesn't exists. Line: " << __LINE__ << endl; return; } @@ -247,17 +247,17 @@ void Encoder::receivedThreadOutput(KProcess *process, char *buffer, int length ) // Make sure the output string has a % symble in it. TQString output = TQString(buffer).mid(0,length); - if ( output.find('%') == -1 && reportCount < 5 ) { + if ( output.tqfind('%') == -1 && reportCount < 5 ) { kdDebug(60002) << "No \'%%\' in output. Report as bug w/encoder options if progressbar doesn't fill." << endl; reportCount++; return; } - //qDebug(TQString("Pre cropped: %1").arg(output).latin1()); - output = output.mid(output.find('%')-loadEncoder(job->encoder)->percentLength(),2); - //qDebug(TQString("Post cropped: %1").arg(output).latin1()); + //qDebug(TQString("Pre cropped: %1").tqarg(output).latin1()); + output = output.mid(output.tqfind('%')-loadEncoder(job->encoder)->percentLength(),2); + //qDebug(TQString("Post cropped: %1").tqarg(output).latin1()); bool conversionSuccessfull = false; int percent = output.toInt(&conversionSuccessfull); - //qDebug(TQString("number: %1").arg(percent).latin1()); + //qDebug(TQString("number: %1").tqarg(percent).latin1()); if ( percent >= 0 && percent < 100 && conversionSuccessfull ) { emit(updateProgress(job->id, percent)); } @@ -284,7 +284,7 @@ void Encoder::jobDone(KProcess *process ) { bool showDebugBox = false; if ( process->exitStatus() == 127 ) { - KMessageBox::sorry(0, i18n("The selected encoder was not found.\nThe wav file has been removed. Command was: %1").arg(job->errorString), i18n("Encoding Failed")); + KMessageBox::sorry(0, i18n("The selected encoder was not found.\nThe wav file has been removed. Command was: %1").tqarg(job->errorString), i18n("Encoding Failed")); emit(updateProgress(job->id, -1)); } else if ( TQFile::exists(job->newLocation) ) { |