metadataengine/client/src/mdeasynchronousfindao.cpp
changeset 1 acef663c1218
parent 0 c53acadfccc6
child 8 6752808b2036
child 20 6dfc5f825351
--- a/metadataengine/client/src/mdeasynchronousfindao.cpp	Mon Jan 18 20:34:07 2010 +0200
+++ b/metadataengine/client/src/mdeasynchronousfindao.cpp	Tue Jan 26 12:13:20 2010 +0200
@@ -246,20 +246,30 @@
 
     const TQueryType mode = iQuery.Type();
 
-    if ( mode == EQueryTypeObject ) 
-        {
-        CMdEObjectQueryImpl& qi = (CMdEObjectQueryImpl&)iQuery;
-        qi.DoNotifyCompleted( aError );
-        }
-    else if ( mode == EQueryTypeRelation )
+    switch( mode )
         {
-        CMdERelationQueryImpl& qi = (CMdERelationQueryImpl&)iQuery;
-        qi.DoNotifyCompleted( aError );
-        }
-    else if ( mode == EQueryTypeEvent )
-        {
-        CMdEEventQueryImpl& qi = (CMdEEventQueryImpl&)iQuery;
-        qi.DoNotifyCompleted( aError );
+        case EQueryTypeObject: 
+            {
+            CMdEObjectQueryImpl& qi = (CMdEObjectQueryImpl&)iQuery;
+            qi.DoNotifyCompleted( aError );
+            break;
+            }
+        case EQueryTypeRelation:
+            {
+            CMdERelationQueryImpl& qi = (CMdERelationQueryImpl&)iQuery;
+            qi.DoNotifyCompleted( aError );
+            break;
+            }
+        case EQueryTypeEvent:
+            {
+            CMdEEventQueryImpl& qi = (CMdEEventQueryImpl&)iQuery;
+            qi.DoNotifyCompleted( aError );
+            break;
+            }
+        default:
+            {
+            return KErrNone;
+            }
         }
 
 	return KErrNone;
@@ -274,20 +284,30 @@
         {
         const TQueryType mode = iQuery.Type();
 
-        if ( mode == EQueryTypeObject )
-            {
-            CMdEObjectQueryImpl& qi = (CMdEObjectQueryImpl&)iQuery;
-            qi.DoNotifyResultsL( iResultList );
-            }
-        else if ( mode == EQueryTypeRelation )
+        switch( mode )
             {
-            CMdERelationQueryImpl& qi = (CMdERelationQueryImpl&)iQuery;
-            qi.DoNotifyResultsL( iResultList );
-            }
-        else if ( mode == EQueryTypeEvent )
-            {
-            CMdEEventQueryImpl& qi = (CMdEEventQueryImpl&)iQuery;
-            qi.DoNotifyResultsL( iResultList );
+            case EQueryTypeObject:
+                {
+                CMdEObjectQueryImpl& qi = (CMdEObjectQueryImpl&)iQuery;
+                qi.DoNotifyResultsL( iResultList );
+                break;
+                }
+            case EQueryTypeRelation:
+                {
+                CMdERelationQueryImpl& qi = (CMdERelationQueryImpl&)iQuery;
+                qi.DoNotifyResultsL( iResultList );
+                break;
+                }
+            case EQueryTypeEvent:
+                {
+                CMdEEventQueryImpl& qi = (CMdEEventQueryImpl&)iQuery;
+                qi.DoNotifyResultsL( iResultList );
+                break;
+                }
+            default:
+                {
+                // Nothing to do
+                }
             }
 
         // get rid of local results list
@@ -300,20 +320,30 @@
         {
         const TQueryType mode = iQuery.Type();
         
-        if ( mode == EQueryTypeObject )
-            {
-            CMdEObjectQueryImpl& qi = (CMdEObjectQueryImpl&)iQuery;
-            qi.DoNotifyResultsL( iIdResultList );
-            }
-        else if ( mode == EQueryTypeRelation )
+        switch( mode )
             {
-            CMdERelationQueryImpl& qi = (CMdERelationQueryImpl&)iQuery;
-            qi.DoNotifyResultsL( iIdResultList );
-            }
-        else if ( mode == EQueryTypeEvent )
-            {
-            CMdEEventQueryImpl& qi = (CMdEEventQueryImpl&)iQuery;
-            qi.DoNotifyResultsL( iIdResultList );
+            case EQueryTypeObject:
+                {
+                CMdEObjectQueryImpl& qi = (CMdEObjectQueryImpl&)iQuery;
+                qi.DoNotifyResultsL( iIdResultList );
+                break;
+                }
+            case EQueryTypeRelation:
+                {
+                CMdERelationQueryImpl& qi = (CMdERelationQueryImpl&)iQuery;
+                qi.DoNotifyResultsL( iIdResultList );
+                break;
+                }
+            case EQueryTypeEvent:
+                {
+                CMdEEventQueryImpl& qi = (CMdEEventQueryImpl&)iQuery;
+                qi.DoNotifyResultsL( iIdResultList );
+                break;
+                }
+            default:
+                {
+                // Nothing to do
+                }
             }
 
         // get rid of local results list
@@ -323,20 +353,30 @@
         {
         const TQueryType mode = iQuery.Type();
         
-        if ( mode == EQueryTypeObject )
-            {
-            CMdEObjectQueryImpl& qi = (CMdEObjectQueryImpl&)iQuery;
-            qi.DoNotifyResults( iCountResult );
-            }
-        else if ( mode == EQueryTypeRelation )
+        switch( mode )
             {
-            CMdERelationQueryImpl& qi = (CMdERelationQueryImpl&)iQuery;
-            qi.DoNotifyResults( iCountResult );
-            }
-        else if ( mode == EQueryTypeEvent )
-            {
-            CMdEEventQueryImpl& qi = (CMdEEventQueryImpl&)iQuery;
-            qi.DoNotifyResults( iCountResult );
+            case EQueryTypeObject:
+                {
+                CMdEObjectQueryImpl& qi = (CMdEObjectQueryImpl&)iQuery;
+                qi.DoNotifyResults( iCountResult );
+                break;
+                }
+            case EQueryTypeRelation:
+                {
+                CMdERelationQueryImpl& qi = (CMdERelationQueryImpl&)iQuery;
+                qi.DoNotifyResults( iCountResult );
+                break;
+                }
+            case EQueryTypeEvent:
+                {
+                CMdEEventQueryImpl& qi = (CMdEEventQueryImpl&)iQuery;
+                qi.DoNotifyResults( iCountResult );
+                break;
+                }
+            default:
+                {
+                // Nothing to do
+                }
             }
         }
     else if ( ( aStatus == EAsyncFindSetReady ||
@@ -365,20 +405,30 @@
         
         const TQueryType mode = iQuery.Type();
 
-        if ( mode == EQueryTypeObject ) 
-            {
-            CMdEObjectQueryImpl& qi = (CMdEObjectQueryImpl&)iQuery;
-            qi.DoNotifyCompleted( code );
-            }
-        else if ( mode == EQueryTypeRelation )
+        switch( mode )
             {
-            CMdERelationQueryImpl& qi = (CMdERelationQueryImpl&)iQuery;
-            qi.DoNotifyCompleted( code );
-            }
-        else if ( mode == EQueryTypeEvent )
-            {
-            CMdEEventQueryImpl& qi = (CMdEEventQueryImpl&)iQuery;
-            qi.DoNotifyCompleted( code );
+            case EQueryTypeObject:
+                {
+                CMdEObjectQueryImpl& qi = (CMdEObjectQueryImpl&)iQuery;
+                qi.DoNotifyCompleted( code );
+                break;
+                }
+            case EQueryTypeRelation:
+                {
+                CMdERelationQueryImpl& qi = (CMdERelationQueryImpl&)iQuery;
+                qi.DoNotifyCompleted( code );
+                break;
+                }
+            case EQueryTypeEvent:
+                {
+                CMdEEventQueryImpl& qi = (CMdEEventQueryImpl&)iQuery;
+                qi.DoNotifyCompleted( code );
+                break;
+                }
+            default:
+                {
+                // Nothing to do
+                }
             }
         }