SHARE
TWEET

Untitled

a guest May 19th, 2017 45 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. diff --git a/src/dao/contactdetailfield.h b/src/dao/contactdetailfield.h
  2. index 2e7a5ba..3270fc9 100644
  3. --- a/src/dao/contactdetailfield.h
  4. +++ b/src/dao/contactdetailfield.h
  5. @@ -70,6 +70,8 @@ typedef QList<ResourceInfoPtr>              ResourceInfoList;
  6.  typedef ResourceInfoList::const_iterator    ResourceInfoListConstIter;
  7.  
  8.  class ResourceInfo {
  9. +    Q_DISABLE_COPY(ResourceInfo);
  10. +
  11.  public:
  12.      enum Flags {
  13.          Default = 0,
  14. @@ -106,6 +108,8 @@ private:
  15.  
  16.  template<class Class>
  17.  class ClassInfo : public ResourceInfo {
  18. +    Q_DISABLE_COPY(ClassInfo);
  19. +
  20.  public:
  21.      explicit ClassInfo(const QString &name, Flags flags = Default) :
  22.          ResourceInfo(name, flags)
  23. @@ -117,6 +121,8 @@ public:
  24.  
  25.  template<class Class>
  26.  class InstanceInfo : public ResourceInfo {
  27. +    Q_DISABLE_COPY(InstanceInfo);
  28. +
  29.  public:
  30.      explicit InstanceInfo(const QString &name, Flags flags = Default) :
  31.          ResourceInfo(name, flags)
  32. @@ -128,7 +134,8 @@ public:
  33.  
  34.  class PropertyInfoBase : public ResourceInfo
  35.  {
  36. -public:
  37. +    Q_DISABLE_COPY(PropertyInfoBase);
  38. +
  39.  protected:
  40.      explicit PropertyInfoBase(const QString &name, Flags flags) :
  41.          ResourceInfo(name, flags)
  42. @@ -171,6 +178,8 @@ inline const PropertyInfoBase * ResourceInfo::propertyInfo() const
  43.  
  44.  template<class Class>
  45.  class PropertyInfo : public PropertyInfoBase {
  46. +    Q_DISABLE_COPY(PropertyInfo);
  47. +
  48.  public:
  49.      typedef typename Class::Domain Domain;
  50.      typedef typename Class::Range  Range;
  51. @@ -232,7 +241,8 @@ public:
  52.      template<class Resource>
  53.      QTrackerContactDetailField& addSubType(const QString &name)
  54.      {
  55. -        return addSubType<Resource>(typename Resource::ResourceType(), name);
  56. +        static typename Resource::ResourceType *const typeHint = 0;
  57. +        return addSubType<Resource>(typeHint, name);
  58.      }
  59.  
  60.      const ResourceInfoList& subTypes() const { return mSubTypes; }
  61. @@ -257,19 +267,17 @@ public:
  62.  
  63.  protected:
  64.      template<class Class>
  65. -    QTrackerContactDetailField& addSubType(const SopranoLive::Ontologies::rdfs::Resource &,
  66. +    QTrackerContactDetailField& addSubType(const SopranoLive::Ontologies::rdfs::Resource *const,
  67.                                             const QString &name)
  68.      {
  69. -        ResourceInfoPtr ptr(new ClassInfo<Class>(name));
  70. -        return mSubTypes.append(ptr), *this;
  71. +        return mSubTypes.append(new ClassInfo<Class>(name)), *this;
  72.      }
  73.  
  74.      template<class Property>
  75. -    QTrackerContactDetailField& addSubType(const SopranoLive::Ontologies::rdfs::Property &,
  76. +    QTrackerContactDetailField& addSubType(const SopranoLive::Ontologies::rdfs::Property *const,
  77.                                             const QString &name)
  78.      {
  79. -        ResourceInfoPtr ptr(new PropertyInfo<Property>(name));
  80. -        return mSubTypes.append(ptr), *this;
  81. +        return mSubTypes.append(new PropertyInfo<Property>(name)), *this;
  82.      }
  83.  
  84.  private:
RAW Paste Data
Challenge yourself this year...
Learn something new in 2017
Top