From b0e912c8b3d02a518fedda28c3180eb4794a7520 Mon Sep 17 00:00:00 2001 From: tpearson Date: Fri, 27 May 2011 23:37:00 +0000 Subject: TQt4 convert k9copy This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/k9copy@1233843 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- libk9copy/k9burndvd.cpp | 124 ++++++++++++++++++++++++------------------------ 1 file changed, 62 insertions(+), 62 deletions(-) (limited to 'libk9copy/k9burndvd.cpp') diff --git a/libk9copy/k9burndvd.cpp b/libk9copy/k9burndvd.cpp index 7d6f603..72be072 100644 --- a/libk9copy/k9burndvd.cpp +++ b/libk9copy/k9burndvd.cpp @@ -21,16 +21,16 @@ #include "k9burndvd.h" #include "k9burndvd.moc" #include "k9tools.h" -#include +#include #include #include #include #include -#include +#include #include k9BurnDVD::k9BurnDVD() - : QObject(NULL,"") { + : TQObject(NULL,"") { cancelled=false; useK3b=false; autoBurn=false; @@ -38,7 +38,7 @@ k9BurnDVD::k9BurnDVD() iso=false; m_filename=""; progress=new k9Progress(NULL,"progress",NULL); - QString s= KGlobal::dirs()->findResource( "data", "k9copy/anim.mng"); + TQString s= KGlobal::dirs()->findResource( "data", "k9copy/anim.mng"); progress->setMovie(s); m_cdrkit=k9Tools::checkProgram("genisoimage") && k9Tools::checkProgram("wodim"); } @@ -48,28 +48,28 @@ k9BurnDVD::k9BurnDVD() k9BurnDVD::~k9BurnDVD() { } -/** Read property of QString burnDevice. */ -const QString& k9BurnDVD::getburnDevice() { +/** Read property of TQString burnDevice. */ +const TQString& k9BurnDVD::getburnDevice() { return burnDevice; } -/** Write property of QString burnDevice. */ -void k9BurnDVD::setburnDevice( const QString& _newVal) { +/** Write property of TQString burnDevice. */ +void k9BurnDVD::setburnDevice( const TQString& _newVal) { burnDevice = _newVal; } -/** Write property of QString workDir. */ -void k9BurnDVD::setworkDir( const QString& _newVal) { +/** Write property of TQString workDir. */ +void k9BurnDVD::setworkDir( const TQString& _newVal) { workDir = _newVal; if (workDir.right(1)!='/') workDir +='/'; } -void k9BurnDVD::makeIso(QString _filename) { +void k9BurnDVD::makeIso(TQString _filename) { iso=true; m_filename=_filename; } -void k9BurnDVD::setvolId(QString _newVal) { - volId=_newVal.replace(" ","_"); +void k9BurnDVD::setvolId(TQString _newVal) { + volId=_newVal.tqreplace(" ","_"); } void k9BurnDVD::setUseK3b(bool _newVal) { @@ -93,7 +93,7 @@ void k9BurnDVD::burnWithK3b() { KProcess *k3b = new KProcess(); *k3b << "k3b"; - *k3b << QDir::cleanDirPath(workDir +"/dvd/VIDEO_TS"); + *k3b << TQDir::cleanDirPath(workDir +"/dvd/VIDEO_TS"); *k3b << "-videodvd"; k3b->start(); k3b->detach(); @@ -101,19 +101,19 @@ void k9BurnDVD::burnWithK3b() { } void k9BurnDVD::mkisoSizeStderr(KProcess *proc, char *buffer, int buflen) { - QString c=QString::fromLatin1( buffer,buflen);// (proc2->readStderr()); - imageSize=c.replace("\n",""); + TQString c=TQString::tqfromLatin1( buffer,buflen);// (proc2->readStderr()); + imageSize=c.tqreplace("\n",""); ; } void k9BurnDVD::mkisoSizeStdout(KProcess *proc, char *buffer, int buflen) { - QString c=QString::fromLatin1(buffer,buflen);// (proc2->readStdout()); - imageSize=c.replace("\n",""); + TQString c=TQString::tqfromLatin1(buffer,buflen);// (proc2->readStdout()); + imageSize=c.tqreplace("\n",""); ; } -const QString &k9BurnDVD::getImageSize() { - QString c; +const TQString &k9BurnDVD::getImageSize() { + TQString c; c="mkisofs"; proc2=new k9Process; *proc2 << c; @@ -123,13 +123,13 @@ const QString &k9BurnDVD::getImageSize() { *proc2 <<"-udf"; *proc2 <<"-r"; *proc2 <<"-V "+volId; - *proc2 << QDir::cleanDirPath(workDir +"/dvd"); + *proc2 << TQDir::cleanDirPath(workDir +"/dvd"); - connect( proc2, SIGNAL(receivedStderr(KProcess *, char *, int )),this, SLOT(mkisoSizeStderr(KProcess *, char *, int)) ); - connect( proc2, SIGNAL(receivedStdout(KProcess *, char *, int)),this, SLOT(mkisoSizeStdout(KProcess *, char *, int)) ); + connect( proc2, TQT_SIGNAL(receivedStderr(KProcess *, char *, int )),this, TQT_SLOT(mkisoSizeStderr(KProcess *, char *, int)) ); + connect( proc2, TQT_SIGNAL(receivedStdout(KProcess *, char *, int)),this, TQT_SLOT(mkisoSizeStdout(KProcess *, char *, int)) ); if (proc2->start(KProcess::NotifyOnExit,KProcess::All)) { // while (proc2->isRunning()) { -// qApp->processEvents(); +// tqApp->processEvents(); // } proc2->sync(); if (proc2->exitStatus()==0) { @@ -141,8 +141,8 @@ const QString &k9BurnDVD::getImageSize() { return ""; } -void k9BurnDVD::getGenisoimageCmd(k9Process *proc,QString _fileName,bool _printSize) { - QString progname="genisoimage"; +void k9BurnDVD::getGenisoimageCmd(k9Process *proc,TQString _fileName,bool _printSize) { + TQString progname="genisoimage"; *proc << progname; *proc << "-gui"; *proc << "-graft-points"; @@ -158,14 +158,14 @@ void k9BurnDVD::getGenisoimageCmd(k9Process *proc,QString _fileName,bool _printS *proc <<"-o"; *proc <<_fileName; } - connect( proc, SIGNAL(receivedStderr(KProcess *, char *, int)),this, SLOT(growisoStderr(KProcess *, char *, int)) ); - connect( proc, SIGNAL(receivedStdout(KProcess *, char *, int)),this, SLOT(growisoStdout(KProcess *, char *, int)) ); + connect( proc, TQT_SIGNAL(receivedStderr(KProcess *, char *, int)),this, TQT_SLOT(growisoStderr(KProcess *, char *, int)) ); + connect( proc, TQT_SIGNAL(receivedStdout(KProcess *, char *, int)),this, TQT_SLOT(growisoStdout(KProcess *, char *, int)) ); } else { *proc << "-print-size" << "-quiet"; - connect( proc, SIGNAL(receivedStderr(KProcess *, char *, int )),this, SLOT(mkisoSizeStderr(KProcess *, char *, int)) ); - connect( proc, SIGNAL(receivedStdout(KProcess *, char *, int)),this, SLOT(mkisoSizeStdout(KProcess *, char *, int)) ); + connect( proc, TQT_SIGNAL(receivedStderr(KProcess *, char *, int )),this, TQT_SLOT(mkisoSizeStderr(KProcess *, char *, int)) ); + connect( proc, TQT_SIGNAL(receivedStdout(KProcess *, char *, int)),this, TQT_SLOT(mkisoSizeStdout(KProcess *, char *, int)) ); } - *proc <start(); progress->setCaption(i18n("k9Copy - Burning DVD")); progress->setTitle(i18n("Burning DVD")); @@ -193,11 +193,11 @@ void k9BurnDVD::burnWithGenisoimage() { while (!cancelled && !bok) { burnSpeed=0; - QString fileName=""; + TQString fileName=""; if (iso) { fileName=m_filename; if (fileName =="") - fileName=KFileDialog::getSaveFileName (QDir::homeDirPath(),"*.iso", 0,i18n("Save image to disk")); + fileName=KFileDialog::getSaveFileName (TQDir::homeDirPath(),"*.iso", 0,i18n("Save image to disk")); if (fileName =="") { cancelled=true; } @@ -222,7 +222,7 @@ void k9BurnDVD::burnWithGenisoimage() { if (!cancelled) { int res=progress->execute(); if ( res==-1 ) { - KMessageBox::error( 0, i18n("Error burning DVD :\n")+i18n("Unable to run %1").arg("genisoimage"), i18n("DVD burning") ); + KMessageBox::error( 0, i18n("Error burning DVD :\n")+i18n("Unable to run %1").tqarg("genisoimage"), i18n("DVD burning") ); cancelled=true; } else { if (proc->exitStatus()==0) { @@ -231,9 +231,9 @@ void k9BurnDVD::burnWithGenisoimage() { //delete temporary files // clearOutput(workDir+"dvd"); } else { - QString c; + TQString c; - c=i18n("An error occured while Burning DVD: %1").arg(lastMsg) +"\n" +i18n("Insert an other DVD"); + c=i18n("An error occured while Burning DVD: %1").tqarg(lastMsg) +"\n" +i18n("Insert an other DVD"); if ( KMessageBox::warningContinueCancel ( 0,c, i18n("authoring"))!=KMessageBox::Continue) { cancelled=true; } @@ -244,13 +244,13 @@ void k9BurnDVD::burnWithGenisoimage() { } void k9BurnDVD::burnWithGrowisofs() { - time = new QTime(0,0); + time = new TQTime(0,0); time->start(); //KLibFactory *factory; //factory = KLibLoader::self()->factory("libk9copy"); -// progress=static_cast(factory->create(qApp->mainWidget(),"progress", "k9Progress")); +// progress=static_cast(factory->create(tqApp->mainWidget(),"progress", "k9Progress")); progress->setCaption(i18n("k9Copy - Burning DVD")); progress->setTitle(i18n("Burning DVD")); @@ -259,7 +259,7 @@ void k9BurnDVD::burnWithGrowisofs() { while (!cancelled && !bok) { burnSpeed=0; - QString c,progname; + TQString c,progname; if (iso) progname="mkisofs"; else @@ -279,9 +279,9 @@ void k9BurnDVD::burnWithGrowisofs() { *proc <<"-speed=" + m_speed; } else { - QString fileName=m_filename; + TQString fileName=m_filename; if (fileName =="") - fileName=KFileDialog::getSaveFileName (QDir::homeDirPath(),"*.iso", 0,i18n("Save image to disk")); + fileName=KFileDialog::getSaveFileName (TQDir::homeDirPath(),"*.iso", 0,i18n("Save image to disk")); if (fileName !="") { *proc <<"-o"; *proc <execute(); if ( res==-1 ) { - KMessageBox::error( 0, i18n("Error burning DVD :\n")+i18n("Unable to run %1").arg(progname), i18n("DVD burning") ); + KMessageBox::error( 0, i18n("Error burning DVD :\n")+i18n("Unable to run %1").tqarg(progname), i18n("DVD burning") ); cancelled=true; } else { if (proc->exitStatus()==0) { @@ -315,9 +315,9 @@ void k9BurnDVD::burnWithGrowisofs() { //delete temporary files // clearOutput(workDir+"dvd"); } else { - QString c; + TQString c; - c=i18n("An error occured while Burning DVD: %1").arg(lastMsg) +"\n" +i18n("Insert an other DVD"); + c=i18n("An error occured while Burning DVD: %1").tqarg(lastMsg) +"\n" +i18n("Insert an other DVD"); if ( KMessageBox::warningContinueCancel ( 0,c, i18n("authoring"))!=KMessageBox::Continue) { cancelled=true; } @@ -331,34 +331,34 @@ void k9BurnDVD::burnWithGrowisofs() { /** No descriptions */ void k9BurnDVD::growisoStderr(KProcess *proc, char *buffer, int buflen) { - QString c=QString::fromLatin1( buffer,buflen);// (proc->readStderr()); + TQString c=TQString::tqfromLatin1( buffer,buflen);// (proc->readStderr()); char s[255]; int a,b; int pos; lastMsg=c; - if (c.contains("Current Write Speed")) { + if (c.tqcontains("Current Write Speed")) { sscanf(c.latin1(),"%s \"Current Write Speed\" is %d.%d",s,&a,&b); burnSpeed=a+b/10; } - if (c.contains("Speed set to")) { + if (c.tqcontains("Speed set to")) { sscanf(c.latin1(),"Speed set to %d",&a); burnSpeed=a/1385; } progress->setTitle(i18n("Burning DVD")); - progress->setLabelText(i18n("Current write speed :%1 x").arg(burnSpeed)); - if (c.contains("% done")) { - pos=c.find("%"); + progress->setLabelText(i18n("Current write speed :%1 x").tqarg(burnSpeed)); + if (c.tqcontains("% done")) { + pos=c.tqfind("%"); if (pos!=-1) { c=c.mid(1,pos-4); //progress->setLabelText(c); progress->setProgress(c.toInt(),100); float m_percent=c.toFloat()/100; - QTime time2(0,0); + TQTime time2(0,0); time2=time2.addMSecs(time->elapsed()); if (m_percent>0) { - QTime time3(0,0); - QString m_remain; + TQTime time3(0,0); + TQString m_remain; time3=time3.addMSecs((uint32_t)(time->elapsed()*(1/m_percent))); m_remain=time3.toString("hh:mm:ss"); progress->setElapsed(time2.toString("hh:mm:ss") +" / " +m_remain); @@ -371,9 +371,9 @@ void k9BurnDVD::growisoStderr(KProcess *proc, char *buffer, int buflen) { } } void k9BurnDVD::growisoStdout(KProcess *proc, char *buffer, int buflen) { - QString c=QString::fromLatin1( buffer,buflen);// (proc->readStdout()); + TQString c=TQString::tqfromLatin1( buffer,buflen);// (proc->readStdout()); int pos; - pos=c.find("STAT"); + pos=c.tqfind("STAT"); if (pos!=-1) { c=c.mid(pos); progress->setLabelText(c); -- cgit v1.2.1