Преглед на файлове

Changed hash function for ctkServiceReference objects.

Sascha Zelzer преди 14 години
родител
ревизия
1175414a4f
променени са 2 файла, в които са добавени 3 реда и са изтрити 1 реда
  1. 1 1
      Libs/PluginFramework/ctkServiceReference.cpp
  2. 2 0
      Libs/PluginFramework/ctkServiceReference.h

+ 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;