13 * |
13 * |
14 * Description: Implementation of applicationmanagement components |
14 * Description: Implementation of applicationmanagement components |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
|
18 #include <centralrepository.h> |
18 #include "AMAppHideUtil.h" |
19 #include "AMAppHideUtil.h" |
19 |
|
20 #include <centralrepository.h> |
|
21 #include <menu2internalcrkeys.h> |
|
22 |
|
23 #include "debug.h" |
20 #include "debug.h" |
24 |
21 |
25 using namespace NApplicationManagement; |
22 using namespace NApplicationManagement; |
26 |
23 |
27 // The uid list delimiter |
24 // The uid list delimiter |
120 // ----------------------------------------------------------------------------- |
117 // ----------------------------------------------------------------------------- |
121 // CAMAppHideUtil::PersistUidsL() |
118 // CAMAppHideUtil::PersistUidsL() |
122 // ----------------------------------------------------------------------------- |
119 // ----------------------------------------------------------------------------- |
123 void CAMAppHideUtil::PersistUidsL() |
120 void CAMAppHideUtil::PersistUidsL() |
124 { |
121 { |
|
122 TInt err = KErrNone; |
125 if (iChanged) |
123 if (iChanged) |
126 { |
124 { |
127 TBuf<NCentralRepositoryConstants::KMaxUnicodeStringLength> buf; |
125 TBuf<NCentralRepositoryConstants::KMaxUnicodeStringLength> buf; |
128 RDEBUG_2( "PersistUids: count %d", iHiddenUids.Count() ); |
126 RDEBUG_2( "PersistUids: count %d", iHiddenUids.Count() ); |
129 for (TInt i(iHiddenUids.Count() - 1); i >= 0; --i) |
127 for (TInt i(iHiddenUids.Count() - 1); i >= 0; --i) |
130 { |
128 { |
131 RDEBUG_3( "PersistUids: cur %d %x", i,iHiddenUids[i].iUid ); |
129 RDEBUG_3( "PersistUids: cur %d %x", i,iHiddenUids[i].iUid ); |
132 PersistUid(iHiddenUids[i], buf, i > 0) ; |
130 PersistUid(iHiddenUids[i], buf, i > 0) ; |
133 } |
131 } |
134 CRepository *rep = CRepository::NewLC(KCRUidMenu); |
132 /*CRepository *rep = CRepository::NewLC(KCRUidMenu); |
135 TInt err(rep->Set(KMenuHideApplication, buf) ); |
133 TInt err(rep->Set(KMenuHideApplication, buf) ); |
136 CleanupStack::PopAndDestroy(rep); |
134 CleanupStack::PopAndDestroy(rep);*/ |
137 if (err != KErrNone) |
135 if (err != KErrNone) |
138 { |
136 { |
139 RDEBUG_2( "PersistUids: ERROR failed to set key: %d", err ); |
137 RDEBUG_2( "PersistUids: ERROR failed to set key: %d", err ); |
140 User::Leave(err); |
138 User::Leave(err); |
141 } |
139 } |
178 // ----------------------------------------------------------------------------- |
176 // ----------------------------------------------------------------------------- |
179 // CAMAppHideUtil::LoadUidsL() |
177 // CAMAppHideUtil::LoadUidsL() |
180 // ----------------------------------------------------------------------------- |
178 // ----------------------------------------------------------------------------- |
181 void CAMAppHideUtil::LoadUidsL() |
179 void CAMAppHideUtil::LoadUidsL() |
182 { |
180 { |
183 CRepository *rep = CRepository::NewLC(KCRUidMenu); |
181 TInt err = KErrNone; |
|
182 TBuf<NCentralRepositoryConstants::KMaxUnicodeStringLength> buf; |
|
183 /*CRepository *rep = CRepository::NewLC(KCRUidMenu); |
184 TBuf<NCentralRepositoryConstants::KMaxUnicodeStringLength> buf; |
184 TBuf<NCentralRepositoryConstants::KMaxUnicodeStringLength> buf; |
185 TInt err(rep->Get(KMenuHideApplication, buf) ); |
185 TInt err(rep->Get(KMenuHideApplication, buf) ); |
186 CleanupStack::PopAndDestroy(rep); |
186 CleanupStack::PopAndDestroy(rep);*/ |
187 if (err == KErrNone) |
187 if (err == KErrNone) |
188 { |
188 { |
189 RDEBUG_2( "CAMAppHideUtil::LoadUidsL - Loading '%S'", &buf); |
189 RDEBUG_2( "CAMAppHideUtil::LoadUidsL - Loading '%S'", &buf); |
190 TLex lex(buf); |
190 TLex lex(buf); |
191 TUid aUid(TUid::Null()); |
191 TUid aUid(TUid::Null()); |