X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=protocols%2Firobotprotocol.cpp;fp=protocols%2Firobotprotocol.cpp;h=244b045370af5c68c86f5a49796d625bf0f7f596;hb=a755f0efc0ba10848d26e1aed7f9933ccdcbb59e;hp=c2ac7ab6247c9be8498bca8c5a3e8dca71d9ecbc;hpb=c368b9d2216660ed7541cad6919338a3538a644b;p=pierogi diff --git a/protocols/irobotprotocol.cpp b/protocols/irobotprotocol.cpp index c2ac7ab..244b045 100644 --- a/protocols/irobotprotocol.cpp +++ b/protocols/irobotprotocol.cpp @@ -51,8 +51,11 @@ void IRobotProtocol::startSendingCommand( // Do we even have this key defined? if (i == keycodes.end()) { - std::string s = "Tried to send a non-existent command.\n"; - throw PIRException(s); + QMutexLocker cifLocker(&commandIFMutex); + commandInFlight = false; + return; +// std::string s = "Tried to send a non-existent command.\n"; +// throw PIRException(s); } // construct the device: @@ -82,23 +85,26 @@ void IRobotProtocol::startSendingCommand( // Check whether we've been asked to stop: if (checkRepeatFlag()) { + break; +/* QMutexLocker cifLocker(&commandIFMutex); commandInFlight = false; return; +*/ } } ++repeatCount; } + + QMutexLocker cifLocker(&commandIFMutex); + commandInFlight = false; } catch (PIRException e) { // inform the gui: emit commandFailed(e.getError().c_str()); } - - QMutexLocker cifLocker(&commandIFMutex); - commandInFlight = false; }