Search for Power Button Panel
[pierogi] / protocols / daewooprotocol.cpp
index 24c71ff..9c02a87 100644 (file)
@@ -56,8 +56,11 @@ void DaewooProtocol::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:
@@ -81,23 +84,26 @@ void DaewooProtocol::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;
 }