equal
deleted
inserted
replaced
16 */ |
16 */ |
17 |
17 |
18 |
18 |
19 |
19 |
20 // INCLUDE FILES |
20 // INCLUDE FILES |
21 #include <featmgr.h> |
|
22 #include <centralrepository.h> |
|
23 #include "nsmldmsettings.h" |
21 #include "nsmldmsettings.h" |
24 #include "NSmlDMResourceProfile.h" |
22 #include "NSmlDMResourceProfile.h" |
25 #include "DevManInternalCRKeys.h" |
23 #include <featmgr.h> |
26 const TInt KNSmlDmBluetoothType = 0x101F99F1; |
24 const TInt KNSmlDmBluetoothType = 0x101F99F1; |
27 // ---------------------------------------------------------- |
25 // ---------------------------------------------------------- |
28 // CNSmlDMResourceProfiles implementation |
26 // CNSmlDMResourceProfiles implementation |
29 // ---------------------------------------------------------- |
27 // ---------------------------------------------------------- |
30 |
28 |
77 // ---------------------------------------------------------- |
75 // ---------------------------------------------------------- |
78 void CNSmlDMResourceProfiles::SaveProfilesL() |
76 void CNSmlDMResourceProfiles::SaveProfilesL() |
79 { |
77 { |
80 RemoveDuplicateEntry(); |
78 RemoveDuplicateEntry(); |
81 RemoveObexEntryL(); |
79 RemoveObexEntryL(); |
82 TInt count = iProfileArray->Count(); |
80 for ( TInt i = 0; i < iProfileArray->Count(); i++ ) |
83 for ( TInt i = 0; i < count ; i++ ) |
|
84 { |
81 { |
85 CNSmlDMProfile* profile = iSettings->CreateProfileL(); |
82 CNSmlDMProfile* profile = iSettings->CreateProfileL(); |
86 CleanupStack::PushL( profile ); |
83 CleanupStack::PushL( profile ); |
87 iProfileArray->At(i)->SaveProfileL( profile ); |
84 iProfileArray->At(i)->SaveProfileL( profile ); |
88 profile->SaveL(); |
85 profile->SaveL(); |
89 CleanupStack::PopAndDestroy(); // profile |
86 CleanupStack::PopAndDestroy(); // profile |
90 } |
|
91 CRepository* centrep = NULL; |
|
92 TRAPD( err, centrep = CRepository::NewL(KCRUidDeviceManagementInternalKeys)); |
|
93 if (err==KErrNone ) |
|
94 { |
|
95 TInt err = centrep->Set( KMaxFactoryDMProfileId , count-1 ); |
|
96 delete centrep; |
|
97 centrep = NULL; |
|
98 } |
87 } |
99 } |
88 } |
100 |
89 |
101 // ---------------------------------------------------------- |
90 // ---------------------------------------------------------- |
102 // void CNSmlDMResourceProfiles::ConstructL( TResourceReader& aReader ) |
91 // void CNSmlDMResourceProfiles::ConstructL( TResourceReader& aReader ) |