diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:48:06 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:48:06 +0000 |
commit | 47c8a359c5276062c4bc17f0e82410f29081b502 (patch) | |
tree | 2d54a5f60a5b74067632f9ef6df58c2bc38155e6 /filesharing/advanced/kcm_sambaconf/smbpasswdfile.cpp | |
parent | 6f82532777a35e0e60bbd2b290b2e93e646f349b (diff) | |
download | tdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.tar.gz tdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1157648 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'filesharing/advanced/kcm_sambaconf/smbpasswdfile.cpp')
-rw-r--r-- | filesharing/advanced/kcm_sambaconf/smbpasswdfile.cpp | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/filesharing/advanced/kcm_sambaconf/smbpasswdfile.cpp b/filesharing/advanced/kcm_sambaconf/smbpasswdfile.cpp index f7a2cdd9..8286cdf3 100644 --- a/filesharing/advanced/kcm_sambaconf/smbpasswdfile.cpp +++ b/filesharing/advanced/kcm_sambaconf/smbpasswdfile.cpp @@ -26,10 +26,10 @@ * * ******************************************************************************/ -#include <qstring.h> -#include <qfile.h> -#include <qtextstream.h> -#include <qstringlist.h> +#include <tqstring.h> +#include <tqfile.h> +#include <tqtextstream.h> +#include <tqstringlist.h> #include <kurl.h> #include <kdebug.h> @@ -42,9 +42,9 @@ #include "passwd.h" -QStringList SambaUserList::getUserNames() +TQStringList SambaUserList::getUserNames() { - QStringList list; + TQStringList list; SambaUser *user; for ( user = first(); user; user = next() ) @@ -79,14 +79,14 @@ void SmbPasswdFile::setUrl(const KURL & url) { **/ SambaUserList SmbPasswdFile::getSambaUserList() { - QFile f(_url.path()); + TQFile f(_url.path()); SambaUserList list; if ( f.open(IO_ReadOnly) ) { - QTextStream t( &f ); - QString s; + TQTextStream t( &f ); + TQString s; while ( !t.eof() ) { s = t.readLine().stripWhiteSpace(); @@ -95,7 +95,7 @@ SambaUserList SmbPasswdFile::getSambaUserList() if (s.left(1)=="#") continue; - QStringList l = QStringList::split(":",s); + TQStringList l = TQStringList::split(":",s); SambaUser* user = new SambaUser(l[0],l[1].toInt()); user->gid = getUserGID(l[0]); @@ -111,12 +111,12 @@ SambaUserList SmbPasswdFile::getSambaUserList() return list; } -bool SmbPasswdFile::executeSmbpasswd(const QStringList & args) { +bool SmbPasswdFile::executeSmbpasswd(const TQStringList & args) { KProcess p; p << "smbpasswd" << args; - connect( &p, SIGNAL(receivedStdout(KProcess*,char*,int)), - this, SLOT(smbpasswdStdOutReceived(KProcess*,char*,int))); + connect( &p, TQT_SIGNAL(receivedStdout(KProcess*,char*,int)), + this, TQT_SLOT(smbpasswdStdOutReceived(KProcess*,char*,int))); _smbpasswdOutput = ""; @@ -134,15 +134,15 @@ bool SmbPasswdFile::executeSmbpasswd(const QStringList & args) { * Tries to add the passed user to the smbpasswd file * returns true if successful otherwise false **/ -bool SmbPasswdFile::addUser(const SambaUser & user,const QString & password) +bool SmbPasswdFile::addUser(const SambaUser & user,const TQString & password) { KProcess p; p << "smbpasswd" << "-a" << user.name; p << password; - connect( &p, SIGNAL(receivedStdout(KProcess*,char*,int)), - this, SLOT(smbpasswdStdOutReceived(KProcess*,char*,int))); + connect( &p, TQT_SIGNAL(receivedStdout(KProcess*,char*,int)), + this, TQT_SLOT(smbpasswdStdOutReceived(KProcess*,char*,int))); _smbpasswdOutput = ""; @@ -162,12 +162,12 @@ bool SmbPasswdFile::addUser(const SambaUser & user,const QString & password) **/ bool SmbPasswdFile::removeUser(const SambaUser & user) { - QStringList l; + TQStringList l; l << "-x" << user.name; return executeSmbpasswd(l); } -bool SmbPasswdFile::changePassword(const SambaUser & user, const QString & newPassword) +bool SmbPasswdFile::changePassword(const SambaUser & user, const TQString & newPassword) { return addUser(user,newPassword); } @@ -175,7 +175,7 @@ bool SmbPasswdFile::changePassword(const SambaUser & user, const QString & newPa void SmbPasswdFile::smbpasswdStdOutReceived(KProcess *, char *buffer, int buflen) { - _smbpasswdOutput+=QString::fromLatin1(buffer,buflen); + _smbpasswdOutput+=TQString::fromLatin1(buffer,buflen); } @@ -193,32 +193,32 @@ KURL SmbPasswdFile::getUrlFromSambaFile(const SambaFile * /*file*/) } bool SmbPasswdFile::enableUser(const SambaUser & user) { - QStringList l; + TQStringList l; l << "-e" << user.name; return executeSmbpasswd(l); } bool SmbPasswdFile::disableUser(const SambaUser & user) { - QStringList l; + TQStringList l; l << "-d" << user.name; return executeSmbpasswd(l); } bool SmbPasswdFile::setNoPassword(const SambaUser & user) { - QStringList l; + TQStringList l; l << "-n" << user.name; return executeSmbpasswd(l); } bool SmbPasswdFile::setMachineTrustAccount(const SambaUser & user) { - QStringList l; + TQStringList l; l << "-m" << user.name; return executeSmbpasswd(l); } -bool SmbPasswdFile::joinADomain(const QString & domain, const QString & server, - const QString & user, const QString & password) { - QStringList l; +bool SmbPasswdFile::joinADomain(const TQString & domain, const TQString & server, + const TQString & user, const TQString & password) { + TQStringList l; l << "-j" << domain; l << "-r" << server; l << "-U" << user << "%" << password; |