15 * |
15 * |
16 * |
16 * |
17 */ |
17 */ |
18 |
18 |
19 |
19 |
20 #include "psetvariationproxy.h" |
20 #include "PsetVariationProxy.h" |
21 #include <centralrepository.h> |
21 #include <centralrepository.h> |
22 #include <settingsinternalcrkeys.h> |
22 #include <settingsinternalcrkeys.h> |
23 #include <telservicesinternalcrkeys.h> |
23 #include <telservicesinternalcrkeys.h> |
24 |
24 |
25 // --------------------------------------------------------------------------- |
25 // --------------------------------------------------------------------------- |
26 // Constructor |
26 // Constructor |
27 // --------------------------------------------------------------------------- |
27 // --------------------------------------------------------------------------- |
28 // |
28 // |
29 CPSetVariationProxy::CPSetVariationProxy() |
29 CPSetVariationProxy::CPSetVariationProxy() |
30 { |
30 { |
31 } |
31 } |
32 |
32 |
33 // --------------------------------------------------------------------------- |
33 // --------------------------------------------------------------------------- |
34 // Destructor |
34 // Destructor |
35 // --------------------------------------------------------------------------- |
35 // --------------------------------------------------------------------------- |
36 // |
36 // |
37 CPSetVariationProxy::~CPSetVariationProxy() |
37 CPSetVariationProxy::~CPSetVariationProxy() |
38 { |
38 { |
39 } |
39 } |
40 |
40 |
41 // --------------------------------------------------------------------------- |
41 // --------------------------------------------------------------------------- |
42 // NewL |
42 // NewL |
43 // --------------------------------------------------------------------------- |
43 // --------------------------------------------------------------------------- |
44 // |
44 // |
45 CPSetVariationProxy* CPSetVariationProxy::NewL( |
45 CPSetVariationProxy* CPSetVariationProxy::NewL( |
46 const TUid& aUid, |
46 const TUid& aUid, |
47 const TUint aId ) |
47 const TUint aId ) |
48 { |
48 { |
49 CPSetVariationProxy* self = new ( ELeave ) CPSetVariationProxy(); |
49 CPSetVariationProxy* self = new ( ELeave ) CPSetVariationProxy(); |
50 CleanupStack::PushL( self ); |
50 CleanupStack::PushL( self ); |
51 self->ConstructL( aUid, aId ); |
51 self->ConstructL( aUid, aId ); |
52 CleanupStack::Pop( self ); |
52 CleanupStack::Pop( self ); |
53 return self; |
53 return self; |
54 } |
54 } |
55 |
55 |
56 // --------------------------------------------------------------------------- |
56 // --------------------------------------------------------------------------- |
57 // ConstructL |
57 // ConstructL |
58 // --------------------------------------------------------------------------- |
58 // --------------------------------------------------------------------------- |
59 // |
59 // |
60 void CPSetVariationProxy::ConstructL( |
60 void CPSetVariationProxy::ConstructL( |
61 const TUid& aUid, |
61 const TUid& aUid, |
62 const TUint aId ) |
62 const TUint aId ) |
63 { |
63 { |
64 TInt keySetting = 0; |
64 TInt keySetting = 0; |
65 CRepository* centralRepository = CRepository::NewLC( aUid ); |
65 CRepository* centralRepository = CRepository::NewLC( aUid ); |
66 User::LeaveIfError( centralRepository->Get( aId, keySetting ) ); |
66 User::LeaveIfError( centralRepository->Get( aId, keySetting ) ); |
67 |
67 |
68 if( ( aUid == KCRUidPhoneSettings ) && |
68 if( ( aUid == KCRUidPhoneSettings ) && |
69 ( keySetting ) ) |
69 ( keySetting ) ) |
70 { |
70 { |
71 iFeature |= KCallWaitingDistiquishNotProvisioned; |
71 iFeature |= KCallWaitingDistiquishNotProvisioned; |
72 } |
72 } |
73 else if ( aUid == KCRUidTelSrvVariation ) |
73 else if ( aUid == KCRUidTelSrvVariation ) |
74 { |
74 { |
75 iFeature |= keySetting; |
75 iFeature |= keySetting; |
76 } |
76 } |
77 |
77 |
78 CleanupStack::PopAndDestroy( centralRepository ); |
78 CleanupStack::PopAndDestroy( centralRepository ); |
79 } |
79 } |
80 |
80 |
81 // --------------------------------------------------------------------------- |
81 // --------------------------------------------------------------------------- |
82 // IsFeatureEnabled |
82 // IsFeatureEnabled |
83 // --------------------------------------------------------------------------- |
83 // --------------------------------------------------------------------------- |
84 // |
84 // |
85 TBool CPSetVariationProxy::IsFeatureEnabled( TUint aFeature ) const |
85 TBool CPSetVariationProxy::IsFeatureEnabled( TUint aFeature ) const |
86 { |
86 { |
87 return aFeature&iFeature; |
87 return aFeature&iFeature; |
88 } |
88 } |