mercenary/testapp/testapp.cpp
Correl Roush 0381859219 Imported the QT4 IRC Client project, along with the mIRC script parser
that will eventually be integrated into it


git-svn-id: file:///srv/svn/ircclient/trunk@1 a9804ffe-773b-11dd-bd7c-89c3ef1d2733
2008-08-31 09:08:24 +00:00

38 lines
1.1 KiB
C++

#include "testapp.h"
TestApp::TestApp( int argc, char *argv[] ) : QCoreApplication( argc, argv ) {
irc = new IRCClient();
connect( irc->conn, SIGNAL( connected() ), this, SLOT( connected() ) );
connect( irc->conn, SIGNAL( disconnected() ), this, SLOT( disconnected() ) );
connect( irc, SIGNAL( registered() ), this, SLOT( registered() ) );
connect( irc, SIGNAL( sentRAW( QString ) ), this, SLOT( sent( QString ) ) );
connect( irc, SIGNAL( rcvdRAW( QString ) ), this, SLOT( rcvd( QString ) ) );
connect( irc, SIGNAL( debug( QString ) ), this, SLOT( debug( QString ) ) );
irc->connectAndRegister( argc > 1 ? argv[1] : "dev1", 6667, argc > 2 ? argv[2] : "Test", "correlr", "Correl Roush" );
}
void TestApp::connected() {
printf( "Connected!\n" );
}
void TestApp::registered() {
irc->join( "#pinet" );
}
void TestApp::disconnected() {
printf( "Disconnected.\n" );
}
void TestApp::sent( QString text ) {
printf( ">>> %s", (const char*)text.toLatin1() );
}
void TestApp::rcvd( QString text ) {
printf( "<<< %s", (const char*)text.toLatin1() );
}
void TestApp::debug( QString text ) {
printf( "DEBUG: %s\n", (const char*)text.toLatin1() );
}