diff options
Diffstat (limited to 'ksirc/KSOpenkSirc')
-rw-r--r-- | ksirc/KSOpenkSirc/enter_combo.cpp | 4 | ||||
-rw-r--r-- | ksirc/KSOpenkSirc/enter_combo.h | 24 | ||||
-rw-r--r-- | ksirc/KSOpenkSirc/open_ksirc.cpp | 100 | ||||
-rw-r--r-- | ksirc/KSOpenkSirc/open_ksirc.h | 16 | ||||
-rw-r--r-- | ksirc/KSOpenkSirc/serverDataType.h | 46 | ||||
-rw-r--r-- | ksirc/KSOpenkSirc/serverFileParser.cpp | 26 | ||||
-rw-r--r-- | ksirc/KSOpenkSirc/serverFileParser.h | 2 |
7 files changed, 109 insertions, 109 deletions
diff --git a/ksirc/KSOpenkSirc/enter_combo.cpp b/ksirc/KSOpenkSirc/enter_combo.cpp index 3394423d..197f8f21 100644 --- a/ksirc/KSOpenkSirc/enter_combo.cpp +++ b/ksirc/KSOpenkSirc/enter_combo.cpp @@ -1,10 +1,10 @@ #include "enter_combo.h" -void EnterCombo::keyPressEvent( QKeyEvent *e ){ +void EnterCombo::keyPressEvent( TQKeyEvent *e ){ if(e->key() == Key_Return || e->key() == Key_Enter) emit(enterPressed()); else - QComboBox::keyPressEvent(e); + TQComboBox::keyPressEvent(e); } #include "enter_combo.moc" diff --git a/ksirc/KSOpenkSirc/enter_combo.h b/ksirc/KSOpenkSirc/enter_combo.h index f0752a2d..7af88d8f 100644 --- a/ksirc/KSOpenkSirc/enter_combo.h +++ b/ksirc/KSOpenkSirc/enter_combo.h @@ -1,29 +1,29 @@ #ifndef ENTER_COMBO_H #define ENTER_COMBO_H -#include <qcombobox.h> -#include <qevent.h> -#include <qkeycode.h> -#include <qlineedit.h> +#include <tqcombobox.h> +#include <tqevent.h> +#include <tqkeycode.h> +#include <tqlineedit.h> #undef KeyPress // X headers... -class EnterCombo : public QComboBox { +class EnterCombo : public TQComboBox { Q_OBJECT public: - EnterCombo ( QWidget * parent=0, const char * name=0 ) - : QComboBox(TRUE, parent, name) + EnterCombo ( TQWidget * parent=0, const char * name=0 ) + : TQComboBox(TRUE, parent, name) { } - EnterCombo ( bool rw, QWidget * parent=0, const char * name=0 ) - : QComboBox(rw, parent, name) + EnterCombo ( bool rw, TQWidget * parent=0, const char * name=0 ) + : TQComboBox(rw, parent, name) { - QKeyEvent ke(QEvent::KeyPress, SHIFT|Key_Home, 0, 0); + TQKeyEvent ke(TQEvent::KeyPress, SHIFT|Key_Home, 0, 0); keyPressEvent(&ke); } virtual void show(){ - QComboBox::show(); + TQComboBox::show(); lineEdit()->selectAll(); } @@ -31,7 +31,7 @@ signals: void enterPressed(); protected: - virtual void keyPressEvent( QKeyEvent *e ); + virtual void keyPressEvent( TQKeyEvent *e ); }; #endif 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() ); } diff --git a/ksirc/KSOpenkSirc/open_ksirc.h b/ksirc/KSOpenkSirc/open_ksirc.h index 81145fca..29fb4f60 100644 --- a/ksirc/KSOpenkSirc/open_ksirc.h +++ b/ksirc/KSOpenkSirc/open_ksirc.h @@ -12,7 +12,7 @@ #include "open_ksircData.h" -#include <qdict.h> +#include <tqdict.h> class KSircServer; @@ -24,26 +24,26 @@ public: open_ksirc ( - QWidget* parent = NULL, + TQWidget* parent = NULL, const char* name = NULL ); virtual ~open_ksirc(); protected slots: - void setGroup( const QString& ); - void setServer( const QString& ); + void setGroup( const TQString& ); + void setServer( const TQString& ); void clickConnect(); void clickCancel(); void clickEdit(); - void passwordChanged( const QString& ); + void passwordChanged( const TQString& ); private: void insertGroupList(); void insertServerList( const char * ); - void setServerDesc( QString ); - QString encryptPassword( const QString & ); - QString decryptPassword( const QString & ); + void setServerDesc( TQString ); + TQString encryptPassword( const TQString & ); + TQString decryptPassword( const TQString & ); signals: // void open_ksircprocess( const char *, int, const char * ); diff --git a/ksirc/KSOpenkSirc/serverDataType.h b/ksirc/KSOpenkSirc/serverDataType.h index 80b94e27..157be09e 100644 --- a/ksirc/KSOpenkSirc/serverDataType.h +++ b/ksirc/KSOpenkSirc/serverDataType.h @@ -1,18 +1,18 @@ #ifndef SERVERDATATYPE_H #define SERVERDATATYPE_H -#include <qptrlist.h> -#include <qstring.h> +#include <tqptrlist.h> +#include <tqstring.h> class port { public: - port( const QString &portnum ) { p=portnum; } - QString portnum() const { return p; } + port( const TQString &portnum ) { p=portnum; } + TQString portnum() const { return p; } private: - QString p; + TQString p; }; @@ -21,12 +21,12 @@ class Server { public: - Server( const QString &group, - const QString &server, - QPtrList<port> ports, - const QString &serverdesc, - const QString &script, - const QString &password = QString::null, + Server( const TQString &group, + const TQString &server, + TQPtrList<port> ports, + const TQString &serverdesc, + const TQString &script, + const TQString &password = TQString::null, bool dossl = false ) { g=group; s=server; p=ports; sd=serverdesc; sc=script; @@ -34,21 +34,21 @@ public: ssl = dossl; p.setAutoDelete(TRUE); } - QString group() const { return g; } - QString server() const { return s; } - QPtrList<port> ports() const { return p; } - QString serverdesc() const { return sd; } - QString script() const { return sc; } - QString password() const { return pass; } + TQString group() const { return g; } + TQString server() const { return s; } + TQPtrList<port> ports() const { return p; } + TQString serverdesc() const { return sd; } + TQString script() const { return sc; } + TQString password() const { return pass; } bool usessl() const { return ssl; } private: - QString g; - QString s; - QPtrList<port> p; - QString sd; - QString sc; - QString pass; + TQString g; + TQString s; + TQPtrList<port> p; + TQString sd; + TQString sc; + TQString pass; bool ssl; }; diff --git a/ksirc/KSOpenkSirc/serverFileParser.cpp b/ksirc/KSOpenkSirc/serverFileParser.cpp index 8e6ba80e..10960650 100644 --- a/ksirc/KSOpenkSirc/serverFileParser.cpp +++ b/ksirc/KSOpenkSirc/serverFileParser.cpp @@ -1,12 +1,12 @@ #include "serverFileParser.h" #include "serverDataType.h" -#include <qfile.h> +#include <tqfile.h> #include <stdlib.h> #include <kstandarddirs.h> #include <kdebug.h> -extern QPtrList<Server> Groups; +extern TQPtrList<Server> Groups; // Opens, reads and parses server information from a server file, // sets the information in the global variable and returns 1 if @@ -16,30 +16,30 @@ int serverFileParser::readDatafile( const char *fileName ) { Groups.setAutoDelete( TRUE ); Groups.clear(); - QFile serverFile( fileName ); + TQFile serverFile( fileName ); if ( !serverFile.open( IO_ReadOnly ) ) return -1; - QTextStream fileStream(&serverFile); + TQTextStream fileStream(&serverFile); // the file is layed out as follows: // service:servername:serveraddress:ports:script: // so we parse it this way while( !fileStream.eof() ) { - QString str = fileStream.readLine(); + TQString str = fileStream.readLine(); const char *strC = str.ascii(); char *token; char groupC[1024], servernameC[1024], serveraddressC[1024], portsC[1024]; int pos = 0; - QString group; - QString servername; - QString serveraddress; - QPtrList<port> ports; - QString script; + TQString group; + TQString servername; + TQString serveraddress; + TQPtrList<port> ports; + TQString script; - QString buf; - QString portbuff; + TQString buf; + TQString portbuff; pos = sscanf(strC, "%1023[^:]:%1024[^:]:%1023[^:]:%1023[^:]:", groupC, servernameC, serveraddressC, portsC); if(pos != 4){ @@ -109,6 +109,6 @@ int serverFileParser::readDatafile( const char *fileName ) int writeDataFile() { - QString filename(KGlobal::dirs()->saveLocation("appdata")+"servers.txt"); + TQString filename(KGlobal::dirs()->saveLocation("appdata")+"servers.txt"); return 1; } diff --git a/ksirc/KSOpenkSirc/serverFileParser.h b/ksirc/KSOpenkSirc/serverFileParser.h index f3fd67e1..f17884c5 100644 --- a/ksirc/KSOpenkSirc/serverFileParser.h +++ b/ksirc/KSOpenkSirc/serverFileParser.h @@ -1,7 +1,7 @@ #ifndef serverFileParser_included #define serverFileParser_included -#include <qobject.h> +#include <tqobject.h> class serverFileParser { |