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