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 /ksirc/KSOpenkSirc/open_ksirc.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 'ksirc/KSOpenkSirc/open_ksirc.cpp')
-rw-r--r-- | ksirc/KSOpenkSirc/open_ksirc.cpp | 100 |
1 files changed, 50 insertions, 50 deletions
diff --git a/ksirc/KSOpenkSirc/open_ksirc.cpp b/ksirc/KSOpenkSirc/open_ksirc.cpp index 5a4a4799..d3ff7488 100644 --- a/ksirc/KSOpenkSirc/open_ksirc.cpp +++ b/ksirc/KSOpenkSirc/open_ksirc.cpp @@ -12,11 +12,11 @@ #include "serverFileParser.h" #include "enter_combo.h" #include "../ksircserver.h" -#include <qlistbox.h> -#include <qpushbutton.h> -#include <qlabel.h> -#include <qcheckbox.h> -#include <qdict.h> +#include <tqlistbox.h> +#include <tqpushbutton.h> +#include <tqlabel.h> +#include <tqcheckbox.h> +#include <tqdict.h> #include <stdlib.h> #include <unistd.h> @@ -28,14 +28,14 @@ #include <kmessagebox.h> #include <kmdcodec.h> -QPtrList<Server> Groups; +TQPtrList<Server> Groups; #undef Inherited #define Inherited open_ksircData open_ksirc::open_ksirc ( - QWidget* parent, + TQWidget* parent, const char* name ) : @@ -47,7 +47,7 @@ open_ksirc::open_ksirc // if it don't exist use $KDEDIR/share/apps/ksirc/servers.txt // changes are written to ~/.kde/share/apps/ksirc/servers.txt - QString filename = locate("appdata", "servers.txt"); + TQString filename = locate("appdata", "servers.txt"); serverFileParser::readDatafile( filename ); Groups.setAutoDelete(TRUE); @@ -66,29 +66,29 @@ open_ksirc::open_ksirc KConfig *conf = kapp->config(); conf->setGroup("ServerList"); CheckB_StorePassword->setChecked( conf->readBoolEntry("StorePasswords") ); - QStringList recent = conf->readListEntry("RecentServers"); - for(QStringList::ConstIterator it = recent.begin(); it != recent.end(); ++it){ + TQStringList recent = conf->readListEntry("RecentServers"); + for(TQStringList::ConstIterator it = recent.begin(); it != recent.end(); ++it){ if(conf->hasGroup("RecentServer-" + *it)){ conf->setGroup("RecentServer-" + *it); - QPtrList<port> rp; + TQPtrList<port> rp; rp.inSort(new port(conf->readEntry("Port", "6667"))); - QString password = decryptPassword(conf->readEntry("Password")); + TQString password = decryptPassword(conf->readEntry("Password")); bool ssl = conf->readBoolEntry("SSL"); Groups.insert(0, new Server(i18n("Recent"), *it, rp, i18n("Recent Server"), "", password, ssl)); } else { - QStringList info = QStringList::split(":", *it); + TQStringList info = TQStringList::split(":", *it); if (info.isEmpty()) continue; - QString name = info[0]; - QPtrList<port> rp; + TQString name = info[0]; + TQPtrList<port> rp; if (info.count() > 1) rp.inSort(new port(info[1])); else rp.inSort(new port("6667")); - QString password; + TQString password; if (info.count() > 2) password = decryptPassword(info[2]); @@ -107,24 +107,24 @@ open_ksirc::open_ksirc insertGroupList(); - QString blah = i18n("Recent"); + TQString blah = i18n("Recent"); setGroup(blah); - connect(ComboB_ServerGroup, SIGNAL(activated( const QString& )), - this, SLOT(setGroup( const QString& ))); - connect(ComboB_ServerName, SIGNAL(activated( const QString& )), - this, SLOT(setServer( const QString& ))); + connect(ComboB_ServerGroup, TQT_SIGNAL(activated( const TQString& )), + this, TQT_SLOT(setGroup( const TQString& ))); + connect(ComboB_ServerName, TQT_SIGNAL(activated( const TQString& )), + this, TQT_SLOT(setServer( const TQString& ))); - connect(PB_Connect, SIGNAL(clicked()), this, SLOT(clickConnect())); - connect(PB_Edit, SIGNAL(clicked()), this, SLOT(clickEdit())); - connect(PB_Cancel, SIGNAL(clicked()), this, SLOT(clickCancel())); + connect(PB_Connect, TQT_SIGNAL(clicked()), this, TQT_SLOT(clickConnect())); + connect(PB_Edit, TQT_SIGNAL(clicked()), this, TQT_SLOT(clickEdit())); + connect(PB_Cancel, TQT_SIGNAL(clicked()), this, TQT_SLOT(clickCancel())); PB_Connect->setDefault(TRUE); PB_Connect->setAutoDefault(TRUE); PB_Edit->setEnabled(false); // Not yet implemented. ComboB_ServerName->setFocus(); - connect(ComboB_ServerName, SIGNAL(enterPressed()), this, SLOT(clickConnect())); + connect(ComboB_ServerName, TQT_SIGNAL(enterPressed()), this, TQT_SLOT(clickConnect())); } // insert a sorted list of groups into ComboB_ServerGroup, note that @@ -133,7 +133,7 @@ open_ksirc::open_ksirc void open_ksirc::insertGroupList() { - QStrList tempgroups; + TQStrList tempgroups; Server *serv; for ( serv=Groups.first(); serv != 0; serv=Groups.next() ) { @@ -154,7 +154,7 @@ void open_ksirc::insertGroupList() void open_ksirc::insertServerList( const char * group ) { - QListBox *newListBox = new QListBox(); + TQListBox *newListBox = new TQListBox(); Server *serv; for ( serv=Groups.first(); serv != 0; serv=Groups.next() ) { @@ -174,11 +174,11 @@ void open_ksirc::insertServerList( const char * group ) // note that this only takes the first occurrance if there is two // entiies with the same server. -void open_ksirc::setServer( const QString &serveraddress ) +void open_ksirc::setServer( const TQString &serveraddress ) { - QListBox *newListBox = new QListBox(); + TQListBox *newListBox = new TQListBox(); Server *serv; - QPtrList<port> portlist; + TQPtrList<port> portlist; port *p; bool defaultport = FALSE; @@ -209,7 +209,7 @@ void open_ksirc::setServer( const QString &serveraddress ) // Sets the server description if the isn't one set it to "Not Available" -void open_ksirc::setServerDesc( QString description ) +void open_ksirc::setServerDesc( TQString description ) { if (description.isNull() || description.isEmpty()) { Label_ServerDesc->setText( i18n("Not available")); @@ -224,34 +224,34 @@ void open_ksirc::setServerDesc( QString description ) // and then each byte of the UTF-8 password is xored with the corresponding // byte of the random string. The returned value is a base64 encoding of // that random string followed by the scrambled password. -QString open_ksirc::encryptPassword( const QString &password ) +TQString open_ksirc::encryptPassword( const TQString &password ) { - QCString utf8 = password.utf8(); + TQCString utf8 = password.utf8(); // Can contain NULL bytes after XORing unsigned int utf8Length(utf8.length()); - QByteArray result(utf8Length << 1); + TQByteArray result(utf8Length << 1); memcpy(result.data(), kapp->randomString(utf8Length).latin1(), utf8Length); for (unsigned int i = 0; i < utf8Length; ++i) result[i + utf8Length] = utf8[i] ^ result[i]; - return QString::fromLatin1(KCodecs::base64Encode(result)); + return TQString::fromLatin1(KCodecs::base64Encode(result)); } -QString open_ksirc::decryptPassword( const QString &scrambled ) +TQString open_ksirc::decryptPassword( const TQString &scrambled ) { - QByteArray base64, orig; + TQByteArray base64, orig; base64.duplicate(scrambled.latin1(), scrambled.length()); KCodecs::base64Decode(base64, orig); - QCString result; + TQCString result; for (unsigned int i = 0; i < (orig.size() >> 1); ++i) result += orig[i] ^ orig[i + (orig.size() >> 1)]; - return QString::fromUtf8(result); + return TQString::fromUtf8(result); } -void open_ksirc::setGroup( const QString &group ) +void open_ksirc::setGroup( const TQString &group ) { insertServerList( group ); if (ComboB_ServerName->count() > 0) { - QString blah = QString(ComboB_ServerName->text( 0 )); + TQString blah = TQString(ComboB_ServerName->text( 0 )); setServer(blah); } else { setServerDesc( "" ); @@ -272,9 +272,9 @@ void open_ksirc::clickConnect() return; } - QString server; - QString port; - QString script; + TQString server; + TQString port; + TQString script; Server *serv; KConfig *conf = kapp->config(); @@ -296,7 +296,7 @@ void open_ksirc::clickConnect() if(port.isEmpty()) port = "6667"; - QString plain, scrambled; + TQString plain, scrambled; if (!LineE_Password->text().isEmpty()) { plain = LineE_Password->text(); @@ -306,9 +306,9 @@ void open_ksirc::clickConnect() conf->setGroup("ServerList"); conf->writeEntry("StorePasswords", CheckB_StorePassword->isChecked()); - QStringList recent = conf->readListEntry("RecentServers"); + TQStringList recent = conf->readListEntry("RecentServers"); if(recent.contains(server)){ - QStringList::Iterator it = recent.find(server); + TQStringList::Iterator it = recent.find(server); recent.remove(it); } @@ -320,10 +320,10 @@ void open_ksirc::clickConnect() //scrambled is now "server:port" or "server:port:scrambledpass" if //a password was given and "store password" is checked - for (QStringList::Iterator it = recent.begin(); it != recent.end(); ) { + for (TQStringList::Iterator it = recent.begin(); it != recent.end(); ) { if ((*it).startsWith(server)) // ignore password { - QStringList::Iterator del = it++; + TQStringList::Iterator del = it++; recent.remove(del); } else @@ -362,7 +362,7 @@ void open_ksirc::clickEdit() // TODO open new server editor } -void open_ksirc::passwordChanged( const QString& password ) +void open_ksirc::passwordChanged( const TQString& password ) { CheckB_StorePassword->setEnabled( !password.isEmpty() ); } |