diff options
author | Wolf Bergenheim <ext-wolf.2.bergenheim@nokia.com> | 2010-01-25 11:12:45 +0200 |
---|---|---|
committer | Wolf Bergenheim <ext-wolf.2.bergenheim@nokia.com> | 2010-01-25 11:12:45 +0200 |
commit | ca994fc17c8bdb66c64beaead40bc2727ea89468 (patch) | |
tree | f03b032af15c214610d84fe7f1dc99c726eff610 /src/resource.cpp | |
parent | 9f3e54044fd1e0c26153195f91889342a8425b7f (diff) |
Chaged Resource::type to be stored as a number instead of a string. Also
changed ResourceSet to store resources as a QVector instead of a QSet.
Diffstat (limited to 'src/resource.cpp')
-rw-r--r-- | src/resource.cpp | 27 |
1 files changed, 3 insertions, 24 deletions
diff --git a/src/resource.cpp b/src/resource.cpp index a54c8cf..72ac24e 100644 --- a/src/resource.cpp +++ b/src/resource.cpp @@ -2,9 +2,9 @@ using namespace ResourcePolicy; -Resource::Resource() : resourceType(InvalidResource), optional(false), shared(false) +Resource::Resource(enum ResourceType type) + : resourceType(type), optional(false), shared(false) { - identifier = (quint32)this; } Resource::~Resource() @@ -13,7 +13,7 @@ Resource::~Resource() Resource::Resource(const Resource &other) : resourceType(other.resourceType), optional(other.optional), - shared(other.shared), identifier(other.identifier) + shared(other.shared) { } @@ -22,7 +22,6 @@ Resource & Resource::operator=(const Resource &other) resourceType = other.resourceType; optional = other.optional; shared = other.shared; - identifier = other.identifier; return *this; } @@ -63,30 +62,10 @@ void Resource::setShared(bool shared) this->shared = shared; } -quint32 Resource::id() const -{ - return identifier; -} - -void Resource::setId(quint32 newId) -{ - identifier = newId; -} - bool Resource::operator==(const Resource &other) const { if(resourceType != other.resourceType) { return false; } - if((shared != other.shared) or - (optional != other.optional)) - { - return false; - } return true; } - -uint ResourcePolicy::qHash(const Resource & key) -{ - return (((key.type()<<1) + key.isShared()) << 1) + key.isOptional(); -} |