Buteo Synchronization Framework
Profile_p.h
1/*
2 * This file is part of buteo-syncfw package
3 *
4 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
5 *
6 * Contact: Sateesh Kavuri <sateesh.kavuri@nokia.com>
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public License
10 * version 2.1 as published by the Free Software Foundation.
11 *
12 * This library is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA
21 *
22 */
23#ifndef PROFILE_P_H
24#define PROFILE_P_H
25
26#include <QList>
27#include <QMap>
28#include <QString>
29#include "ProfileField.h"
30
31namespace Buteo {
32
35{
36public:
39
41 ProfilePrivate(const ProfilePrivate &aSource);
42
45
47 QString iName;
48
50 QString iType;
51
53 bool iLoaded;
54
56 bool iMerged;
57
60
63
66
69
72};
73}
74
75
76
77
79 : iLoaded(false),
80 iMerged(false)
81{
82}
83
85 : iName(aSource.iName),
86 iType(aSource.iType),
87 iLoaded(aSource.iLoaded),
88 iMerged(aSource.iMerged),
89 iLocalKeys(aSource.iLocalKeys),
90 iMergedKeys(aSource.iMergedKeys)
91{
92 foreach (const ProfileField *localField, aSource.iLocalFields) {
93 iLocalFields.append(new ProfileField(*localField));
94 }
95 foreach (const ProfileField *mergedField, aSource.iMergedFields) {
96 iMergedFields.append(new ProfileField(*mergedField));
97 }
98
99 foreach (Profile *p, aSource.iSubProfiles) {
100 iSubProfiles.append(p->clone());
101 }
102}
103
105{
106 qDeleteAll(iLocalFields);
107 iLocalFields.clear();
108 qDeleteAll(iMergedFields);
109 iMergedFields.clear();
110
111 qDeleteAll(iSubProfiles);
112 iSubProfiles.clear();
113}
114
115
116
117#endif // PROFILE_P_H
This class represents a profile field.
Definition: ProfileField.h:49
Private implementation class for Profile class.
Definition: Profile_p.h:35
QList< const ProfileField * > iLocalFields
Local fields, that are not merged from sub-profiles.
Definition: Profile_p.h:65
QList< const ProfileField * > iMergedFields
Fields that are merged from sub-profiles.
Definition: Profile_p.h:68
QMap< QString, QString > iMergedKeys
Keys that are merged from sub-profile files.
Definition: Profile_p.h:62
QMap< QString, QString > iLocalKeys
Local keys, that are not merged from sub-profiles.
Definition: Profile_p.h:59
ProfilePrivate()
Constructor.
Definition: Profile_p.h:78
~ProfilePrivate()
Destructor.
Definition: Profile_p.h:104
bool iMerged
Is the profile merged created by merging from sub-profile.
Definition: Profile_p.h:56
QString iName
Profile name.
Definition: Profile_p.h:47
bool iLoaded
Is the profile fully loaded and constructed.
Definition: Profile_p.h:53
QList< Profile * > iSubProfiles
List of sub-profiles.
Definition: Profile_p.h:71
QString iType
Profile type.
Definition: Profile_p.h:50
This class represents a single profile, a collection of settings or data releated to some entity.
Definition: Profile.h:53
virtual Profile * clone() const
Creates a clone of the profile.
Definition: Profile.cpp:97
Definition: SyncBackupAdaptor.h:40