ButeoSynchronizationFramework
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 
31 namespace Buteo {
32 
35 {
36 public:
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  {
94  iLocalFields.append(new ProfileField(*localField));
95  }
96  foreach (const ProfileField *mergedField, aSource.iMergedFields)
97  {
98  iMergedFields.append(new ProfileField(*mergedField));
99  }
100 
101  foreach (Profile *p, aSource.iSubProfiles)
102  {
103  iSubProfiles.append(p->clone());
104  }
105 }
106 
108 {
109  qDeleteAll(iLocalFields);
110  iLocalFields.clear();
111  qDeleteAll(iMergedFields);
112  iMergedFields.clear();
113 
114  qDeleteAll(iSubProfiles);
115  iSubProfiles.clear();
116 }
117 
118 
119 
120 #endif // PROFILE_P_H
QList< const ProfileField * > iLocalFields
Local fields, that are not merged from sub-profiles.
Definition: Profile_p.h:65
This class represents a single profile, a collection of settings or data releated to some entity...
Definition: Profile.h:52
QMap< QString, QString > iLocalKeys
Local keys, that are not merged from sub-profiles.
Definition: Profile_p.h:59
This class represents a profile field.
Definition: ProfileField.h:48
QString iName
Profile name.
Definition: Profile_p.h:47
Definition: AccountsHelper.h:31
QString iType
Profile type.
Definition: Profile_p.h:50
ProfilePrivate()
Constructor.
Definition: Profile_p.h:78
virtual Profile * clone() const
Creates a clone of the profile.
Definition: Profile.cpp:104
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
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
bool iMerged
Is the profile merged created by merging from sub-profile.
Definition: Profile_p.h:56
~ProfilePrivate()
Destructor.
Definition: Profile_p.h:107
Private implementation class for Profile class.
Definition: Profile_p.h:34
Definition: SyncBackupAdaptor.h:40