diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:25:18 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:25:18 +0000 |
commit | aa3a1ca934bc541bddd3fa136a85f106f7da266e (patch) | |
tree | 9ad0b795aed8fa4ac30c2fe0fd1aacb8175714c0 /kuser/misc.cpp | |
parent | b10cf7066791a2f362495890cd50c984e8025412 (diff) | |
download | tdeadmin-aa3a1ca934bc541bddd3fa136a85f106f7da266e.tar.gz tdeadmin-aa3a1ca934bc541bddd3fa136a85f106f7da266e.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeadmin@1157635 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kuser/misc.cpp')
-rw-r--r-- | kuser/misc.cpp | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/kuser/misc.cpp b/kuser/misc.cpp index 4215c40..c16f563 100644 --- a/kuser/misc.cpp +++ b/kuser/misc.cpp @@ -28,21 +28,21 @@ #ifdef HAVE_CRYPT_H #include <crypt.h> #endif -#include <qfile.h> +#include <tqfile.h> #include <kmessagebox.h> #include "misc.h" #include "kglobal_.h" -bool backup(const QString & name) +bool backup(const TQString & name) { - QString tmp = name + QString::fromLatin1(KU_BACKUP_EXT); - QFile::remove( tmp ); + TQString tmp = name + TQString::fromLatin1(KU_BACKUP_EXT); + TQFile::remove( tmp ); - if (copyFile(QFile::encodeName(name), QFile::encodeName(tmp)) == -1) + if (copyFile(TQFile::encodeName(name), TQFile::encodeName(tmp)) == -1) { - QString str; + TQString str; KMessageBox::error( 0, i18n("Can't create backup file for %1").arg(name) ); return false; } @@ -58,10 +58,10 @@ time_t now() { #define BLOCK_SIZE 65536 -int copyFile(const QString & from, const QString & to) +int copyFile(const TQString & from, const TQString & to) { - QFile fi; - QFile fo; + TQFile fi; + TQFile fo; char buf[BLOCK_SIZE]; fi.setName(from); @@ -95,9 +95,9 @@ int copyFile(const QString & from, const QString & to) return (0); } -QStringList readShells() +TQStringList readShells() { - QStringList shells; + TQStringList shells; FILE *f = fopen(SHELL_FILE,"r"); if (f) { @@ -110,31 +110,31 @@ QStringList readShells() s[strlen(s)-1]=0; if ((s[0])&&(s[0]!='#')) - shells.append(QFile::decodeName(s)); + shells.append(TQFile::decodeName(s)); } fclose(f); } return shells; } -void addShell(const QString &shell) +void addShell(const TQString &shell) { - QStringList shells = readShells(); + TQStringList shells = readShells(); if (shells.contains(shell)) return; FILE *f = fopen(SHELL_FILE,"a"); if (f) { - fputs(QFile::encodeName(shell).data(), f); + fputs(TQFile::encodeName(shell).data(), f); fputc('\n', f); } fclose(f); } -QCString genSalt( int len ) +TQCString genSalt( int len ) { - QCString salt( len + 1 ); + TQCString salt( len + 1 ); const char * set = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./"; salt[0] = set[getpid() % strlen(set)]; @@ -144,9 +144,9 @@ QCString genSalt( int len ) return salt; } -QString encryptPass( const QString &pass, bool md5 ) +TQString encryptPass( const TQString &pass, bool md5 ) { - QCString salt; + TQCString salt; char tmp[128]; if ( md5 ) { @@ -157,8 +157,8 @@ QString encryptPass( const QString &pass, bool md5 ) } else { salt = genSalt( 2 ); } - strcpy( tmp, crypt( QFile::encodeName( pass ), salt ) ); - return QString::fromLocal8Bit( tmp ); + strcpy( tmp, crypt( TQFile::encodeName( pass ), salt ) ); + return TQString::fromLocal8Bit( tmp ); } int timeToDays(time_t time) |