X-Git-Url: https://vaikene.ee/gitweb/pswgen09.html?a=blobdiff_plain;f=src%2Flibs%2FCommon%2Fregistry.cpp;h=661d2c7d6717d2ad9bd1f43768a3679fb38b96d3;hb=38c2779e95311f1d9dac4a9d9469b0489b395333;hp=c0f9cae9e1f4e4330213f20d3d6a758fc044e447;hpb=688e916955a6b848dbbae1f65ae85a73593ed680;p=evaf
diff --git a/src/libs/Common/registry.cpp b/src/libs/Common/registry.cpp
index c0f9cae..661d2c7 100644
--- a/src/libs/Common/registry.cpp
+++ b/src/libs/Common/registry.cpp
@@ -41,7 +41,7 @@ using namespace eVaf::Common::Internal;
Registry::Registry()
: iRegistry()
{
- setObjectName(QString("%1-iRegistry").arg(VER_MODULENAME_STR));
+ setObjectName(QString("%1-iRegistry").arg(VER_MODULE_NAME_STR));
// Register our own interface
registerInterface("iRegistry", this);
@@ -54,11 +54,13 @@ Registry::~Registry()
bool Registry::registerInterface(QString const & name, QObject * obj)
{
- mInterfaces.insert(name, QPointer(obj));
+ mInterfaces.insert(name, QWeakPointer(obj));
+
+ return true;
}
-QObject * Registry::queryInterface(QString const & name)
+QObject * Registry::queryInterface(QString const & name) const
{
- QHash >::const_iterator it = mInterfaces.constFind(name);
- return it != mInterfaces.constEnd() ? *it : 0;
+ QHash >::const_iterator it = mInterfaces.constFind(name);
+ return it != mInterfaces.constEnd() ? (*it).data() : 0;
}