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> |
21 #include "nsmldmsettings.h" |
23 #include "nsmldmsettings.h" |
22 #include "NSmlDMResourceProfile.h" |
24 #include "NSmlDMResourceProfile.h" |
23 #include <featmgr.h> |
25 #include "DevManInternalCRKeys.h" |
24 const TInt KNSmlDmBluetoothType = 0x101F99F1; |
26 const TInt KNSmlDmBluetoothType = 0x101F99F1; |
25 // ---------------------------------------------------------- |
27 // ---------------------------------------------------------- |
26 // CNSmlDMResourceProfiles implementation |
28 // CNSmlDMResourceProfiles implementation |
27 // ---------------------------------------------------------- |
29 // ---------------------------------------------------------- |
28 |
30 |
75 // ---------------------------------------------------------- |
77 // ---------------------------------------------------------- |
76 void CNSmlDMResourceProfiles::SaveProfilesL() |
78 void CNSmlDMResourceProfiles::SaveProfilesL() |
77 { |
79 { |
78 RemoveDuplicateEntry(); |
80 RemoveDuplicateEntry(); |
79 RemoveObexEntryL(); |
81 RemoveObexEntryL(); |
80 for ( TInt i = 0; i < iProfileArray->Count(); i++ ) |
82 TInt count = iProfileArray->Count(); |
|
83 for ( TInt i = 0; i < count ; i++ ) |
81 { |
84 { |
82 CNSmlDMProfile* profile = iSettings->CreateProfileL(); |
85 CNSmlDMProfile* profile = iSettings->CreateProfileL(); |
83 CleanupStack::PushL( profile ); |
86 CleanupStack::PushL( profile ); |
84 iProfileArray->At(i)->SaveProfileL( profile ); |
87 iProfileArray->At(i)->SaveProfileL( profile ); |
85 profile->SaveL(); |
88 profile->SaveL(); |
86 CleanupStack::PopAndDestroy(); // profile |
89 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; |
87 } |
98 } |
88 } |
99 } |
89 |
100 |
90 // ---------------------------------------------------------- |
101 // ---------------------------------------------------------- |
91 // void CNSmlDMResourceProfiles::ConstructL( TResourceReader& aReader ) |
102 // void CNSmlDMResourceProfiles::ConstructL( TResourceReader& aReader ) |