summaryrefslogtreecommitdiff
path: root/libresourceqt/src/resource-set.cpp
diff options
context:
space:
mode:
authorWolf Bergenheim <ext-wolf.2.bergenheim@nokia.com>2010-02-11 11:21:01 +0200
committerWolf Bergenheim <ext-wolf.2.bergenheim@nokia.com>2010-02-11 11:21:01 +0200
commit346a7524047a1aa1ec64810abb8b0243ae90c3bb (patch)
treeff122182776b0a08bea4e5074d39ed3cd9a76416 /libresourceqt/src/resource-set.cpp
parent7fc9e4c25b87945487723e594bb5320bd253526f (diff)
downloadlibresourceqt-346a7524047a1aa1ec64810abb8b0243ae90c3bb.tar.gz
astyled the code
Diffstat (limited to 'libresourceqt/src/resource-set.cpp')
-rw-r--r--libresourceqt/src/resource-set.cpp27
1 files changed, 14 insertions, 13 deletions
diff --git a/libresourceqt/src/resource-set.cpp b/libresourceqt/src/resource-set.cpp
index f8f3826..93af954 100644
--- a/libresourceqt/src/resource-set.cpp
+++ b/libresourceqt/src/resource-set.cpp
@@ -3,8 +3,8 @@ using namespace ResourcePolicy;
ResourceSet::ResourceSet(const QString &applicationClass, QObject * parent)
- : QObject(parent), resourceClass(applicationClass), autoRelease(false),
- alwaysReply(false)
+ : QObject(parent), resourceClass(applicationClass), autoRelease(false),
+ alwaysReply(false)
{
identifier = (quint32)this;
@@ -13,7 +13,7 @@ ResourceSet::ResourceSet(const QString &applicationClass, QObject * parent)
ResourceSet::~ResourceSet()
{
- for(int i=0;i<NumberOfTypes;i++) {
+ for (int i = 0;i < NumberOfTypes;i++) {
delete resourceSet[i];
}
}
@@ -25,7 +25,7 @@ bool ResourceSet::finalize()
void ResourceSet::addResource(const Resource *resource)
{
- if((resource->type() == AudioPlaybackType) || (resource->type() == AudioRecorderType)) {
+ if ((resource->type() == AudioPlaybackType) || (resource->type() == AudioRecorderType)) {
qDebug("audioResource...");
}
resourceSet[resource->type()] = resource->clone();
@@ -33,14 +33,14 @@ void ResourceSet::addResource(const Resource *resource)
void ResourceSet::addResources(const QList<Resource *>resources)
{
- for(int i=0; i < resources.size(); i++) {
+ for (int i = 0; i < resources.size(); i++) {
addResource(resources.at(i));
}
}
void ResourceSet::delResource(ResourceType type)
{
- if(contains(type)) {
+ if (contains(type)) {
delete resourceSet[type];
resourceSet[type] = NULL;
}
@@ -48,7 +48,7 @@ void ResourceSet::delResource(ResourceType type)
bool ResourceSet::contains(ResourceType type) const
{
- if((type < NumberOfTypes) && (resourceSet[type] != NULL))
+ if ((type < NumberOfTypes) && (resourceSet[type] != NULL))
return true;
else
return false;
@@ -56,12 +56,13 @@ bool ResourceSet::contains(ResourceType type) const
bool ResourceSet::contains(const QList<ResourceType> &types) const
{
- bool containsAll=true;
- int i=0;
+ bool containsAll = true;
+ int i = 0;
do {
containsAll = contains(types.at(i));
i++;
- } while((i < types.size()) && containsAll);
+ }
+ while ((i < types.size()) && containsAll);
return containsAll;
}
@@ -73,8 +74,8 @@ quint32 ResourceSet::id() const
QList<Resource *> ResourceSet::resources() const
{
QList<Resource *> listOfResources;
- for(int i=0; i < NumberOfTypes; i++) {
- if(resourceSet[i] != NULL) {
+ for (int i = 0; i < NumberOfTypes; i++) {
+ if (resourceSet[i] != NULL) {
Resource *clone = resourceSet[i]->clone();
listOfResources.append(clone);
}
@@ -84,7 +85,7 @@ QList<Resource *> ResourceSet::resources() const
Resource * ResourceSet::resource(ResourceType type) const
{
- if(contains(type))
+ if (contains(type))
return resourceSet[type]->clone();
else
return NULL;