]> vaikene.ee Git - evaf/blobdiff - src/libs/Common/registry.h
Warning fixes and copyright update.
[evaf] / src / libs / Common / registry.h
index 1046c485c798f8da67a8315d89a549306c7a39d0..3df7d58ac62526fae07086080ad984de3d082aed 100644 (file)
@@ -3,7 +3,7 @@
  * @brief Common registry implementation
  * @author Enar Vaikene
  *
- * Copyright (c) 2011 Enar Vaikene
+ * Copyright (c) 2011-2019 Enar Vaikene
  *
  * This file is part of the eVaf C++ cross-platform application development framework.
  *
@@ -24,7 +24,6 @@
 
 #include <QObject>
 #include <QString>
-#include <QPointer>
 #include <QHash>
 
 namespace eVaf {
@@ -35,7 +34,7 @@ namespace Internal {
  * iRegistry interface implementation.
  *
  * This class implements the global registry for interfaces. Interfaces are stored in a QHash container
- * and quarded with QPointer.
+ * and quarded with QWeakPointer.
  */
 class Registry : public iRegistry
 {
@@ -59,7 +58,15 @@ public:
 private:
 
     /// All the registered interfaces
-    QHash<QString, QPointer<QObject> > mInterfaces;
+    typedef QHash<QString, QObject *> Interfaces;
+    Interfaces mInterfaces;
+
+
+private slots:
+
+    /// Interface object destroyed
+    /// We need to remove the interface from the list of registered interfaces
+    void interfaceDestroyed(QObject * obj = nullptr);
 
 };