1023 // --------------------------------------------------------------------------- |
991 // --------------------------------------------------------------------------- |
1024 // |
992 // |
1025 // --------------------------------------------------------------------------- |
993 // --------------------------------------------------------------------------- |
1026 // |
994 // |
1027 void CHnEngine::LoadFromCrL( const TDesC8& aUri ) |
995 void CHnEngine::LoadFromCrL( const TDesC8& aUri ) |
1028 { |
996 { |
1029 HBufC8* uriBuf = HBufC8::NewLC( aUri.Length() ); |
997 HBufC8* uriBuf = HBufC8::NewLC( aUri.Length() ); |
1030 uriBuf->Des().Copy( aUri ); |
998 uriBuf->Des().Copy( aUri ); |
1031 |
999 |
1032 TUriParser8 parser; |
1000 TUriParser8 parser; |
1033 parser.Parse( *uriBuf ); |
1001 parser.Parse( *uriBuf ); |
1034 User::LeaveIfError( parser.IsSchemeValid() ? KErrNone : KErrPathNotFound ); |
1002 User::LeaveIfError( parser.IsSchemeValid() ? KErrNone : KErrPathNotFound ); |
1035 |
1003 |
1036 const TDesC8& query = parser.Extract( EUriQuery ); |
1004 const TDesC8& query = parser.Extract( EUriQuery ); |
1037 RPointerArray< HBufC8 > params = SplitL( query, HnLogicalRelations::KParamUid8); |
1005 RPointerArray< HBufC8 > params = SplitL( query, HnLogicalRelations::KLogicalAnd8); |
1038 |
1006 |
1039 TBuf8< KApaMaxAppGroupName + KTimeStampBufferLength + KUidStringLength + 2> item; |
1007 TBuf8<KApaMaxAppGroupName + KTimeStampBufferLength + KUidStringLength + 2> item; |
1040 |
1008 |
1041 for( TInt i = 0; i < params.Count(); i++ ) |
1009 for( TInt i = 0; i < params.Count(); i++ ) |
1042 { |
1010 { |
1043 RPointerArray< HBufC8 > paramValue = SplitL( *params[ i ], HnLogicalRelations::KLogicalEqual8 ); |
1011 RPointerArray< HBufC8 > paramValue = SplitL( *params[ i ], HnLogicalRelations::KLogicalEqual8 ); |
1044 CleanupResetAndDestroyPushL( paramValue ); |
1012 CleanupResetAndDestroyPushL( paramValue ); |
1045 ASSERT( paramValue.Count() == 2 ); |
1013 ASSERT( paramValue.Count() == 2 ); |
1046 |
1014 |
1047 if ( !paramValue[0]->Compare(KMcsAppGroupName8) ) |
1015 if ( !paramValue[0]->Compare(KMcsAppGroupName8) ) |
1048 { |
1016 { |
1049 TBuf8< KApaMaxAppGroupName > appgrname; |
1017 TBuf8<KApaMaxAppGroupName> appgrname; |
1050 if( paramValue[1]->Length()<= KApaMaxAppGroupName ) |
1018 if( paramValue[1]->Length()<=KApaMaxAppGroupName ) |
1051 { |
1019 { |
1052 appgrname.Append( *paramValue[1] ); |
1020 appgrname.Append( *paramValue[1] ); |
1053 } |
1021 } |
1054 |
1022 |
1055 //get current time |
1023 //get current time |
1056 TTime currentTime; |
1024 TTime currentTime; |
1057 currentTime.HomeTime(); |
1025 currentTime.HomeTime(); |
1058 TDateTime date(currentTime.DateTime()); |
1026 TDateTime date(currentTime.DateTime()); |
1059 item.Format(KCRepTimeFormat, &appgrname , date.Year(), date.Month(), |
1027 item.Format(KCRepTimeFormat, &appgrname , date.Year(), date.Month(), |
1060 date.Day(), date.Hour(), date.Minute(), date.Second(), date.MicroSecond()); |
1028 date.Day(), date.Hour(), date.Minute(), date.Second(), date.MicroSecond()); |
1061 } |
1029 } |
1062 else if ( !paramValue[0]->Compare( KKeyTypeUid ) ) |
1030 else if ( !paramValue[0]->Compare( KKeyTypeUid ) ) |
1063 { |
1031 { |
1064 item.Append( KComma8 ); |
1032 item.Append( KComma8 ); |
1065 if( paramValue[1]->Length()<=KUidStringLength ) |
1033 if( paramValue[1]->Length()<=KUidStringLength ) |
1066 { |
1034 { |
1067 item.Append( *paramValue[1] ); |
1035 item.Append( *paramValue[1] ); |
1068 } |
1036 } |
1069 } |
1037 } |
1070 CleanupStack::PopAndDestroy( ¶mValue ); |
1038 CleanupStack::PopAndDestroy( ¶mValue ); |
1071 } |
1039 } |
1072 |
1040 |
1073 TBuf< KApaMaxAppGroupName + KTimeStampBufferLength + KUidStringLength + 2> item1; |
1041 TBuf<KApaMaxAppGroupName + KTimeStampBufferLength + KUidStringLength + 2> item1; |
1074 item1.Copy(item); |
1042 item1.Copy(item); |
1075 CRepository *cenRep = CRepository::NewLC( KCRUidMenu ); |
1043 CRepository *cenRep = CRepository::NewLC( KCRUidMenu ); |
1076 cenRep->Set(KMenuShowFolder, item1); |
1044 cenRep->Set(KMenuShowFolder, item1); |
1077 CleanupStack::PopAndDestroy( cenRep ); |
1045 CleanupStack::PopAndDestroy( cenRep ); |
1078 |
1046 |
1079 params.ResetAndDestroy(); |
1047 params.ResetAndDestroy(); |
1080 CleanupStack::PopAndDestroy( uriBuf ); |
1048 CleanupStack::PopAndDestroy( uriBuf ); |
1081 } |
1049 |
|
1050 } |
1082 // --------------------------------------------------------------------------- |
1051 // --------------------------------------------------------------------------- |
1083 // |
1052 // |
1084 // --------------------------------------------------------------------------- |
1053 // --------------------------------------------------------------------------- |
1085 // |
1054 // |
1086 void CHnEngine::LightStatusChanged(TInt aTarget, |
1055 void CHnEngine::LightStatusChanged(TInt aTarget, |
1110 // --------------------------------------------------------------------------- |
1079 // --------------------------------------------------------------------------- |
1111 // |
1080 // |
1112 // --------------------------------------------------------------------------- |
1081 // --------------------------------------------------------------------------- |
1113 // |
1082 // |
1114 TBool CHnEngine::HandleActionL( const TDesC8& aUri ) |
1083 TBool CHnEngine::HandleActionL( const TDesC8& aUri ) |
1115 { |
1084 { |
1116 TBool exitActionConsumed( EFalse ); |
1085 TBool exitActionConsumed(EFalse); |
1117 |
1086 |
1118 HBufC8* uriBuf = HBufC8::NewLC( aUri.Length() ); |
1087 HBufC8* uriBuf = HBufC8::NewLC( aUri.Length() ); |
1119 uriBuf->Des().Copy( aUri ); |
1088 uriBuf->Des().Copy( aUri ); |
1120 |
1089 |
1121 TUriParser8 parser; |
1090 TUriParser8 parser; |
1122 parser.Parse( *uriBuf ); |
1091 parser.Parse( *uriBuf ); |
1123 User::LeaveIfError( parser.IsSchemeValid() ? KErrNone : KErrPathNotFound ); |
1092 User::LeaveIfError( parser.IsSchemeValid() ? KErrNone : KErrPathNotFound ); |
1124 |
1093 |
1125 const TDesC8& host8 = parser.Extract( EUriHost ); |
1094 const TDesC8& host8 = parser.Extract( EUriHost ); |
1126 const TDesC8& query = parser.Extract( EUriQuery ); |
1095 const TDesC8& query = parser.Extract( EUriQuery ); |
1127 |
1096 |
1128 RBuf action; |
1097 RBuf action; |
1129 CleanupClosePushL( action ); |
1098 CleanupClosePushL( action ); |
1130 CLiwGenericParamList* paramsUri = UriQueryToLiwListLC( query, KNullDesC8, KNullDesC8 ); |
1099 CLiwGenericParamList* paramsUri = UriQueryToLiwListLC( query, KNullDesC8, KNullDesC8 ); |
1131 HnLiwUtils::GetStringL( *paramsUri, KActionParams, action ); |
1100 HnLiwUtils::GetStringL( *paramsUri, KActionParams, action ); |
1132 |
1101 |
1133 if( !action.Compare( KActionExit ) ) |
1102 if ( !action.Compare( KActionExit ) ) |
1134 { |
1103 { |
1135 RBuf host; |
1104 RBuf host; |
1136 host.CreateL( host8.Length() ); |
1105 host.CreateL( host8.Length() ); |
1137 CleanupClosePushL( host ); |
1106 CleanupClosePushL( host ); |
1138 host.Copy( host8 ); |
1107 host.Copy(host8); |
1139 CHnSuiteModel* suiteModel = iSuiteContainer->GetSuiteModel( host ); |
1108 CHnSuiteModel* suiteModel = iSuiteContainer->GetSuiteModel( host ); |
1140 TBool exitHideHostNotFound( ETrue ); |
1109 TBool exitHideHostNotFound( ETrue ); |
1141 if( suiteModel && suiteModel->ExitMode() == EExitModeHide ) |
1110 if( suiteModel && suiteModel->ExitMode() == EExitModeHide ) |
1142 { |
1111 { |
1143 exitHideHostNotFound = EFalse; |
1112 exitHideHostNotFound = EFalse; |
1144 } |
1113 } |
1145 |
1114 |
1146 if( exitHideHostNotFound ) |
1115 if ( exitHideHostNotFound ) |
1147 { |
1116 { |
1148 //send to foreground |
1117 //send to foreground |
1149 CLiwGenericParamList* pl = CLiwGenericParamList::NewL(); |
1118 CLiwGenericParamList* pl = CLiwGenericParamList::NewL(); |
1150 CleanupStack::PushL( pl ); |
1119 CleanupStack::PushL( pl ); |
1151 HandleModelEventL( KAppGainForeground, *pl ); |
1120 HandleModelEventL( KAppGainForeground, *pl ); |
1152 CleanupStack::PopAndDestroy( pl ); |
1121 CleanupStack::PopAndDestroy( pl ); |
1153 } |
1122 } |
1154 else |
1123 else |
1155 { |
1124 { |
1156 //send to background |
1125 //send to background |
1157 CLiwGenericParamList* pl = CLiwGenericParamList::NewL(); |
1126 CLiwGenericParamList* pl = CLiwGenericParamList::NewL(); |
1158 CleanupStack::PushL( pl ); |
1127 CleanupStack::PushL( pl ); |
1159 HandleModelEventL( KAppGainBackground, *pl ); |
1128 HandleModelEventL( KAppGainBackground, *pl ); |
1160 CleanupStack::PopAndDestroy( pl ); |
1129 CleanupStack::PopAndDestroy( pl ); |
1161 } |
1130 } |
1162 |
1131 |
1163 if( exitHideHostNotFound && iSuiteContainer->GetLastSuiteModel() == suiteModel ) |
1132 if ( exitHideHostNotFound && iSuiteContainer->GetLastSuiteModel() == suiteModel ) |
1164 { |
1133 { |
1165 HandleBackEventL( host, 1 ); |
1134 HandleBackEventL( host, 1 ); |
1166 } |
1135 } |
1167 else |
1136 else |
1168 { |
1137 { |
1169 //reset to root |
1138 //reset to root |
1170 CLiwGenericParamList* params = CLiwGenericParamList::NewLC(); |
1139 CLiwGenericParamList* params = CLiwGenericParamList::NewLC(); |
1171 params->AppendL( iMetaDataModel->GetSuiteParameters( 0 ) ); |
1140 params->AppendL( iMetaDataModel->GetSuiteParameters( 0 ) ); |
1172 ResetModelsL(); |
1141 ResetModelsL(); |
1173 InitializeL( *params ); |
1142 InitializeL( *params ); |
1174 CleanupStack::PopAndDestroy( params ); |
1143 CleanupStack::PopAndDestroy( params ); |
1175 } |
1144 } |
1176 |
1145 |
1177 CleanupStack::PopAndDestroy( &host ); |
1146 CleanupStack::PopAndDestroy( &host ); |
1178 exitActionConsumed = ETrue; |
1147 exitActionConsumed = ETrue; |
1179 } |
1148 } |
1180 |
1149 |
1181 CleanupStack::PopAndDestroy( paramsUri ); |
1150 CleanupStack::PopAndDestroy( paramsUri ); |
1182 CleanupStack::PopAndDestroy( &action ); |
1151 CleanupStack::PopAndDestroy( &action ); |
1183 CleanupStack::PopAndDestroy( uriBuf ); |
1152 CleanupStack::PopAndDestroy( uriBuf ); |
1184 return exitActionConsumed; |
1153 return exitActionConsumed; |
1185 } |
1154 } |
1186 |
1155 |
1187 // --------------------------------------------------------------------------- |
1156 // --------------------------------------------------------------------------- |
1188 // |
1157 // |
1189 // --------------------------------------------------------------------------- |
1158 // --------------------------------------------------------------------------- |
1190 // |
1159 // |
1191 void CHnEngine::LoadSuitesL( const TDesC8& aUri ) |
1160 void CHnEngine::LoadSuitesL( const TDesC8& aUri ) |
1192 { |
1161 { |
1193 TBool sendToForeground(EFalse); |
1162 TBool sendToForeground(EFalse); |
1194 HBufC8* uriBuf = HBufC8::NewLC( aUri.Length() ); |
1163 HBufC8* uriBuf = HBufC8::NewLC( aUri.Length() ); |
1195 uriBuf->Des().Copy( aUri ); |
1164 uriBuf->Des().Copy( aUri ); |
1196 |
1165 |
1197 TUriParser8 parser; |
1166 TUriParser8 parser; |
1198 parser.Parse( *uriBuf ); |
1167 parser.Parse( *uriBuf ); |
1199 User::LeaveIfError( parser.IsSchemeValid() ? KErrNone : KErrPathNotFound ); |
1168 User::LeaveIfError( parser.IsSchemeValid() ? KErrNone : KErrPathNotFound ); |
1200 |
1169 |
1201 CDesC8ArrayFlat* suiteNameArray = new( ELeave ) CDesC8ArrayFlat( KDefaultGranularity ) ; |
1170 CDesC8ArrayFlat* suiteNameArray = new( ELeave ) CDesC8ArrayFlat( KDefaultGranularity ) ; |
1202 CleanupStack::PushL( suiteNameArray ); |
1171 CleanupStack::PushL( suiteNameArray ); |
1203 |
1172 |
1204 const TDesC8& host = parser.Extract( EUriHost ); |
1173 const TDesC8& host = parser.Extract( EUriHost ); |
1205 RBuf8 host8; |
1174 RBuf8 host8; |
1206 CleanupClosePushL( host8 ); |
1175 CleanupClosePushL( host8 ); |
1207 if (host.Compare( KNullDesC8 )) |
1176 if (host.Compare( KNullDesC8 )) |
1208 { |
1177 { |
1209 host8.CreateL( host ); |
1178 host8.CreateL( host ); |
1210 host8.LowerCase(); |
1179 host8.LowerCase(); |
1211 suiteNameArray->AppendL( host8 ); |
1180 suiteNameArray->AppendL( host8 ); |
1212 DEBUG8(( "_MM_:\tURI host part: %S", &host8 )); |
1181 DEBUG8(( "_MM_:\tURI host part: %S", &host8 )); |
1213 } |
1182 } |
1214 |
1183 |
1215 const TDesC8& path = parser.Extract( EUriPath ); |
1184 const TDesC8& path = parser.Extract( EUriPath ); |
1216 if (path.Compare( KNullDesC8 )) |
1185 if (path.Compare( KNullDesC8 )) |
1217 { |
1186 { |
1218 HBufC8* path8 = HBufC8::NewLC( path.Length() ); |
1187 HBufC8* path8 = HBufC8::NewLC( path.Length() ); |
1219 path8->Des().Copy( path ); |
1188 path8->Des().Copy( path ); |
1220 path8->Des().LowerCase(); |
1189 path8->Des().LowerCase(); |
1221 ParseSuiteUriPathL( *path8, *suiteNameArray ); |
1190 ParseSuiteUriPathL( *path8, *suiteNameArray ); |
1222 CleanupStack::PopAndDestroy( path8 ); |
1191 CleanupStack::PopAndDestroy( path8 ); |
1223 } |
1192 } |
1224 |
1193 |
1225 TBool suiteExists( EFalse ); |
1194 TBool suiteExists( EFalse ); |
1226 iMetaDataModel->IgnoreEvaluations( ETrue ); |
1195 iMetaDataModel->IgnoreEvaluations( ETrue ); |
1227 iMetaDataModel->QueueForeground( CHnMdModel::EWhenAnySuiteIsEvaluated ); |
1196 iMetaDataModel->QueueForeground( CHnMdModel::EWhenAnySuiteIsEvaluated ); |
1228 |
1197 |
1229 if( host8.Length() == 0 || ( host8.Length() > 0 && |
1198 if( host8.Length() == 0 || ( host8.Length() > 0 && |
1230 !iMetaDataModel->SuiteModelExistsL( host8 ) ) ) |
1199 !iMetaDataModel->SuiteModelExistsL( host8 ) ) ) |
1231 { |
1200 { |
1232 suiteNameArray->Reset(); |
1201 suiteNameArray->Reset(); |
1233 suiteNameArray->AppendL( KRoot8 ); |
1202 suiteNameArray->AppendL( KRoot8 ); |
1234 } |
1203 } |
1235 |
1204 |
1236 for( TInt i = 0; i < suiteNameArray->Count(); ++i ) |
1205 for( TInt i = 0; i < suiteNameArray->Count(); ++i ) |
1237 { |
1206 { |
1238 suiteExists = iMetaDataModel->SuiteModelExistsL( |
1207 suiteExists = iMetaDataModel->SuiteModelExistsL( |
1239 ( *suiteNameArray )[i] ); |
1208 ( *suiteNameArray )[i] ); |
1240 TBool nextExists = i < suiteNameArray->Count() - 1 && |
1209 TBool nextExists = i < suiteNameArray->Count() - 1 && |
1241 iMetaDataModel->SuiteModelExistsL( ( *suiteNameArray )[i + 1] ); |
1210 iMetaDataModel->SuiteModelExistsL( ( *suiteNameArray )[i + 1] ); |
1242 TBool isLast = ( i == ( suiteNameArray->Count() - 1 ) ); |
1211 TBool isLast = ( i == ( suiteNameArray->Count() - 1 ) ); |
1243 |
1212 |
1244 TBool turnOnEvaluation = ( suiteExists && ( !nextExists || isLast ) ); |
1213 TBool turnOnEvaluation = ( suiteExists && ( !nextExists || isLast ) ); |
1245 if( turnOnEvaluation || !suiteExists ) |
1214 if( turnOnEvaluation || !suiteExists ) |
1246 { |
1215 { |
1247 iMetaDataModel->IgnoreEvaluations( EFalse ); |
1216 iMetaDataModel->IgnoreEvaluations( EFalse ); |
1248 } |
1217 } |
1249 |
1218 |
1250 TInt err( KErrNone ); |
1219 TInt err( KErrNone ); |
1251 |
1220 |
1252 // Ignore loading new suite if the last suite in model is the same |
1221 // Ignore loading new suite if the last suite in model is the same |
1253 // as first one in the uri. |
1222 // as first one in the uri. |
1254 if ( i == 0 ) |
1223 if ( i == 0 ) |
1255 { |
1224 { |
1256 if ( SuitesAreTheSameL( iMetaDataModel->GetLastSuite()->SuiteName(), (*suiteNameArray)[i] ) ) |
1225 if ( SuitesAreTheSameL( iMetaDataModel->GetLastSuite()->SuiteName(), (*suiteNameArray)[i] ) ) |
1257 { |
1226 { |
1258 HandleTheSameSuitesL( nextExists, parser.Extract( EUriQuery ) ); |
1227 HandleTheSameSuitesL( nextExists, parser.Extract( EUriQuery ) ); |
1259 sendToForeground = ETrue; |
1228 sendToForeground = ETrue; |
1260 continue; |
1229 continue; |
1261 } |
1230 } |
1262 } |
1231 } |
1263 |
1232 |
1264 if( suiteExists ) |
1233 if( suiteExists ) |
1265 { |
1234 { |
1266 if (!nextExists) |
1235 if (!nextExists) |
1267 { |
1236 { |
1268 // Tricky: queue foreground so that if the suite is evaluated synchronously |
1237 // Tricky: queue foreground so that if the suite is evaluated synchronously |
1269 // the foreground will be gained. |
1238 // the foreground will be gained. |
1270 iMetaDataModel->QueueForeground( CHnMdModel::EWhenAnySuiteIsEvaluated ); |
1239 iMetaDataModel->QueueForeground( CHnMdModel::EWhenAnySuiteIsEvaluated ); |
1271 } |
1240 } |
1272 err = LoadSuiteFromUriL( |
1241 err = LoadSuiteFromUriL( |
1273 ( *suiteNameArray )[i], parser.Extract( EUriQuery ), parser.Extract( EUriFragment ) ); |
1242 ( *suiteNameArray )[i], parser.Extract( EUriQuery ), parser.Extract( EUriFragment ) ); |
1274 if ( KErrNone == err && !nextExists && iMetaDataModel->IsForegroundQueued() ) |
1243 if ( KErrNone == err && !nextExists && iMetaDataModel->IsForegroundQueued() ) |
1275 { |
1244 { |
1276 // Tricky: if foreground is still queued it means that the suite is evaluated |
1245 // Tricky: if foreground is still queued it means that the suite is evaluated |
1277 // asynchronously. Override the previos foreground queue setting with one |
1246 // asynchronously. Override the previos foreground queue setting with one |
1278 // that will be effective only if the last loaded suite is evaluated. |
1247 // that will be effective only if the last loaded suite is evaluated. |
1279 iMetaDataModel->QueueForeground( CHnMdModel::EWhenCurrentTopSuiteIsEvaluated ); |
1248 iMetaDataModel->QueueForeground( CHnMdModel::EWhenCurrentTopSuiteIsEvaluated ); |
1280 } |
1249 } |
1281 if ( err != KErrNone ) |
1250 if ( err != KErrNone ) |
1282 { |
1251 { |
1283 sendToForeground = ETrue; |
1252 sendToForeground = ETrue; |
1284 } |
1253 } |
1285 } |
1254 } |
1286 |
1255 |
1287 if( !suiteExists || err != KErrNone || !nextExists ) |
1256 if( !suiteExists || err != KErrNone || !nextExists ) |
1288 { |
1257 { |
1289 CHnFilter* filter = CHnFilter::NewLC(); |
1258 CHnFilter* filter = CHnFilter::NewLC(); |
1290 |
1259 |
1291 filter->SetSuiteId( |
1260 filter->SetSuiteId( |
1292 iSuiteContainer->GetLastSuiteModel()->CustomId() ); |
1261 iSuiteContainer->GetLastSuiteModel()->CustomId() ); |
1293 |
1262 |
1294 filter->SetEvaluateSuiteL( ETrue ); |
1263 filter->SetEvaluateSuiteL( ETrue ); |
1295 iMetaDataModel->IgnoreEvaluations( EFalse ); |
1264 iMetaDataModel->IgnoreEvaluations( EFalse ); |
1296 |
1265 |
1297 TRAPD( err, iMetaDataModel->EvaluateL( *filter ) ); |
1266 TRAPD( err, iMetaDataModel->EvaluateL( *filter ) ); |
1298 |
1267 |
1299 CleanupStack::PopAndDestroy( filter ); |
1268 CleanupStack::PopAndDestroy( filter ); |
1300 if( err ) |
1269 if( err ) |
1301 { |
1270 { |
1302 iMetaDataModel->DeleteLastSuite(); |
1271 iMetaDataModel->DeleteLastSuite(); |
1303 iSuiteContainer->PopSuiteModelL( |
1272 iSuiteContainer->PopSuiteModelL( |
1304 HnConvUtils::Str8ToStr( ( *suiteNameArray )[i] )->Des() ); |
1273 HnConvUtils::Str8ToStr( ( *suiteNameArray )[i] )->Des() ); |
1305 sendToForeground = ETrue; |
1274 sendToForeground = ETrue; |
1306 } |
1275 } |
1307 break; |
1276 break; |
1308 } |
1277 } |
1309 } |
1278 } |
1310 |
1279 |
1311 // set highlight only when path is valid! |
1280 // set highlight only when path is valid! |
1312 if( suiteExists ) |
1281 if( suiteExists ) |
1313 { |
1282 { |
1314 HighlightPlacementFromUriL( parser.Extract( EUriFragment ) ); |
1283 HighlightPlacementFromUriL( parser.Extract( EUriFragment ) ); |
1315 } |
1284 } |
1316 |
1285 |
1317 CleanupStack::PopAndDestroy( &host8 ); |
1286 CleanupStack::PopAndDestroy( &host8 ); |
1318 CleanupStack::PopAndDestroy( suiteNameArray ); |
1287 CleanupStack::PopAndDestroy( suiteNameArray ); |
1319 CleanupStack::PopAndDestroy( uriBuf ); |
1288 CleanupStack::PopAndDestroy( uriBuf ); |
1320 |
1289 |
1321 // send to foreground |
1290 // send to foreground |
1322 if ( sendToForeground ) |
1291 if ( sendToForeground ) |
1323 { |
1292 { |
1324 CLiwGenericParamList* pl = CLiwGenericParamList::NewL(); |
1293 CLiwGenericParamList* pl = CLiwGenericParamList::NewL(); |
1325 CleanupStack::PushL( pl ); |
1294 CleanupStack::PushL( pl ); |
1326 HandleModelEventL( KAppGainForeground, *pl ); |
1295 HandleModelEventL( KAppGainForeground, *pl ); |
1327 CleanupStack::PopAndDestroy( pl ); |
1296 CleanupStack::PopAndDestroy( pl ); |
1328 iMetaDataModel->QueueForeground( CHnMdModel::ENever ); |
1297 iMetaDataModel->QueueForeground( CHnMdModel::ENever ); |
1329 } |
1298 } |
1330 |
1299 |
1331 } |
1300 } |
1332 // --------------------------------------------------------------------------- |
|
1333 // |
|
1334 // --------------------------------------------------------------------------- |
|
1335 // |
|
1336 void CHnEngine::LoadItemFromCrL( const TDesC8& aUri ) |
|
1337 { |
|
1338 HBufC8* uriBuf = HBufC8::NewLC( aUri.Length() ); |
|
1339 uriBuf->Des().Copy( aUri ); |
|
1340 |
|
1341 TUriParser8 parser; |
|
1342 parser.Parse( *uriBuf ); |
|
1343 User::LeaveIfError( parser.IsSchemeValid() ? KErrNone : KErrPathNotFound ); |
|
1344 |
|
1345 const TDesC8& query = parser.Extract( EUriQuery ); |
|
1346 |
|
1347 if( query.Compare( KNullDesC8 ) ) |
|
1348 { |
|
1349 TBuf8<KMaxLength> item; |
|
1350 RPointerArray<HBufC8> paramValue = SplitL( query, |
|
1351 HnLogicalRelations::KLogicalEqual8 ); |
|
1352 CleanupResetAndDestroyPushL( paramValue ); |
|
1353 ASSERT( paramValue.Count() == 2 ); |
|
1354 |
|
1355 if( !paramValue[0]->Compare( KId8 ) ) |
|
1356 { |
|
1357 if( paramValue[1]->Length() <= KUidStringLength ) |
|
1358 { |
|
1359 item.Append( *paramValue[1] ); |
|
1360 } |
|
1361 } |
|
1362 CleanupStack::PopAndDestroy( ¶mValue ); |
|
1363 |
|
1364 TBuf<KMaxLength> item1; |
|
1365 item1.Copy( item ); |
|
1366 CRepository *cenRep = CRepository::NewLC( KCRUidMenu ); |
|
1367 cenRep->Set( KMenuOpenItem, item1 ); |
|
1368 CleanupStack::PopAndDestroy( cenRep ); |
|
1369 } |
|
1370 CleanupStack::PopAndDestroy( uriBuf ); |
|
1371 } |
|
1372 |
1301 |
1373 // End of file |
1302 // End of file |