X-Git-Url: https://vaikene.ee/gitweb/pswgen11.html?a=blobdiff_plain;f=src%2Flibs%2FCommon%2Fregistry.h;h=3df7d58ac62526fae07086080ad984de3d082aed;hb=HEAD;hp=1046c485c798f8da67a8315d89a549306c7a39d0;hpb=688e916955a6b848dbbae1f65ae85a73593ed680;p=evaf diff --git a/src/libs/Common/registry.h b/src/libs/Common/registry.h index 1046c48..3df7d58 100644 --- a/src/libs/Common/registry.h +++ b/src/libs/Common/registry.h @@ -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 #include -#include #include 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 > mInterfaces; + typedef QHash 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); };