Search for Power Button Panel
[pierogi] / protocols / nokia32protocol.cpp
index 63c36ad..98b1aaf 100644 (file)
@@ -60,8 +60,11 @@ void Nokia32Protocol::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:
@@ -85,25 +88,28 @@ void Nokia32Protocol::startSendingCommand(
         // Check whether we've been asked to stop:
         if (checkRepeatFlag())
         {
+          break;
+/*
+          ++keypressCount;
           QMutexLocker cifLocker(&commandIFMutex);
           commandInFlight = false;
-          ++keypressCount;
           return;
+*/
         }
       }
 
       ++repeatCount;
     }
+
+    ++keypressCount;
+    QMutexLocker cifLocker(&commandIFMutex);
+    commandInFlight = false;
   }
   catch (PIRException e)
   {
     // inform the gui:
     emit commandFailed(e.getError().c_str());
   }
-
-  QMutexLocker cifLocker(&commandIFMutex);
-  commandInFlight = false;
-  ++keypressCount;
 }