Memory Management Improved
[pierogi] / keysets / logitech.cpp
index 0ac7f37..6f20278 100644 (file)
@@ -2,13 +2,24 @@
 #include "protocols/necprotocol.h"
 
 LogitechSpeakers::LogitechSpeakers(
-  QObject *guiObject,
   unsigned int index)
   : PIRKeysetMetaData(
       "Digital Speakers Keyset",
       Logitech_Make,
       index)
 {
+}
+
+
+void LogitechSpeakers::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // If the pointer is not null, the keyset must already be populated.
+    return;
+  }
+
   threadableProtocol = new NECProtocol(guiObject, index, false, true);
 
   setPreData(0x08, 8);