diff options
Diffstat (limited to 'src/magiclabel.cpp')
-rw-r--r-- | src/magiclabel.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/magiclabel.cpp b/src/magiclabel.cpp index ac75e02..8a6fb3f 100644 --- a/src/magiclabel.cpp +++ b/src/magiclabel.cpp @@ -9,8 +9,8 @@ * * ***************************************************************************/ -#include <qstringlist.h> -#include <qregexp.h> +#include <tqstringlist.h> +#include <tqregexp.h> #include <klocale.h> #include <kuser.h> @@ -21,7 +21,7 @@ // This class is still very simple (as most of the classes) // They get all improved later when "OpenGL Effect Widget" structure is completed -MagicLabel::MagicLabel(QString s, bool translate) +MagicLabel::MagicLabel(TQString s, bool translate) { prefix = "ML:"; preUSER = "USER:"; @@ -37,7 +37,7 @@ MagicLabel::MagicLabel(QString s, bool translate) void MagicLabel::transform() { - if (mValue.contains(prefix + preUSER)) + if (mValue.tqcontains(prefix + preUSER)) getUserInfo(); else if (mValue.startsWith(prefix + preCMD)) getCommandOutput(); @@ -48,39 +48,39 @@ void MagicLabel::getUserInfo() { static KUser user; - if (mValue.contains(prefix + preUSER + "loginname")) - mValue = mValue.replace(prefix + preUSER + "loginname", user.loginName()); - else if (mValue.contains(prefix + preUSER + "fullname")) - mValue = mValue.replace(prefix + preUSER + "fullname", user.fullName()); - else if (mValue.contains(prefix + preUSER + "homedir")) - mValue = mValue.replace(prefix + preUSER + "homedir", user.homeDir()); + if (mValue.tqcontains(prefix + preUSER + "loginname")) + mValue = mValue.tqreplace(prefix + preUSER + "loginname", user.loginName()); + else if (mValue.tqcontains(prefix + preUSER + "fullname")) + mValue = mValue.tqreplace(prefix + preUSER + "fullname", user.fullName()); + else if (mValue.tqcontains(prefix + preUSER + "homedir")) + mValue = mValue.tqreplace(prefix + preUSER + "homedir", user.homeDir()); } void MagicLabel::getCommandOutput() { - QString cmd = QStringList::split(prefix + preCMD, mValue)[0]; - QStringList parts = QStringList::split(" ", cmd); + TQString cmd = TQStringList::split(prefix + preCMD, mValue)[0]; + TQStringList parts = TQStringList::split(" ", cmd); KShellProcess *proc = new KShellProcess; for (int i = 0; i < parts.count(); i++) *proc << parts[i]; - connect(proc, SIGNAL(processExited(KProcess*)), this, SLOT(processExited(KProcess*))); - connect(proc, SIGNAL(receivedStdout(KProcess*, char*, int)), this, SLOT(receivedStdout(KProcess*, char*, int))); + connect(proc, TQT_SIGNAL(processExited(KProcess*)), this, TQT_SLOT(processExited(KProcess*))); + connect(proc, TQT_SIGNAL(receivedStdout(KProcess*, char*, int)), this, TQT_SLOT(receivedStdout(KProcess*, char*, int))); mValue = ""; if (!proc->start(KProcess::Block, KProcess::Stdout)) - KMessageBox::information(0, QString("Could not start process: %1").arg(cmd)); + KMessageBox::information(0, TQString("Could not start process: %1").tqarg(cmd)); } void MagicLabel::receivedStdout(KProcess *proc, char *buffer, int buflen) { - QString buf = QString::fromLatin1(buffer, buflen); - mValue += buf.replace("\n", ""); + TQString buf = TQString::tqfromLatin1(buffer, buflen); + mValue += buf.tqreplace("\n", ""); } |