author | fliplap <fliplap> | 2003-07-22 05:38:38 (UTC) |
---|---|---|
committer | fliplap <fliplap> | 2003-07-22 05:38:38 (UTC) |
commit | 059af0e82a14a32f068c2ad943dc918afca93587 (patch) (side-by-side diff) | |
tree | 1e669194d65a5c9098434115f7b8e5ce3693b14d /noncore/net/opieirc/ircmessageparser.cpp | |
parent | d672a787dd122410063ac6cb721be8b5f8cd418e (diff) | |
download | opie-059af0e82a14a32f068c2ad943dc918afca93587.zip opie-059af0e82a14a32f068c2ad943dc918afca93587.tar.gz opie-059af0e82a14a32f068c2ad943dc918afca93587.tar.bz2 |
getting all my stuff syncd up. Fixed scroll issue, added commands
Diffstat (limited to 'noncore/net/opieirc/ircmessageparser.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opieirc/ircmessageparser.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/noncore/net/opieirc/ircmessageparser.cpp b/noncore/net/opieirc/ircmessageparser.cpp index e8d3b1a..6b88f34 100644 --- a/noncore/net/opieirc/ircmessageparser.cpp +++ b/noncore/net/opieirc/ircmessageparser.cpp @@ -66,33 +66,33 @@ void IRCMessageParser::parse(IRCMessage *message) { the parser tables. If no handler can be found, print out an error message */ if (message->isNumerical()) { for (int i=0; i<numericalParserProcTable[i].commandNumber; i++) { if (message->commandNumber() == numericalParserProcTable[i].commandNumber) { (this->*(numericalParserProcTable[i].proc))(message); return; } } - emit outputReady(IRCOutput(OUTPUT_ERROR, tr("Received unhandled numeric command : ")+QString::number(message->commandNumber()))); + emit outputReady(IRCOutput(OUTPUT_ERROR, tr("Received unhandled numeric command: %1").arg( QString::number(message->commandNumber()) ))); } else if (message->isCTCP()) { for (int i=0; ctcpParserProcTable[i].commandName; i++) { if (message->ctcpCommand() == ctcpParserProcTable[i].commandName) { (this->*(ctcpParserProcTable[i].proc))(message); return; } } - emit outputReady(IRCOutput(OUTPUT_ERROR, tr("Received unhandled ctcp command : ")+message->ctcpCommand())); + emit outputReady(IRCOutput(OUTPUT_ERROR, tr("Received unhandled ctcp command: %1").arg( message->ctcpCommand())) ); } else { for (int i=0; literalParserProcTable[i].commandName; i++) { if (message->command() == literalParserProcTable[i].commandName) { (this->*(literalParserProcTable[i].proc))(message); return; } } - emit outputReady(IRCOutput(OUTPUT_ERROR, tr("Received unhandled literal command : ")+message->command())); + emit outputReady(IRCOutput(OUTPUT_ERROR, tr("Received unhandled literal command: %1").arg( message->command()) )); } } void IRCMessageParser::nullFunc(IRCMessage *) { /* Do nothing */ } void IRCMessageParser::parseLiteralPing(IRCMessage *message) { @@ -123,17 +123,17 @@ void IRCMessageParser::parseLiteralJoin(IRCMessage *message) { IRCPerson *person = m_session->getPerson(mask.nick()); if (!person) { person = new IRCPerson(message->prefix()); m_session->addPerson(person); } chanperson->flags = 0; chanperson->person = person; channel->addPerson(chanperson); - IRCOutput output(OUTPUT_OTHERJOIN, mask.nick() + tr(" joined channel ") + channelName); + IRCOutput output(OUTPUT_OTHERJOIN ,tr("%1 joined channel %2").arg( mask.nick() ).arg( channelName )); output.addParam(channel); output.addParam(chanperson); emit outputReady(output); } else { emit outputReady(IRCOutput(OUTPUT_ERROR, tr("Person has already joined the channel - desynchronized?"))); } } else { emit outputReady(IRCOutput(OUTPUT_ERROR, tr("You already joined the channel - desynchronized?"))); @@ -143,25 +143,25 @@ void IRCMessageParser::parseLiteralJoin(IRCMessage *message) { void IRCMessageParser::parseLiteralPart(IRCMessage *message) { QString channelName = message->param(0).lower(); IRCChannel *channel = m_session->getChannel(channelName); IRCPerson mask(message->prefix()); if (channel) { if (mask.nick() == m_session->m_server->nick()) { m_session->removeChannel(channel); - IRCOutput output(OUTPUT_SELFPART, tr("You left channel ") + channelName); + IRCOutput output(OUTPUT_SELFPART, tr("You left channel %1").arg( channelName )); output.addParam(channel); emit outputReady(output); delete channel; } else { IRCChannelPerson *person = channel->getPerson(mask.nick()); if (person) { channel->removePerson(person); - IRCOutput output(OUTPUT_OTHERPART, mask.nick() + tr(" left channel ") + channelName); + IRCOutput output(OUTPUT_OTHERPART, tr("%1 left channel %2").arg( mask.nick() ).arg( channelName) ); output.addParam(channel); output.addParam(person); emit outputReady(output); delete person; } else { emit outputReady(IRCOutput(OUTPUT_ERROR, tr("Parting person not found - desynchronized?"))); } } @@ -193,37 +193,37 @@ void IRCMessageParser::parseLiteralPrivMsg(IRCMessage *message) { IRCOutput output(OUTPUT_CHANPRIVMSG, message->param(1)); output.addParam(channel); output.addParam(person); emit outputReady(output); } else { emit outputReady(IRCOutput(OUTPUT_ERROR, tr("Channel message with unknown sender"))); } } else { - emit outputReady(IRCOutput(OUTPUT_ERROR, tr("Channel message with unknown channel ") + message->param(0).lower())); + emit outputReady(IRCOutput(OUTPUT_ERROR, tr("Channel message with unknown channel %1").arg(message->param(0).lower()) )); } } else { emit outputReady(IRCOutput(OUTPUT_ERROR, tr("Received PRIVMSG of unknown type"))); } } void IRCMessageParser::parseLiteralNick(IRCMessage *message) { IRCPerson mask(message->prefix()); if (mask.nick() == m_session->m_server->nick()) { /* We are changing our nickname */ m_session->m_server->setNick(message->param(0)); - IRCOutput output(OUTPUT_NICKCHANGE, tr("You are now known as ")+message->param(0)); + IRCOutput output(OUTPUT_NICKCHANGE, tr("You are now known as %1").arg( message->param(0))); output.addParam(0); emit outputReady(output); } else { /* Someone else is */ IRCPerson *person = m_session->getPerson(mask.nick()); if (person) { - IRCOutput output(OUTPUT_NICKCHANGE, mask.nick() + tr(" is now known as ") + message->param(0)); + IRCOutput output(OUTPUT_NICKCHANGE, tr("%1 is now known as %2").arg( mask.nick() ).arg( message->param(0 ))); output.addParam(person); emit outputReady(output); } else { emit outputReady(IRCOutput(OUTPUT_ERROR, tr("Nickname change of an unknown person"))); } } } @@ -235,17 +235,17 @@ void IRCMessageParser::parseLiteralQuit(IRCMessage *message) { m_session->getChannelsByPerson(person, channels); QListIterator<IRCChannel> it(channels); for (;it.current(); ++it) { IRCChannelPerson *chanperson = it.current()->getPerson(mask.nick()); it.current()->removePerson(chanperson); delete chanperson; } m_session->removePerson(person); - IRCOutput output(OUTPUT_QUIT, mask.nick() + tr(" has quit ") + "(" + message->param(0) + ")"); + IRCOutput output(OUTPUT_QUIT, tr("%1 has quit (%2)" ).arg( mask.nick() ).arg( message->param(0) )); output.addParam(person); emit outputReady(output); delete person; } else { emit outputReady(IRCOutput(OUTPUT_ERROR, tr("Unknown person quit - desynchronized?"))); } } |