]> vaikene.ee Git - evaf/blobdiff - src/libs/Common/registry.cpp
Numeric character and character entity references are now also supported when convert...
[evaf] / src / libs / Common / registry.cpp
index c0f9cae9e1f4e4330213f20d3d6a758fc044e447..661d2c7d6717d2ad9bd1f43768a3679fb38b96d3 100644 (file)
@@ -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<QObject>(obj));
+    mInterfaces.insert(name, QWeakPointer<QObject>(obj));
+
+    return true;
 }
 
-QObject * Registry::queryInterface(QString const & name)
+QObject * Registry::queryInterface(QString const & name) const
 {
-    QHash<QString, QPointer<QObject> >::const_iterator it = mInterfaces.constFind(name);
-    return it != mInterfaces.constEnd() ? *it : 0;
+    QHash<QString, QWeakPointer<QObject> >::const_iterator it = mInterfaces.constFind(name);
+    return it != mInterfaces.constEnd() ? (*it).data() : 0;
 }