summaryrefslogtreecommitdiffstats
path: root/kuser/kuser.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:25:18 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:25:18 +0000
commitaa3a1ca934bc541bddd3fa136a85f106f7da266e (patch)
tree9ad0b795aed8fa4ac30c2fe0fd1aacb8175714c0 /kuser/kuser.cpp
parentb10cf7066791a2f362495890cd50c984e8025412 (diff)
downloadtdeadmin-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/kuser.cpp')
-rw-r--r--kuser/kuser.cpp264
1 files changed, 132 insertions, 132 deletions
diff --git a/kuser/kuser.cpp b/kuser/kuser.cpp
index 2fd9ff1..2ef2e80 100644
--- a/kuser/kuser.cpp
+++ b/kuser/kuser.cpp
@@ -31,8 +31,8 @@
#include <sys/stat.h>
#endif
#include <fcntl.h>
-#include <qstring.h>
-#include <qdir.h>
+#include <tqstring.h>
+#include <tqdir.h>
#include "kglobal_.h"
#include "kuser.h"
@@ -163,37 +163,37 @@ bool KU::KUser::getCopySkel()
return isCopySkel;
}
-const QString &KU::KUser::getName() const
+const TQString &KU::KUser::getName() const
{
return p_name;
}
-const QString &KU::KUser::getSurname() const
+const TQString &KU::KUser::getSurname() const
{
return p_surname;
}
-const QString &KU::KUser::getEmail() const
+const TQString &KU::KUser::getEmail() const
{
return p_email;
}
-const QString &KU::KUser::getPwd() const
+const TQString &KU::KUser::getPwd() const
{
return p_pwd;
}
-const QString &KU::KUser::getHomeDir() const
+const TQString &KU::KUser::getHomeDir() const
{
return p_dir;
}
-const QString &KU::KUser::getShell() const
+const TQString &KU::KUser::getShell() const
{
return p_shell;
}
-const QString &KU::KUser::getFullName() const
+const TQString &KU::KUser::getFullName() const
{
return p_fname;
}
@@ -205,38 +205,38 @@ bool KU::KUser::getDisabled() const
// FreeBSD apparently uses the GECOS fields differently than other Unices.
// Create some better named functions to make the FreeBSD code clear
-const QString &KU::KUser::getOffice() const
+const TQString &KU::KUser::getOffice() const
{
return p_office;
}
-const QString &KU::KUser::getWorkPhone() const
+const TQString &KU::KUser::getWorkPhone() const
{
return p_ophone;
}
-const QString &KU::KUser::getHomePhone() const
+const TQString &KU::KUser::getHomePhone() const
{
return p_hphone;
}
// New fields needed for the FreeBSD /etc/master.passwd file
-const QString &KU::KUser::getClass() const
+const TQString &KU::KUser::getClass() const
{
return p_class;
}
-const QString &KU::KUser::getOffice1() const
+const TQString &KU::KUser::getOffice1() const
{
return p_office1;
}
-const QString &KU::KUser::getOffice2() const
+const TQString &KU::KUser::getOffice2() const
{
return p_office2;
}
-const QString &KU::KUser::getAddress() const
+const TQString &KU::KUser::getAddress() const
{
return p_address;
}
@@ -251,7 +251,7 @@ gid_t KU::KUser::getGID() const
return p_gid;
}
-const QString &KU::KUser::getSPwd() const
+const TQString &KU::KUser::getSPwd() const
{
return s_pwd;
}
@@ -291,42 +291,42 @@ time_t KU::KUser::getExpire() const
return p_expire;
}
-const QString &KU::KUser::getLMPwd() const // sam_lmpwd,
+const TQString &KU::KUser::getLMPwd() const // sam_lmpwd,
{
return sam_lmpwd;
}
-const QString &KU::KUser::getNTPwd() const //sam_ntpwd,
+const TQString &KU::KUser::getNTPwd() const //sam_ntpwd,
{
return sam_ntpwd;
}
-const QString &KU::KUser::getLoginScript() const //sam_loginscript,
+const TQString &KU::KUser::getLoginScript() const //sam_loginscript,
{
return sam_loginscript;
}
-const QString &KU::KUser::getProfilePath() const // sam_profile,
+const TQString &KU::KUser::getProfilePath() const // sam_profile,
{
return sam_profile;
}
-const QString &KU::KUser::getHomeDrive() const //sam_homedrive,
+const TQString &KU::KUser::getHomeDrive() const //sam_homedrive,
{
return sam_homedrive;
}
-const QString &KU::KUser::getHomePath() const //sam_homepath;
+const TQString &KU::KUser::getHomePath() const //sam_homepath;
{
return sam_homepath;
}
-const QString &KU::KUser::getWorkstations() const //sam_workstation;
+const TQString &KU::KUser::getWorkstations() const //sam_workstation;
{
return sam_workstations;
}
-const QString &KU::KUser::getDomain() const //sam_domain;
+const TQString &KU::KUser::getDomain() const //sam_domain;
{
return sam_domain;
}
@@ -341,37 +341,37 @@ const SID &KU::KUser::getPGSID() const //pgroup_sid;
return pgroup_sid;
}
-void KU::KUser::setName(const QString &data)
+void KU::KUser::setName(const TQString &data)
{
p_name = data;
}
-void KU::KUser::setSurname(const QString &data)
+void KU::KUser::setSurname(const TQString &data)
{
p_surname = data;
}
-void KU::KUser::setEmail(const QString &data)
+void KU::KUser::setEmail(const TQString &data)
{
p_email = data;
}
-void KU::KUser::setPwd(const QString &data)
+void KU::KUser::setPwd(const TQString &data)
{
p_pwd = data;
}
-void KU::KUser::setHomeDir(const QString &data)
+void KU::KUser::setHomeDir(const TQString &data)
{
p_dir = data;
}
-void KU::KUser::setShell(const QString &data)
+void KU::KUser::setShell(const TQString &data)
{
p_shell = data;
}
-void KU::KUser::setFullName(const QString &data)
+void KU::KUser::setFullName(const TQString &data)
{
p_fname = data;
}
@@ -383,23 +383,23 @@ void KU::KUser::setDisabled(bool data)
// FreeBSD apparently uses the GECOS fields differently than other Unices.
// Create some better named functions to make the FreeBSD code clear
-void KU::KUser::setOffice(const QString &data)
+void KU::KUser::setOffice(const TQString &data)
{
p_office = data;
}
-void KU::KUser::setWorkPhone(const QString &data)
+void KU::KUser::setWorkPhone(const TQString &data)
{
p_ophone = data;
}
-void KU::KUser::setHomePhone(const QString &data)
+void KU::KUser::setHomePhone(const TQString &data)
{
p_hphone = data;
}
// New fields needed for the FreeBSD /etc/master.passwd file
-void KU::KUser::setClass(const QString &data)
+void KU::KUser::setClass(const TQString &data)
{
p_class = data;
}
@@ -414,17 +414,17 @@ void KU::KUser::setExpire(time_t data)
p_expire = data;
}
-void KU::KUser::setOffice1(const QString &data)
+void KU::KUser::setOffice1(const TQString &data)
{
p_office1 = data;
}
-void KU::KUser::setOffice2(const QString &data)
+void KU::KUser::setOffice2(const TQString &data)
{
p_office2 = data;
}
-void KU::KUser::setAddress(const QString &data)
+void KU::KUser::setAddress(const TQString &data)
{
p_address = data;
}
@@ -439,7 +439,7 @@ void KU::KUser::setGID(gid_t data)
p_gid = data;
}
-void KU::KUser::setSPwd(const QString &data)
+void KU::KUser::setSPwd(const TQString &data)
{
s_pwd = data;
}
@@ -464,42 +464,42 @@ void KU::KUser::setInactive(int data)
s_inact = data;
}
-void KU::KUser::setLMPwd( const QString &data ) // sam_lmpwd,
+void KU::KUser::setLMPwd( const TQString &data ) // sam_lmpwd,
{
sam_lmpwd = data;
}
-void KU::KUser::setNTPwd( const QString &data ) //sam_ntpwd,
+void KU::KUser::setNTPwd( const TQString &data ) //sam_ntpwd,
{
sam_ntpwd = data;
}
-void KU::KUser::setLoginScript( const QString &data ) //sam_loginscript,
+void KU::KUser::setLoginScript( const TQString &data ) //sam_loginscript,
{
sam_loginscript = data;
}
-void KU::KUser::setProfilePath( const QString &data) // sam_profile,
+void KU::KUser::setProfilePath( const TQString &data) // sam_profile,
{
sam_profile = data;
}
-void KU::KUser::setHomeDrive( const QString &data ) //sam_homedrive,
+void KU::KUser::setHomeDrive( const TQString &data ) //sam_homedrive,
{
sam_homedrive = data;
}
-void KU::KUser::setHomePath( const QString &data ) //sam_homepath;
+void KU::KUser::setHomePath( const TQString &data ) //sam_homepath;
{
sam_homepath = data;
}
-void KU::KUser::setWorkstations( const QString &data ) //sam_workstation;
+void KU::KUser::setWorkstations( const TQString &data ) //sam_workstation;
{
sam_workstations = data;
}
-void KU::KUser::setDomain( const QString &data ) //sam_domain
+void KU::KUser::setDomain( const TQString &data ) //sam_domain
{
sam_domain = data;
}
@@ -551,40 +551,40 @@ int KU::KUser::createHome()
KMessageBox::sorry( 0, i18n("Cannot create home folder for %1: it is null or empty.").arg(p_name) );
return(0);
}
- if (mkdir(QFile::encodeName(p_dir), 0700) != 0) {
+ if (mkdir(TQFile::encodeName(p_dir), 0700) != 0) {
if (errno != EEXIST)
{
- KMessageBox::error( 0, i18n("Cannot create home folder %1.\nError: %2").arg(p_dir).arg(QString::fromLocal8Bit(strerror(errno))) );
+ KMessageBox::error( 0, i18n("Cannot create home folder %1.\nError: %2").arg(p_dir).arg(TQString::fromLocal8Bit(strerror(errno))) );
return(0);
}
}
- if (chown(QFile::encodeName(p_dir), p_uid, p_gid) != 0) {
- KMessageBox::error( 0, i18n("Cannot change owner of home folder %1.\nError: %2").arg(p_dir).arg(QString::fromLocal8Bit(strerror(errno))) );
+ if (chown(TQFile::encodeName(p_dir), p_uid, p_gid) != 0) {
+ KMessageBox::error( 0, i18n("Cannot change owner of home folder %1.\nError: %2").arg(p_dir).arg(TQString::fromLocal8Bit(strerror(errno))) );
return(1);
}
- if (chmod(QFile::encodeName(p_dir), KU_HOMEDIR_PERM) != 0) {
- KMessageBox::error( 0, i18n("Cannot change permissions on home folder %1.\nError: %2").arg(p_dir).arg(QString::fromLocal8Bit(strerror(errno))) );
+ if (chmod(TQFile::encodeName(p_dir), KU_HOMEDIR_PERM) != 0) {
+ KMessageBox::error( 0, i18n("Cannot change permissions on home folder %1.\nError: %2").arg(p_dir).arg(TQString::fromLocal8Bit(strerror(errno))) );
return(1);
}
return(1);
}
-int KU::KUser::tryCreate(const QString &dir)
+int KU::KUser::tryCreate(const TQString &dir)
{
struct stat sb;
int rc = 0;
- rc = stat(QFile::encodeName(dir), &sb);
+ rc = stat(TQFile::encodeName(dir), &sb);
if (rc == 0) {
if (S_ISDIR(sb.st_mode)) {
if (KMessageBox::warningContinueCancel( 0,
i18n("Folder %1 already exists!\nWill make %2 owner and change permissions.\nDo you want to continue?").arg(dir).arg(p_name),
- QString::null, KStdGuiItem::cont() ) == KMessageBox::Continue) {
+ TQString::null, KStdGuiItem::cont() ) == KMessageBox::Continue) {
- if (chown(QFile::encodeName(dir), p_uid, p_gid) != 0) {
- KMessageBox::error( 0, i18n("Cannot change owner of %1 folder.\nError: %2") .arg(dir).arg(QString::fromLocal8Bit(strerror(errno))) );
+ if (chown(TQFile::encodeName(dir), p_uid, p_gid) != 0) {
+ KMessageBox::error( 0, i18n("Cannot change owner of %1 folder.\nError: %2") .arg(dir).arg(TQString::fromLocal8Bit(strerror(errno))) );
}
return(0);
} else {
@@ -597,16 +597,16 @@ int KU::KUser::tryCreate(const QString &dir)
}
} else {
if (errno == ENOENT) {
- if (mkdir(QFile::encodeName(dir), 0700) != 0) {
- KMessageBox::error( 0, i18n("Cannot create %1 folder.\nError: %2").arg(dir).arg(QString::fromLocal8Bit(strerror(errno))));
+ if (mkdir(TQFile::encodeName(dir), 0700) != 0) {
+ KMessageBox::error( 0, i18n("Cannot create %1 folder.\nError: %2").arg(dir).arg(TQString::fromLocal8Bit(strerror(errno))));
return(-1);
}
- if (chown(QFile::encodeName(dir), p_uid, p_gid) != 0) {
- KMessageBox::error( 0, i18n("Cannot change owner of %1 folder.\nError: %2").arg(dir).arg(QString::fromLocal8Bit(strerror(errno))) );
+ if (chown(TQFile::encodeName(dir), p_uid, p_gid) != 0) {
+ KMessageBox::error( 0, i18n("Cannot change owner of %1 folder.\nError: %2").arg(dir).arg(TQString::fromLocal8Bit(strerror(errno))) );
}
return(0);
} else {
- KMessageBox::error( 0, i18n("stat call on %1 failed.\nError: %2").arg(dir).arg(QString::fromLocal8Bit(strerror(errno))) );
+ KMessageBox::error( 0, i18n("stat call on %1 failed.\nError: %2").arg(dir).arg(TQString::fromLocal8Bit(strerror(errno))) );
return(-1);
}
}
@@ -614,91 +614,91 @@ int KU::KUser::tryCreate(const QString &dir)
int KU::KUser::createMailBox()
{
- QString mailboxpath;
+ TQString mailboxpath;
int fd;
- mailboxpath = QFile::decodeName(MAIL_SPOOL_DIR) + "/" + p_name;
- if((fd = open(QFile::encodeName(mailboxpath), O_CREAT|O_EXCL|O_WRONLY,
+ mailboxpath = TQFile::decodeName(MAIL_SPOOL_DIR) + "/" + p_name;
+ if((fd = open(TQFile::encodeName(mailboxpath), O_CREAT|O_EXCL|O_WRONLY,
S_IRUSR|S_IWUSR)) < 0) {
if (errno != EEXIST)
{
KMessageBox::error( 0, i18n("Cannot create %1: %2")
.arg(mailboxpath)
- .arg(QString::fromLocal8Bit(strerror(errno))) );
+ .arg(TQString::fromLocal8Bit(strerror(errno))) );
return -1;
}
}
close(fd);
- if (chown(QFile::encodeName(mailboxpath), p_uid, KU_MAILBOX_GID) != 0) {
+ if (chown(TQFile::encodeName(mailboxpath), p_uid, KU_MAILBOX_GID) != 0) {
KMessageBox::error( 0, i18n("Cannot change owner on mailbox: %1\nError: %2")
- .arg(mailboxpath).arg(QString::fromLocal8Bit(strerror(errno))) );
+ .arg(mailboxpath).arg(TQString::fromLocal8Bit(strerror(errno))) );
return -1;
}
- if (chmod(QFile::encodeName(mailboxpath), KU_MAILBOX_PERM) != 0) {
+ if (chmod(TQFile::encodeName(mailboxpath), KU_MAILBOX_PERM) != 0) {
KMessageBox::error( 0, i18n("Cannot change permissions on mailbox: %1\nError: %2")
- .arg(mailboxpath).arg(QString::fromLocal8Bit(strerror(errno))) );
+ .arg(mailboxpath).arg(TQString::fromLocal8Bit(strerror(errno))) );
return -1;
}
return 0;
}
-void KU::KUser::copyDir(const QString &srcPath, const QString &dstPath)
+void KU::KUser::copyDir(const TQString &srcPath, const TQString &dstPath)
{
mode_t mode;
- QDir s(srcPath);
- QDir d(dstPath);
+ TQDir s(srcPath);
+ TQDir d(dstPath);
- QString dot = QString::fromLatin1(".");
- QString dotdot = QString::fromLatin1("..");
+ TQString dot = TQString::fromLatin1(".");
+ TQString dotdot = TQString::fromLatin1("..");
- s.setFilter( QDir::All | QDir::Hidden | QDir::System );
+ s.setFilter( TQDir::All | TQDir::Hidden | TQDir::System );
for (uint i=0; i<s.count(); i++) {
- QString name(s[i]);
+ TQString name(s[i]);
if (name == dot)
continue;
if (name == dotdot)
continue;
- QString filename(s.filePath(name));
+ TQString filename(s.filePath(name));
- QFileInfo info(filename);
+ TQFileInfo info(filename);
mode = 0;
- if ( info.permission(QFileInfo::ReadOwner) ) mode |= S_IRUSR;
- if ( info.permission(QFileInfo::WriteOwner) ) mode |= S_IWUSR;
- if ( info.permission(QFileInfo::ExeOwner) ) mode |= S_IXUSR;
- if ( info.permission(QFileInfo::ReadGroup) ) mode |= S_IRGRP;
- if ( info.permission(QFileInfo::WriteGroup) ) mode |= S_IWGRP;
- if ( info.permission(QFileInfo::ExeGroup) ) mode |= S_IXGRP;
- if ( info.permission(QFileInfo::ReadOther) ) mode |= S_IROTH;
- if ( info.permission(QFileInfo::WriteOther) ) mode |= S_IWOTH;
- if ( info.permission(QFileInfo::ExeOther) ) mode |= S_IXOTH;
+ if ( info.permission(TQFileInfo::ReadOwner) ) mode |= S_IRUSR;
+ if ( info.permission(TQFileInfo::WriteOwner) ) mode |= S_IWUSR;
+ if ( info.permission(TQFileInfo::ExeOwner) ) mode |= S_IXUSR;
+ if ( info.permission(TQFileInfo::ReadGroup) ) mode |= S_IRGRP;
+ if ( info.permission(TQFileInfo::WriteGroup) ) mode |= S_IWGRP;
+ if ( info.permission(TQFileInfo::ExeGroup) ) mode |= S_IXGRP;
+ if ( info.permission(TQFileInfo::ReadOther) ) mode |= S_IROTH;
+ if ( info.permission(TQFileInfo::WriteOther) ) mode |= S_IWOTH;
+ if ( info.permission(TQFileInfo::ExeOther) ) mode |= S_IXOTH;
if ( info.isSymLink() ) {
- QString link = info.readLink();
+ TQString link = info.readLink();
- if (symlink(QFile::encodeName(link),QFile::encodeName(d.filePath(name))) != 0) {
+ if (symlink(TQFile::encodeName(link),TQFile::encodeName(d.filePath(name))) != 0) {
KMessageBox::error( 0, i18n("Error creating symlink %1.\nError: %2")
- .arg(d.filePath(s[i])).arg(QString::fromLocal8Bit(strerror(errno))) );
+ .arg(d.filePath(s[i])).arg(TQString::fromLocal8Bit(strerror(errno))) );
}
} else if ( info.isDir() ) {
- QDir dir(filename);
+ TQDir dir(filename);
d.mkdir(name, FALSE);
copyDir(s.filePath(name), d.filePath(name));
- if (chown(QFile::encodeName(d.filePath(name)), p_uid, p_gid) != 0) {
+ if (chown(TQFile::encodeName(d.filePath(name)), p_uid, p_gid) != 0) {
KMessageBox::error( 0, i18n("Cannot change owner of folder %1.\nError: %2")
- .arg(d.filePath(s[i])).arg(QString::fromLocal8Bit(strerror(errno))) );
+ .arg(d.filePath(s[i])).arg(TQString::fromLocal8Bit(strerror(errno))) );
}
- if (chmod(QFile::encodeName(d.filePath(name)), mode) != 0) {
+ if (chmod(TQFile::encodeName(d.filePath(name)), mode) != 0) {
KMessageBox::error( 0, i18n("Cannot change permissions on folder %1.\nError: %2")
- .arg(d.filePath(s[i])).arg(QString::fromLocal8Bit(strerror(errno))) );
+ .arg(d.filePath(s[i])).arg(TQString::fromLocal8Bit(strerror(errno))) );
}
} else {
@@ -706,14 +706,14 @@ void KU::KUser::copyDir(const QString &srcPath, const QString &dstPath)
continue;
}
- if (chown(QFile::encodeName(d.filePath(name)), p_uid, p_gid) != 0) {
+ if (chown(TQFile::encodeName(d.filePath(name)), p_uid, p_gid) != 0) {
KMessageBox::error( 0, i18n("Cannot change owner of file %1.\nError: %2")
- .arg(d.filePath(s[i])).arg(QString::fromLocal8Bit(strerror(errno))) );
+ .arg(d.filePath(s[i])).arg(TQString::fromLocal8Bit(strerror(errno))) );
}
- if (chmod(QFile::encodeName(d.filePath(name)), mode) != 0) {
+ if (chmod(TQFile::encodeName(d.filePath(name)), mode) != 0) {
KMessageBox::error( 0, i18n("Cannot change permissions on file %1.\nError: %2")
- .arg(d.filePath(s[i])).arg(QString::fromLocal8Bit(strerror(errno))) );
+ .arg(d.filePath(s[i])).arg(TQString::fromLocal8Bit(strerror(errno))) );
}
}
}
@@ -721,8 +721,8 @@ void KU::KUser::copyDir(const QString &srcPath, const QString &dstPath)
int KU::KUser::copySkel()
{
- QDir s(QFile::decodeName(SKELDIR));
- QDir d(p_dir);
+ TQDir s(TQFile::decodeName(SKELDIR));
+ TQDir d(p_dir);
mode_t mode;
if (!s.exists()) {
@@ -746,7 +746,7 @@ int KU::KUser::removeHome()
{
struct stat sb;
- if (!stat(QFile::encodeName(p_dir), &sb))
+ if (!stat(TQFile::encodeName(p_dir), &sb))
if (S_ISDIR(sb.st_mode) && sb.st_uid == p_uid) {
if (!KIO::NetAccess::del(KURL::fromPathOrURL(p_dir))) {
KMessageBox::error( 0, i18n("Cannot remove home folder %1.\nError: %2")
@@ -757,7 +757,7 @@ int KU::KUser::removeHome()
}
else {
KMessageBox::error( 0, i18n("stat call on file %1 failed.\nError: %2")
- .arg(p_dir).arg(QString::fromLocal8Bit(strerror(errno))) );
+ .arg(p_dir).arg(TQString::fromLocal8Bit(strerror(errno))) );
}
return 0;
@@ -767,15 +767,15 @@ int KU::KUser::removeHome()
int KU::KUser::removeCrontabs()
{
- QString file;
- QString command;
+ TQString file;
+ TQString command;
- file = QFile::decodeName(CRONTAB_DIR) + "/" + p_name;
- if ( access(QFile::encodeName(file), F_OK) == 0 ) {
- command = QString::fromLatin1("crontab -u %1 -r").arg(KProcess::quote(p_name));
- if ( system(QFile::encodeName(command)) != 0 ) {
+ file = TQFile::decodeName(CRONTAB_DIR) + "/" + p_name;
+ if ( access(TQFile::encodeName(file), F_OK) == 0 ) {
+ command = TQString::fromLatin1("crontab -u %1 -r").arg(KProcess::quote(p_name));
+ if ( system(TQFile::encodeName(command)) != 0 ) {
KMessageBox::error( 0, i18n("Cannot remove crontab %1.\nError: %2")
- .arg(command).arg(QString::fromLocal8Bit(strerror(errno))) );
+ .arg(command).arg(TQString::fromLocal8Bit(strerror(errno))) );
}
}
@@ -784,12 +784,12 @@ int KU::KUser::removeCrontabs()
int KU::KUser::removeMailBox()
{
- QString file;
+ TQString file;
- file = QFile::decodeName(MAIL_SPOOL_DIR) + "/" + p_name;
- if (remove(QFile::encodeName(file)) != 0) {
+ file = TQFile::decodeName(MAIL_SPOOL_DIR) + "/" + p_name;
+ if (remove(TQFile::encodeName(file)) != 0) {
KMessageBox::error( 0, i18n("Cannot remove mailbox %1.\nError: %2")
- .arg(file).arg(QString::fromLocal8Bit(strerror(errno))) );
+ .arg(file).arg(TQString::fromLocal8Bit(strerror(errno))) );
}
return 0;
@@ -826,13 +826,13 @@ KU::KUsers::~KUsers()
mUsers.clear();
}
-const QString &KU::KUsers::getDOMSID() const
+const TQString &KU::KUsers::getDOMSID() const
{
return domsid;
}
-void KU::KUsers::parseGecos( const char *gecos, QString &name,
- QString &field1, QString &field2, QString &field3 )
+void KU::KUsers::parseGecos( const char *gecos, TQString &name,
+ TQString &field1, TQString &field2, TQString &field3 )
{
int no = 0;
const char *s = gecos;
@@ -840,11 +840,11 @@ void KU::KUsers::parseGecos( const char *gecos, QString &name,
// At least one part of the string exists
for(;;) {
pos = strchr(s, ',');
- QString val;
+ TQString val;
if(pos == NULL)
- val = QString::fromLocal8Bit(s);
+ val = TQString::fromLocal8Bit(s);
else
- val = QString::fromLocal8Bit(s, (int)(pos-s));
+ val = TQString::fromLocal8Bit(s, (int)(pos-s));
switch(no) {
case 0: name = val; break;
@@ -860,7 +860,7 @@ void KU::KUsers::parseGecos( const char *gecos, QString &name,
void KU::KUsers::fillGecos(KU::KUser *user, const char *gecos)
{
- QString name,field1,field2,field3;
+ TQString name,field1,field2,field3;
parseGecos( gecos, name, field1, field2, field3 );
user->setFullName( name );
caps & Cap_BSD ? user->setOffice( field1 ) : user->setOffice1( field1 );
@@ -870,7 +870,7 @@ void KU::KUsers::fillGecos(KU::KUser *user, const char *gecos)
bool KU::KUsers::doCreate(KU::KUser *user)
{
- QString h_dir;
+ TQString h_dir;
if(user->getCreateMailBox()) {
user->createMailBox();
@@ -909,10 +909,10 @@ bool KU::KUsers::doDelete( KU::KUser *user )
return TRUE;
}
-KU::KUser *KU::KUsers::lookup(const QString & name)
+KU::KUser *KU::KUsers::lookup(const TQString & name)
{
KU::KUser *user;
- QPtrListIterator<KU::KUser> it( mUsers );
+ TQPtrListIterator<KU::KUser> it( mUsers );
while ( (user = it.current()) != 0 && user->getName() != name ) ++it;
return user;
@@ -921,7 +921,7 @@ KU::KUser *KU::KUsers::lookup(const QString & name)
KU::KUser *KU::KUsers::lookup(uid_t uid)
{
KU::KUser *user;
- QPtrListIterator<KU::KUser> it( mUsers );
+ TQPtrListIterator<KU::KUser> it( mUsers );
while ( (user = it.current()) != 0 && user->getUID() != uid ) ++it;
return user;
@@ -930,16 +930,16 @@ KU::KUser *KU::KUsers::lookup(uid_t uid)
KU::KUser *KU::KUsers::lookup_sam( const SID &sid )
{
KU::KUser *user;
- QPtrListIterator<KU::KUser> it( mUsers );
+ TQPtrListIterator<KU::KUser> it( mUsers );
while ( (user = it.current()) != 0 && user->getSID() != sid ) ++it;
return user;
}
-KU::KUser *KU::KUsers::lookup_sam( const QString &sid )
+KU::KUser *KU::KUsers::lookup_sam( const TQString &sid )
{
KU::KUser *user;
- QPtrListIterator<KU::KUser> it( mUsers );
+ TQPtrListIterator<KU::KUser> it( mUsers );
while ( (user = it.current()) != 0 && user->getSID().getSID() != sid ) ++it;
return user;
@@ -948,7 +948,7 @@ KU::KUser *KU::KUsers::lookup_sam( const QString &sid )
KU::KUser *KU::KUsers::lookup_sam( uint rid )
{
KU::KUser *user;
- QPtrListIterator<KU::KUser> it( mUsers );
+ TQPtrListIterator<KU::KUser> it( mUsers );
while ( (user = it.current()) != 0 && user->getSID().getRID() != rid ) ++it;
return user;