1 /* |
1 /* |
2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of "Eclipse Public License v1.0" |
5 * under the terms of "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
177 // As notifiers can be more than two types such as warning, error, indicator ... |
177 // As notifiers can be more than two types such as warning, error, indicator ... |
178 // to create concret notifiers according to categories instead of checking aObserver null |
178 // to create concret notifiers according to categories instead of checking aObserver null |
179 CUsbNotifier* notifier(NULL); |
179 CUsbNotifier* notifier(NULL); |
180 if (aCat == KUsbUiNotifOtgError) |
180 if (aCat == KUsbUiNotifOtgError) |
181 { |
181 { |
182 __ASSERT_ALWAYS(aObserver != NULL, Panic(EWrongNotifierCategory)); |
182 ASSERT_PANIC(aObserver != NULL, EWrongNotifierCategory); |
183 notifier = CUsbWaitNotifier::NewL(iNotifier, *this, aNotifId); |
183 notifier = CUsbWaitNotifier::NewL(iNotifier, *this, aNotifId); |
184 } |
184 } |
185 else if (aCat == KUsbUiNotifOtgWarning) |
185 else if (aCat == KUsbUiNotifOtgWarning) |
186 { |
186 { |
187 notifier = CUsbWarningNotifier::NewL(iNotifier, *this, aNotifId); |
187 notifier = CUsbWarningNotifier::NewL(iNotifier, *this, aNotifId); |
188 } |
188 } |
189 else |
189 else |
190 { |
190 { |
191 LOG1("Unexpected aCat = 0x%X", aCat ); |
191 LOG1("Unexpected aCat = 0x%X", aCat ); |
192 Panic(EWrongNotifierCategory); |
192 PANIC(EWrongNotifierCategory); |
193 } |
193 } |
194 |
194 |
195 CleanupStack::PushL(notifier); |
195 CleanupStack::PushL(notifier); |
196 |
196 |
197 iWaitNotifiers.AppendL(CWaitNotifierInfo::NewL(notifier, *aObserver)); |
197 iWaitNotifiers.AppendL(CWaitNotifierInfo::NewL(notifier, *aObserver)); |