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
73}
74
75
77 : iLoaded(false)
78 , iMerged(false)
79{
80}
81
83 : iName(aSource.iName)
84 , iType(aSource.iType)
85 , iLoaded(aSource.iLoaded)
86 , iMerged(aSource.iMerged)
87 , iLocalKeys(aSource.iLocalKeys)
88 , iMergedKeys(aSource.iMergedKeys)
89{
90 foreach (const ProfileField *localField, aSource.iLocalFields) {
91 iLocalFields.append(new ProfileField(*localField));
92 }
93 foreach (const ProfileField *mergedField, aSource.iMergedFields) {
94 iMergedFields.append(new ProfileField(*mergedField));
95 }
96
97 foreach (Profile *p, aSource.iSubProfiles) {
98 iSubProfiles.append(p->clone());
99 }
100}
101
103{
104 qDeleteAll(iLocalFields);
105 iLocalFields.clear();
106 qDeleteAll(iMergedFields);
107 iMergedFields.clear();
108
109 qDeleteAll(iSubProfiles);
110 iSubProfiles.clear();
111}
112
113#endif // PROFILE_P_H
This class represents a profile field.
Definition ProfileField.h:49
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:76
~ProfilePrivate()
Destructor.
Definition Profile_p.h:102
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
Definition SyncBackupAdaptor.h:40
Definition SyncBackupAdaptor.h:41