diff options
Diffstat (limited to 'kfilereplace/commandengine.cpp')
-rw-r--r-- | kfilereplace/commandengine.cpp | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/kfilereplace/commandengine.cpp b/kfilereplace/commandengine.cpp index 56cc50b1..ffb1919d 100644 --- a/kfilereplace/commandengine.cpp +++ b/kfilereplace/commandengine.cpp @@ -17,10 +17,10 @@ ***************************************************************************/ // QT -#include <qdatetime.h> -#include <qfile.h> -#include <qtextstream.h> -#include <qdom.h> +#include <tqdatetime.h> +#include <tqfile.h> +#include <tqtextstream.h> +#include <tqdom.h> // KDE #include <kuser.h> @@ -30,24 +30,24 @@ // local #include "commandengine.h" -QString CommandEngine::datetime(const QString& opt, const QString& arg) +TQString CommandEngine::datetime(const TQString& opt, const TQString& arg) { Q_UNUSED(arg); if(opt == "iso") - return QDateTime::currentDateTime(Qt::LocalTime).toString(Qt::ISODate); + return TQDateTime::currentDateTime(Qt::LocalTime).toString(Qt::ISODate); if(opt == "local") - return QDateTime::currentDateTime(Qt::LocalTime).toString(Qt::LocalDate); - return QString::null; + return TQDateTime::currentDateTime(Qt::LocalTime).toString(Qt::LocalDate); + return TQString::null; } -QString CommandEngine::user(const QString& opt, const QString& arg) +TQString CommandEngine::user(const TQString& opt, const TQString& arg) { Q_UNUSED(arg); KUser u; if(opt == "uid") - return QString::number(u.uid(),10); + return TQString::number(u.uid(),10); if(opt == "gid") - return QString::number(u.gid(),10); + return TQString::number(u.gid(),10); if(opt == "loginname") return u.loginName(); if(opt == "fullname") @@ -56,47 +56,47 @@ QString CommandEngine::user(const QString& opt, const QString& arg) return u.homeDir(); if(opt == "shell") return u.shell(); - return QString::null; + return TQString::null; } -QString CommandEngine::loadfile(const QString& opt, const QString& arg) +TQString CommandEngine::loadfile(const TQString& opt, const TQString& arg) { Q_UNUSED(arg); - QFile f(opt); - if(!f.open(IO_ReadOnly)) return QString::null; + TQFile f(opt); + if(!f.open(IO_ReadOnly)) return TQString::null; - QTextStream t(&f); + TQTextStream t(&f); - QString s = t.read(); + TQString s = t.read(); f.close(); return s; } -QString CommandEngine::empty(const QString& opt, const QString& arg) +TQString CommandEngine::empty(const TQString& opt, const TQString& arg) { Q_UNUSED(opt); Q_UNUSED(arg); return ""; } -QString CommandEngine::mathexp(const QString& opt, const QString& arg) +TQString CommandEngine::mathexp(const TQString& opt, const TQString& arg) { /* We will use bc 1.06 by Philip A. Nelson <philnelson@acm.org> */ //Q_UNUSED(opt); Q_UNUSED(arg); - QString tempOpt = opt; + TQString tempOpt = opt; tempOpt.replace("ln","l"); tempOpt.replace("sin","s"); tempOpt.replace("cos","c"); tempOpt.replace("arctan","a"); tempOpt.replace("exp","e"); - QString program = "var=("+tempOpt+");print var"; - QString script = "echo '"+program+"' | bc -l;"; + TQString program = "var=("+tempOpt+");print var"; + TQString script = "echo '"+program+"' | bc -l;"; KProcess* proc = new KProcess(); @@ -104,14 +104,14 @@ QString CommandEngine::mathexp(const QString& opt, const QString& arg) *(proc) << script; - connect(proc, SIGNAL(receivedStdout(KProcess*,char*,int)), this, SLOT(slotGetScriptOutput(KProcess*,char*,int))); - connect(proc, SIGNAL(receivedStderr(KProcess*,char*,int)), this, SLOT(slotGetScriptError(KProcess*,char*,int))); - connect(proc, SIGNAL(processExited(KProcess*)), this, SLOT(slotProcessExited(KProcess*))); + connect(proc, TQT_SIGNAL(receivedStdout(KProcess*,char*,int)), this, TQT_SLOT(slotGetScriptOutput(KProcess*,char*,int))); + connect(proc, TQT_SIGNAL(receivedStderr(KProcess*,char*,int)), this, TQT_SLOT(slotGetScriptError(KProcess*,char*,int))); + connect(proc, TQT_SIGNAL(processExited(KProcess*)), this, TQT_SLOT(slotProcessExited(KProcess*))); //Through slotGetScriptOutput, m_processOutput contains the result of the KProcess call if(!proc->start(KProcess::Block, KProcess::All)) { - return QString::null; + return TQString::null; } else { @@ -120,39 +120,39 @@ QString CommandEngine::mathexp(const QString& opt, const QString& arg) if(proc) delete proc; - QString tempbuf = m_processOutput; - m_processOutput = QString::null; + TQString tempbuf = m_processOutput; + m_processOutput = TQString::null; return tempbuf; } -QString CommandEngine::random(const QString& opt, const QString& arg) +TQString CommandEngine::random(const TQString& opt, const TQString& arg) { Q_UNUSED(arg); long seed; if(opt.isEmpty()) { - QDateTime dt; + TQDateTime dt; seed = dt.toTime_t(); } else seed = opt.toLong(); KRandomSequence seq(seed); - return QString::number(seq.getLong(1000000),10); + return TQString::number(seq.getLong(1000000),10); } -QString CommandEngine::stringmanip(const QString& opt, const QString& arg) +TQString CommandEngine::stringmanip(const TQString& opt, const TQString& arg) { Q_UNUSED(opt); Q_UNUSED(arg); return ""; } -QString CommandEngine::variableValue(const QString &variable) +TQString CommandEngine::variableValue(const TQString &variable) { - QString s = variable; + TQString s = variable; s.remove("[$").remove("$]").remove(" "); @@ -160,12 +160,12 @@ QString CommandEngine::variableValue(const QString &variable) return variable; else { - QString leftValue = s.section(":",0,0), + TQString leftValue = s.section(":",0,0), midValue = s.section(":",1,1), rightValue = s.section(":",2,2); - QString opt = midValue; - QString arg = rightValue; + TQString opt = midValue; + TQString arg = rightValue; if(leftValue == "stringmanip") return stringmanip(opt, arg); @@ -191,18 +191,18 @@ void CommandEngine::slotGetScriptError(KProcess* proc, char* s, int i) { Q_UNUSED(proc); Q_UNUSED(proc); - QCString temp(s,i+1); + TQCString temp(s,i+1); if(temp.isEmpty() || temp == "\n") return; } void CommandEngine::slotGetScriptOutput(KProcess* proc, char* s, int i) { Q_UNUSED(proc); - QCString temp(s,i+1); + TQCString temp(s,i+1); if(temp.isEmpty() || temp == "\n") return; - m_processOutput += QString::fromLocal8Bit(temp); + m_processOutput += TQString::fromLocal8Bit(temp); } void CommandEngine::slotProcessExited(KProcess* proc) |