author | hgs |
Fri, 15 Oct 2010 16:26:27 +0300 | |
changeset 57 | 21be958eb3ce |
parent 28 | 075425b8d9a4 |
child 37 | 451b2e1545b2 |
permissions | -rw-r--r-- |
24 | 1 |
/* |
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 |
* All rights reserved. |
|
4 |
* This component and the accompanying materials are made available |
|
5 |
* under the terms of "Eclipse Public License v1.0" |
|
6 |
* which accompanies this distribution, and is available |
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 |
* |
|
9 |
* Initial Contributors: |
|
10 |
* Nokia Corporation - initial contribution. |
|
11 |
* |
|
12 |
* Contributors: |
|
13 |
* |
|
14 |
* Description: |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
18 |
// System includes |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
19 |
#include <centralrepository.h> |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
20 |
|
24 | 21 |
// User includes |
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
22 |
#include "cradiosettingsimp.h" |
24 | 23 |
#include "radiointernalcrkeys.h" |
24 |
#include "cradioapplicationsettings.h" |
|
25 |
#include "cradioenginelogger.h" |
|
26 |
||
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
27 |
// This has to be the last include. |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
28 |
#ifdef STUB_CONSTELLATION |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
29 |
# include <RadioStubManager.h> |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
30 |
#endif //STUB_CONSTELLATION |
24 | 31 |
|
32 |
// ======== MEMBER FUNCTIONS ======== |
|
33 |
||
34 |
// --------------------------------------------------------------------------- |
|
35 |
// |
|
36 |
// --------------------------------------------------------------------------- |
|
37 |
// |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
38 |
CRadioApplicationSettings* CRadioApplicationSettings::NewL() |
24 | 39 |
{ |
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
40 |
LEVEL3( LOG_METHOD_AUTO ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
41 |
CRadioApplicationSettings* self = new ( ELeave ) CRadioApplicationSettings(); |
24 | 42 |
CleanupStack::PushL( self ); |
43 |
self->ConstructL(); |
|
44 |
CleanupStack::Pop( self ); |
|
45 |
return self; |
|
46 |
} |
|
47 |
||
48 |
// --------------------------------------------------------------------------- |
|
49 |
// |
|
50 |
// --------------------------------------------------------------------------- |
|
51 |
// |
|
52 |
void CRadioApplicationSettings::ConstructL() |
|
53 |
{ |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
54 |
LEVEL2( LOG_METHOD_AUTO ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
55 |
iRepository = CRepository::NewL( KRadioCRUid ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
56 |
LOG_FORMAT( "iRepository = %i", iRepository ); |
24 | 57 |
} |
58 |
||
59 |
// --------------------------------------------------------------------------- |
|
60 |
// |
|
61 |
// --------------------------------------------------------------------------- |
|
62 |
// |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
63 |
CRadioApplicationSettings::CRadioApplicationSettings() |
24 | 64 |
{ |
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
65 |
LEVEL3( LOG_METHOD_AUTO ); |
24 | 66 |
} |
67 |
||
68 |
// --------------------------------------------------------------------------- |
|
69 |
// |
|
70 |
// --------------------------------------------------------------------------- |
|
71 |
// |
|
72 |
CRadioApplicationSettings::~CRadioApplicationSettings() |
|
73 |
{ |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
74 |
LEVEL3( LOG_METHOD_AUTO ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
75 |
delete iRepository; |
24 | 76 |
} |
77 |
||
78 |
// --------------------------------------------------------------------------- |
|
79 |
// From class MRadioApplicationSettings. |
|
80 |
// |
|
81 |
// --------------------------------------------------------------------------- |
|
82 |
// |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
83 |
TBool CRadioApplicationSettings::IsFirstTimeStart() |
24 | 84 |
{ |
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
85 |
LEVEL3( LOG_METHOD_AUTO ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
86 |
TInt startCount = 0; |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
87 |
iRepository->Get( KRadioCRLaunchCount, startCount ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
88 |
|
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
89 |
return startCount == 0; |
24 | 90 |
} |
91 |
||
92 |
// --------------------------------------------------------------------------- |
|
93 |
// From class MRadioApplicationSettings. |
|
94 |
// |
|
95 |
// --------------------------------------------------------------------------- |
|
96 |
// |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
97 |
void CRadioApplicationSettings::SetFirstTimeStartPerformed( TBool aFirstTimeStartPerformed ) |
24 | 98 |
{ |
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
99 |
LEVEL3( LOG_METHOD_AUTO ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
100 |
iRepository->Set( KRadioCRLaunchCount, aFirstTimeStartPerformed ? 1 : 0 ); |
24 | 101 |
} |
102 |
||
103 |
||
104 |
// --------------------------------------------------------------------------- |
|
105 |
// From class MRadioApplicationSettings. |
|
106 |
// |
|
107 |
// --------------------------------------------------------------------------- |
|
108 |
// |
|
109 |
TInt CRadioApplicationSettings::SetUiFlags( TUint aUiFlags ) |
|
110 |
{ |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
111 |
LEVEL3( LOG_METHOD_AUTO ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
112 |
return iRepository->Set( KRadioCRUiFlags, static_cast<TInt>( aUiFlags ) ); |
24 | 113 |
} |
114 |
||
115 |
// --------------------------------------------------------------------------- |
|
116 |
// From class MRadioApplicationSettings. |
|
117 |
// |
|
118 |
// --------------------------------------------------------------------------- |
|
119 |
// |
|
120 |
TUint CRadioApplicationSettings::UiFlags() const |
|
121 |
{ |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
122 |
LEVEL3( LOG_METHOD_AUTO ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
123 |
TInt uiFlags( 0 ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
124 |
iRepository->Get( KRadioCRUiFlags, uiFlags ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
125 |
return static_cast<TUint>( uiFlags ); |
24 | 126 |
} |