summaryrefslogtreecommitdiffstats
path: root/libk9copy/k9burndvd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libk9copy/k9burndvd.cpp')
-rw-r--r--libk9copy/k9burndvd.cpp124
1 files changed, 62 insertions, 62 deletions
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 <qdir.h>
+#include <tqdir.h>
#include <kmessagebox.h>
#include <kfiledialog.h>
#include <klibloader.h>
#include <kprocess.h>
-#include <qapplication.h>
+#include <tqapplication.h>
#include <kstandarddirs.h>
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 <<QDir::cleanDirPath(workDir +"/dvd");
+ *proc <<TQDir::cleanDirPath(workDir +"/dvd");
}
@@ -176,14 +176,14 @@ void k9BurnDVD::getWodimCmd(k9Process *proc) {
*proc <<"-data";
if (m_speed !=i18n("default"))
- *proc << QString("speed=%1").arg(m_speed);
- *proc <<QString("dev=%1").arg(burnDevice);
- *proc <<QString("tsize=%1s").arg(imageSize);
+ *proc << TQString("speed=%1").tqarg(m_speed);
+ *proc <<TQString("dev=%1").tqarg(burnDevice);
+ *proc <<TQString("tsize=%1s").tqarg(imageSize);
*proc << "-";
}
void k9BurnDVD::burnWithGenisoimage() {
- time = new QTime(0,0);
+ time = new TQTime(0,0);
time->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<k9Progress *>(factory->create(qApp->mainWidget(),"progress", "k9Progress"));
+// progress=static_cast<k9Progress *>(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 <<fileName;
@@ -294,10 +294,10 @@ void k9BurnDVD::burnWithGrowisofs() {
*proc <<"-udf";
*proc << "-r";
*proc <<"-V "+volId;
- *proc <<QDir::cleanDirPath(workDir +"/dvd");
+ *proc <<TQDir::cleanDirPath(workDir +"/dvd");
- 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)) );
if (!autoBurn && !iso) {
c=i18n("Insert a recordable DVD");
if ( KMessageBox::warningContinueCancel ( 0,c, i18n("DVD burning"))!=KMessageBox::Continue)
@@ -306,7 +306,7 @@ void k9BurnDVD::burnWithGrowisofs() {
if (!cancelled) {
int res=progress->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);