diff options
author | Mavridis Philippe <[email protected]> | 2021-01-13 19:30:17 +0200 |
---|---|---|
committer | Mavridis Philippe <[email protected]> | 2021-01-13 19:30:17 +0200 |
commit | 357ddeb8afd82d69ef871c146f4fc8f2c67fb17e (patch) | |
tree | dc3ef0e6fedd64f5fb177c114f72e1515a07cd1b /src/ctcron.cpp | |
parent | c6cbd71bc169ac0e927e52325dbbbcb506abbc73 (diff) | |
download | klamav-357ddeb8afd82d69ef871c146f4fc8f2c67fb17e.tar.gz klamav-357ddeb8afd82d69ef871c146f4fc8f2c67fb17e.zip |
Conversion Qt3->TQt
Signed-off-by: Mavridis Philippe <[email protected]>
Diffstat (limited to 'src/ctcron.cpp')
-rw-r--r-- | src/ctcron.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/ctcron.cpp b/src/ctcron.cpp index 68a6483..d5bfd07 100644 --- a/src/ctcron.cpp +++ b/src/ctcron.cpp @@ -9,7 +9,7 @@ * (at your option) any later version. * ***************************************************************************/ -// Do not introduce any Qt or KDE dependencies into the "CT"-prefixed classes. +// Do not introduce any TQt or KDE dependencies into the "CT"-prefixed classes. // I want to be able to reuse these classes with another GUI toolkit. -GM 11/99 #include "ctcron.h" @@ -19,7 +19,7 @@ #include <pwd.h> // pwd, getpwnam(), getpwuid() #include <assert.h> -#include <qfile.h> +#include <tqfile.h> #include <kprocess.h> #include <ktempfile.h> @@ -37,7 +37,7 @@ CTCron::CTCron(bool _syscron, string ) : tmp.close(); tmpFileName = tmp.name(); - QString readCommand; + TQString readCommand; /* if (uid == 0) // root, so provide requested crontab @@ -51,8 +51,8 @@ CTCron::CTCron(bool _syscron, string ) : } else { - readCommand = QString("crontab -u ") + _login.c_str() + " -l > " + KProcess::quote(tmpFileName); - writeCommand = QString("crontab -u ") + _login.c_str() + " " + KProcess::quote(tmpFileName); + readCommand = TQString("crontab -u ") + _login.c_str() + " -l > " + KProcess::quote(tmpFileName); + writeCommand = TQString("crontab -u ") + _login.c_str() + " " + KProcess::quote(tmpFileName); if (!initFromPasswd(getpwnam(_login.c_str()))) { error = i18n("No password entry found for user '%1'").arg(_login.c_str()); @@ -81,9 +81,9 @@ CTCron::CTCron(bool _syscron, string ) : // Don't set error if it can't be read, it means the user // doesn't have a crontab. - if (system(QFile::encodeName(readCommand)) == 0) + if (system(TQFile::encodeName(readCommand)) == 0) { - ifstream cronfile(QFile::encodeName(tmpFileName)); + ifstream cronfile(TQFile::encodeName(tmpFileName)); cronfile >> *this; } @@ -101,8 +101,8 @@ CTCron::CTCron(const struct passwd *pwd) : tmp.close(); tmpFileName = tmp.name(); - QString readCommand = QString("crontab -u ") + QString(pwd->pw_name) + " -l > " + KProcess::quote(tmpFileName); - writeCommand = QString("crontab -u ") + QString(pwd->pw_name) + " " + KProcess::quote(tmpFileName); + TQString readCommand = TQString("crontab -u ") + TQString(pwd->pw_name) + " -l > " + KProcess::quote(tmpFileName); + writeCommand = TQString("crontab -u ") + TQString(pwd->pw_name) + " " + KProcess::quote(tmpFileName); initFromPasswd(pwd); @@ -114,9 +114,9 @@ CTCron::CTCron(const struct passwd *pwd) : // Don't set error if it can't be read, it means the user // doesn't have a crontab. - if (system(QFile::encodeName(readCommand)) == 0) + if (system(TQFile::encodeName(readCommand)) == 0) { - ifstream cronfile(QFile::encodeName(tmpFileName)); + ifstream cronfile(TQFile::encodeName(tmpFileName)); cronfile >> *this; } @@ -264,17 +264,17 @@ CTCron::~CTCron() void CTCron::apply() { // write to temp file - ofstream cronfile(QFile::encodeName(tmpFileName)); + ofstream cronfile(TQFile::encodeName(tmpFileName)); cronfile << *this << flush; // install temp file into crontab - if (system(QFile::encodeName(writeCommand)) != 0) + if (system(TQFile::encodeName(writeCommand)) != 0) { error = i18n("An error occurred while updating crontab."); } // remove the temp file - (void) unlink(QFile::encodeName(tmpFileName)); + (void) unlink(TQFile::encodeName(tmpFileName)); if (isError()) return; |