Selaa lähdekoodia

Changed hash function for ctkServiceReference objects.

Sascha Zelzer 14 vuotta sitten
vanhempi
commit
1175414a4f

+ 1 - 1
Libs/PluginFramework/ctkServiceReference.cpp

@@ -131,7 +131,7 @@ ctkServiceReference& ctkServiceReference::operator=(const ctkServiceReference& r
 
 uint qHash(const ctkServiceReference& serviceRef)
 {
-  return qHash(serviceRef.getProperty(ctkPluginConstants::SERVICE_ID).toLongLong());
+  return qHash(serviceRef.d_func()->registration);
 }
 
 QDebug operator<<(QDebug dbg, const ctkServiceReference& serviceRef)

+ 2 - 0
Libs/PluginFramework/ctkServiceReference.h

@@ -183,6 +183,8 @@ protected:
   template<class S, class T> friend class ctkServiceTrackerPrivate;
   template<class S, class R, class T> friend class ctkPluginAbstractTracked;
 
+  friend uint qHash(const ctkServiceReference&);
+
   ctkServiceReference(ctkServiceRegistrationPrivate* reg);
 
   ctkServiceReferencePrivate * d_ptr;