diff options
Diffstat (limited to 'ksirc/ksircprocess.cpp')
-rw-r--r-- | ksirc/ksircprocess.cpp | 132 |
1 files changed, 66 insertions, 66 deletions
diff --git a/ksirc/ksircprocess.cpp b/ksirc/ksircprocess.cpp index 1fff6807..26dbc8c7 100644 --- a/ksirc/ksircprocess.cpp +++ b/ksirc/ksircprocess.cpp @@ -15,7 +15,7 @@ server: is the name of the server to connect to. It must be provided or else start sirc will barf. :( parent: parent window, this _should_ be null - name: name, passed to QObject... + name: name, passed to TQObject... ~KSirProcess: kill the sirc process, and iocontrollller, emit delete_toplevel @@ -105,7 +105,7 @@ #include <stdlib.h> #include <time.h> -#include <qtimer.h> +#include <tqtimer.h> #include <kapplication.h> #include <kconfig.h> #include <kdebug.h> @@ -117,8 +117,8 @@ extern DisplayMgr *displayMgr; -KSircProcess::KSircProcess( QString &server_id, KSircServer &kss, QObject * parent, const char * name ) - : QObject(parent, name), m_kss(kss), m_serverid(server_id) +KSircProcess::KSircProcess( TQString &server_id, KSircServer &kss, TQObject * parent, const char * name ) + : TQObject(parent, name), m_kss(kss), m_serverid(server_id) { proc = new KProcess(); @@ -130,7 +130,7 @@ KSircProcess::KSircProcess( QString &server_id, KSircServer &kss, QObject * pare //server = qstrdup(kss.server()); - QDict<KSircMessageReceiver> nTopList(17, FALSE); + TQDict<KSircMessageReceiver> nTopList(17, FALSE); TopList = nTopList; // TopList.setAutoDelete(TRUE) @@ -140,7 +140,7 @@ KSircProcess::KSircProcess( QString &server_id, KSircServer &kss, QObject * pare ksopts->serverSetup(kss); // Setup the environment for KSirc - QString qsNick, qsRealname, qsUserID, qsAltNick; + TQString qsNick, qsRealname, qsUserID, qsAltNick; KConfig *kConfig = kapp->config(); kConfig->setGroup("StartUp"); qsNick = ksopts->serv(kss).nick; @@ -168,7 +168,7 @@ KSircProcess::KSircProcess( QString &server_id, KSircServer &kss, QObject * pare proc->setEnvironment("SIRCLIB", KGlobal::dirs()->findResourceDir("appdata", "ksirc.pl")); proc->setEnvironment("SIRCWAIT", "1"); - QString env = locate("appdata", "ksircrc"); + TQString env = locate("appdata", "ksircrc"); if (!env.isEmpty()) proc->setEnvironment("SIRCRC", env); env = locate("appdata", "ksircrc.pl"); @@ -178,7 +178,7 @@ KSircProcess::KSircProcess( QString &server_id, KSircServer &kss, QObject * pare // Setup the proc now, so iocontroller can use it. It's latter // though. started bellow though. - proc->setName(QCString(name) + "_kprocess"); + proc->setName(TQCString(name) + "_kprocess"); objFinder::insert(proc); // insertChild(proc); @@ -187,7 +187,7 @@ KSircProcess::KSircProcess( QString &server_id, KSircServer &kss, QObject * pare // Fixes 47157. proc->setEnvironment( "SIRCSERVER", "[" + kss.server() + "]:" + kss.port() + ":" + kss.password()); - QString sslopt; + TQString sslopt; if(kss.usessl()) sslopt = "-S"; *proc << "perl" << KGlobal::dirs()->findExe("dsirc") << "-8" << "-r" << sslopt; @@ -195,7 +195,7 @@ KSircProcess::KSircProcess( QString &server_id, KSircServer &kss, QObject * pare // Finally start the iocontroller. iocontrol = new KSircIOController(proc, this); - iocontrol->setName(QCString(name) + "_iocontrol"); + iocontrol->setName(TQCString(name) + "_iocontrol"); // Create toplevel before iocontroller so it has somewhere to write stuff. @@ -215,22 +215,22 @@ KSircProcess::KSircProcess( QString &server_id, KSircServer &kss, QObject * pare KSircIODCC *dcc = new KSircIODCC(this); TopList.insert("!dcc", dcc); dcc = static_cast<KSircIODCC *>( TopList["!dcc"] ); // g++ bug - connect(dcc, SIGNAL(outputLine(QCString)), - iocontrol, SLOT(stdin_write(QCString))); + connect(dcc, TQT_SIGNAL(outputLine(TQCString)), + iocontrol, TQT_SLOT(stdin_write(TQCString))); KSircIOLAG *lag = new KSircIOLAG(this); TopList.insert("!lag", lag); lag = static_cast<KSircIOLAG*>( TopList["!lag"] ); // g++ bug! - connect(lag, SIGNAL(outputLine(QCString)), - iocontrol, SLOT(stdin_write(QCString))); + connect(lag, TQT_SIGNAL(outputLine(TQCString)), + iocontrol, TQT_SLOT(stdin_write(TQCString))); KSircIONotify *notify = new KSircIONotify(this); TopList.insert("!notify", notify); notify = static_cast<KSircIONotify *>( TopList["!notify"] ); // g++ bug - connect(notify, SIGNAL(notify_online(QString)), - this, SLOT(notify_forw_online(QString))); - connect(notify, SIGNAL(notify_offline(QString)), - this, SLOT(notify_forw_offline(QString))); + connect(notify, TQT_SIGNAL(notify_online(TQString)), + this, TQT_SLOT(notify_forw_online(TQString))); + connect(notify, TQT_SIGNAL(notify_offline(TQString)), + this, TQT_SLOT(notify_forw_offline(TQString))); TopList.insert("!base_rules", new KSMBaseRules(this)); @@ -239,10 +239,10 @@ KSircProcess::KSircProcess( QString &server_id, KSircServer &kss, QObject * pare proc->start(KProcess::NotifyOnExit, KProcess::All); // Intial commands to load ASAP. // turn on sirc ssfe mode - QCString command = "/eval $ssfe=1\n"; + TQCString command = "/eval $ssfe=1\n"; iocontrol->stdin_write(command); - command = "/eval $version .= \"+KSIRC/" + QCString(KSIRC_VERSION) + "\"\n"; + command = "/eval $version .= \"+KSIRC/" + TQCString(KSIRC_VERSION) + "\"\n"; iocontrol->stdin_write(command); command = "/load " + locate("appdata", "filters.pl").local8Bit() + "\n"; iocontrol->stdin_write(command); @@ -279,11 +279,11 @@ KSircProcess::~KSircProcess() cleanup(); } -QPtrList<KSircMessageReceiver> KSircProcess::messageReceivers() const +TQPtrList<KSircMessageReceiver> KSircProcess::messageReceivers() const { - QPtrList<KSircMessageReceiver> res; + TQPtrList<KSircMessageReceiver> res; res.setAutoDelete( false ); - QDictIterator<KSircMessageReceiver> it( TopList ); + TQDictIterator<KSircMessageReceiver> it( TopList ); for (; it.current(); ++it ) if ( it.currentKey() != "!default" && it.currentKey() != "!no_channel" ) @@ -291,7 +291,7 @@ QPtrList<KSircMessageReceiver> KSircProcess::messageReceivers() const return res; } -const QDict<KSircMessageReceiver> &KSircProcess::mrList() const +const TQDict<KSircMessageReceiver> &KSircProcess::mrList() const { return TopList; } @@ -305,12 +305,12 @@ void KSircProcess::cleanup() TopList.setAutoDelete(true); TopList.clear(); - emit ProcMessage(m_serverid, ProcCommand::procClose, QString()); + emit ProcMessage(m_serverid, ProcCommand::procClose, TQString()); // Do closing down commands, this should release all puke widgets #if 0 dsirc does this on SIGTERM (malte) - QString quit_cmd = "/eval &dohooks(\"quit\");\n"; + TQString quit_cmd = "/eval &dohooks(\"quit\");\n"; proc->writeStdin(quit_cmd.ascii(), quit_cmd.length()); sleep(1); #endif @@ -358,7 +358,7 @@ void KSircProcess::new_toplevel(const KSircChannel &channelInfo, bool safe) i18n("Flood Warning"), i18n("Turn Off"), i18n("Keep Enabled")); switch(res) { case KMessageBox::Yes: - emit ProcMessage(serverID(), ProcCommand::turnOffAutoCreate, QString()); + emit ProcMessage(serverID(), ProcCommand::turnOffAutoCreate, TQString()); } last_window_open = current_time; number_open = 0; @@ -383,20 +383,20 @@ void KSircProcess::new_toplevel(const KSircChannel &channelInfo, bool safe) // Connect needed signals. For a message window we never want it // becomming the default so we ignore focusIn events into it. - connect(wm, SIGNAL(outputLine(QCString)), - iocontrol, SLOT(stdin_write(QCString))); - connect(wm, SIGNAL(open_toplevel(const KSircChannel &)), - this,SLOT(new_toplevel (const KSircChannel &))); - connect(wm, SIGNAL(closing(KSircTopLevel *, QString)), - this,SLOT(close_toplevel(KSircTopLevel *, QString))); - connect(wm, SIGNAL(currentWindow(KSircTopLevel *)), - this,SLOT(default_window(KSircTopLevel *))); - connect(wm, SIGNAL(changeChannel(const QString &, const QString &)), - this,SLOT(recvChangeChannel(const QString &, const QString &))); - connect(wm, SIGNAL(destroyed(QObject *)), - this,SLOT(clean_toplevel(QObject *))); - connect( wm, SIGNAL( requestQuit( const QCString& ) ), - SLOT( request_quit( const QCString& ) ) ); + connect(wm, TQT_SIGNAL(outputLine(TQCString)), + iocontrol, TQT_SLOT(stdin_write(TQCString))); + connect(wm, TQT_SIGNAL(open_toplevel(const KSircChannel &)), + this,TQT_SLOT(new_toplevel (const KSircChannel &))); + connect(wm, TQT_SIGNAL(closing(KSircTopLevel *, TQString)), + this,TQT_SLOT(close_toplevel(KSircTopLevel *, TQString))); + connect(wm, TQT_SIGNAL(currentWindow(KSircTopLevel *)), + this,TQT_SLOT(default_window(KSircTopLevel *))); + connect(wm, TQT_SIGNAL(changeChannel(const TQString &, const TQString &)), + this,TQT_SLOT(recvChangeChannel(const TQString &, const TQString &))); + connect(wm, TQT_SIGNAL(destroyed(TQObject *)), + this,TQT_SLOT(clean_toplevel(TQObject *))); + connect( wm, TQT_SIGNAL( requestQuit( const TQCString& ) ), + TQT_SLOT( request_quit( const TQCString& ) ) ); default_window(wm); // Set it to the default window. emit ProcMessage(serverID(), ProcCommand::addTopLevel, channelInfo.channel()); @@ -407,13 +407,13 @@ void KSircProcess::new_toplevel(const KSircChannel &channelInfo, bool safe) wm->lineEdit()->setFocus(); // Give focus back to the linee, someone takes it away on new create } else { - QWidget *w = dynamic_cast<QWidget *>(TopList.find(channelInfo.channel())); + TQWidget *w = dynamic_cast<TQWidget *>(TopList.find(channelInfo.channel())); if(w) displayMgr->raise(w); } } -void KSircProcess::close_toplevel(KSircTopLevel *wm, QString name) +void KSircProcess::close_toplevel(KSircTopLevel *wm, TQString name) { if(auto_create_really == TRUE) turn_on_autocreate(); @@ -423,7 +423,7 @@ void KSircProcess::close_toplevel(KSircTopLevel *wm, QString name) // the removeTopLevel below also deletes the mditoplevel (in case // we are using mdi) , which deletes its children, which deletes // 'wm' , so watch out not to delete twice! (Simon) - QGuardedPtr<KSircTopLevel> guardedwm = wm; + TQGuardedPtr<KSircTopLevel> guardedwm = wm; // Do this now or we get junk left on the screen displayMgr->removeTopLevel(wm); @@ -436,13 +436,13 @@ void KSircProcess::close_toplevel(KSircTopLevel *wm, QString name) // So let's go grab a default, and make sure it's not "!" control // object. - QDictIterator<KSircMessageReceiver> it(TopList); + TQDictIterator<KSircMessageReceiver> it(TopList); for(;it.current() && it.currentKey().startsWith("!"); ++it); if (!it.current()) { // No top-level windows left. - QCString command = "/quit\n"; // "/signoff" ? + TQCString command = "/quit\n"; // "/signoff" ? iocontrol->stdin_write(command); // kill sirc kdDebug(5008) << "KSP closing: " << m_kss.server() << endl; delete guardedwm; @@ -456,8 +456,8 @@ void KSircProcess::close_toplevel(KSircTopLevel *wm, QString name) // Let's let em know she's deleted! if(ksopts->autoCreateWin == TRUE){ - emit ProcMessage(serverID(), ProcCommand::turnOffAutoCreate, QString()); - QTimer::singleShot(5000, this, SLOT(turn_on_autocreate())); + emit ProcMessage(serverID(), ProcCommand::turnOffAutoCreate, TQString()); + TQTimer::singleShot(5000, this, TQT_SLOT(turn_on_autocreate())); auto_create_really = TRUE; } else{ @@ -468,7 +468,7 @@ void KSircProcess::close_toplevel(KSircTopLevel *wm, QString name) emit ProcMessage(serverID(), ProcCommand::deleteTopLevel, name); } -void KSircProcess::clean_toplevel(QObject *clean){ +void KSircProcess::clean_toplevel(TQObject *clean){ if(!clean){ qWarning("Passed null to cleaner!!"); return; @@ -476,10 +476,10 @@ void KSircProcess::clean_toplevel(QObject *clean){ bool cont = FALSE; do{ cont = FALSE; - QDictIterator<KSircMessageReceiver> it(TopList); + TQDictIterator<KSircMessageReceiver> it(TopList); while(it.current() != 0x0){ - if((QObject *)it.current() == clean){ - QString key = it.currentKey(); + if((TQObject *)it.current() == clean){ + TQString key = it.currentKey(); while(TopList[key] != 0x0){ TopList.remove(key); } @@ -491,22 +491,22 @@ void KSircProcess::clean_toplevel(QObject *clean){ } while(cont == TRUE); } -void KSircProcess::request_quit( const QCString& command ) +void KSircProcess::request_quit( const TQCString& command ) { iocontrol->stdin_write( command ); // Since removing the toplevels will delete the one that emitted this // signal as well, we need to defer this a little (malte) - QTimer::singleShot( 0, this, SLOT( do_quit() ) ); + TQTimer::singleShot( 0, this, TQT_SLOT( do_quit() ) ); } void KSircProcess::do_quit() { - for ( QDictIterator< KSircMessageReceiver > it( TopList ); it.current(); ++it ) + for ( TQDictIterator< KSircMessageReceiver > it( TopList ); it.current(); ++it ) { if ( it.currentKey() == "!default" ) continue; if ( KSircTopLevel* topLevel = dynamic_cast< KSircTopLevel* >( it.current() ) ) { - QGuardedPtr< KSircTopLevel > guardedTL = topLevel; + TQGuardedPtr< KSircTopLevel > guardedTL = topLevel; displayMgr->removeTopLevel( topLevel ); delete guardedTL; } @@ -530,7 +530,7 @@ void KSircProcess::default_window(KSircTopLevel *w) } -void KSircProcess::recvChangeChannel(const QString &old_chan, const QString &new_chan) +void KSircProcess::recvChangeChannel(const TQString &old_chan, const TQString &new_chan) { // // Channel changed name, add our own name and off we go. @@ -551,10 +551,10 @@ void KSircProcess::recvChangeChannel(const QString &old_chan, const QString &new void KSircProcess::filters_update() { - QString command, next_part, key, data; + TQString command, next_part, key, data; command = "/crule\n"; iocontrol->stdin_write(command.ascii()); - QDictIterator<KSircMessageReceiver> it(TopList); + TQDictIterator<KSircMessageReceiver> it(TopList); KSircMessageReceiver *cur, *br; filterRuleList *frl; filterRule *fr; @@ -605,17 +605,17 @@ void KSircProcess::filters_update() } -void KSircProcess::notify_forw_online(QString nick) +void KSircProcess::notify_forw_online(TQString nick) { emit ProcMessage(serverID(), ProcCommand::nickOnline, nick); } -void KSircProcess::notify_forw_offline(QString nick) +void KSircProcess::notify_forw_offline(TQString nick) { emit ProcMessage(serverID(), ProcCommand::nickOffline, nick); } -void KSircProcess::ServMessage(QString dst_server, int command, QString args) +void KSircProcess::ServMessage(TQString dst_server, int command, TQString args) { if(dst_server.isEmpty() || (dst_server == serverID())){ switch(command){ @@ -631,13 +631,13 @@ void KSircProcess::ServMessage(QString dst_server, int command, QString args) void KSircProcess::turn_on_autocreate() { - emit ProcMessage(serverID(), ProcCommand::turnOnAutoCreate, QString()); + emit ProcMessage(serverID(), ProcCommand::turnOnAutoCreate, TQString()); auto_create_really = FALSE; } -void KSircProcess::setNick(const QString nick) +void KSircProcess::setNick(const TQString nick) { - QString new_nick = nick; + TQString new_nick = nick; while (!new_nick.isEmpty() && (new_nick[0].latin1() == '@' || new_nick[0].latin1() == '*')) new_nick.remove(0, 1); @@ -653,7 +653,7 @@ void KSircProcess::setNick(const QString nick) } -const QString KSircProcess::getNick() const +const TQString KSircProcess::getNick() const { return m_nick; } |