X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fuserinputhandler.cpp;fp=src%2Fcore%2Fuserinputhandler.cpp;h=70db4342820fd28eb51e355dabd6a799b6968661;hp=15c89b2ae017da0d1befd79ed29f0bba6fec69dc;hb=44a6109557eafd29cc6079dd6521ad3cf80c15b3;hpb=9e531f113fbca51739ac6e2cf4eed7005b005c8f diff --git a/src/core/userinputhandler.cpp b/src/core/userinputhandler.cpp index 15c89b2a..70db4342 100644 --- a/src/core/userinputhandler.cpp +++ b/src/core/userinputhandler.cpp @@ -34,26 +34,22 @@ UserInputHandler::UserInputHandler(CoreNetwork *parent) } void UserInputHandler::handleUserInput(const BufferInfo &bufferInfo, const QString &msg_) { - try { - if(msg_.isEmpty()) - return; - QString cmd; - QString msg = msg_; - // leading slashes indicate there's a command to call unless there is another one in the first section (like a path /proc/cpuinfo) - int secondSlashPos = msg.indexOf('/', 1); - int firstSpacePos = msg.indexOf(' '); - if(!msg.startsWith('/') || (secondSlashPos != -1 && (secondSlashPos < firstSpacePos || firstSpacePos == -1))) { - if(msg.startsWith("//")) - msg.remove(0, 1); // //asdf is transformed to /asdf - cmd = QString("SAY"); - } else { - cmd = msg.section(' ', 0, 0).remove(0, 1).toUpper(); - msg = msg.section(' ', 1); - } - handle(cmd, Q_ARG(BufferInfo, bufferInfo), Q_ARG(QString, msg)); - } catch(Exception e) { - emit displayMsg(Message::Error, bufferInfo.type(), "", e.msg()); + if(msg_.isEmpty()) + return; + QString cmd; + QString msg = msg_; + // leading slashes indicate there's a command to call unless there is another one in the first section (like a path /proc/cpuinfo) + int secondSlashPos = msg.indexOf('/', 1); + int firstSpacePos = msg.indexOf(' '); + if(!msg.startsWith('/') || (secondSlashPos != -1 && (secondSlashPos < firstSpacePos || firstSpacePos == -1))) { + if(msg.startsWith("//")) + msg.remove(0, 1); // //asdf is transformed to /asdf + cmd = QString("SAY"); + } else { + cmd = msg.section(' ', 0, 0).remove(0, 1).toUpper(); + msg = msg.section(' ', 1); } + handle(cmd, Q_ARG(BufferInfo, bufferInfo), Q_ARG(QString, msg)); } // ====================