contentstorage/castorage/src/casqlquery.cpp
changeset 61 8e5041d13c84
parent 60 f62f87b200ec
child 66 32469d7d46ff
--- a/contentstorage/castorage/src/casqlquery.cpp	Fri Mar 19 09:35:23 2010 +0200
+++ b/contentstorage/castorage/src/casqlquery.cpp	Fri Apr 16 15:16:09 2010 +0300
@@ -516,25 +516,15 @@
         BindTextL( iStatement.ParameterIndex( KSQLIcFileName ),
                 aEntry->GetIcon().iFileName );
         }
-    if( iQuery.Find( KSQLIcBitmapId ) != KErrNotFound )
+    if( iQuery.Find( KSQLIcSkinId ) != KErrNotFound )
         {
-        BindIntL( iStatement.ParameterIndex( KSQLIcBitmapId ),
-                aEntry->GetIcon().iBitmapId );
-        }
-    if( iQuery.Find(KSQLIcMaskId) != KErrNotFound )
-        {
-        BindIntL( iStatement.ParameterIndex( KSQLIcMaskId ),
-                aEntry->GetIcon().iMaskId );
+        BindTextL( iStatement.ParameterIndex( KSQLIcSkinId ),
+                aEntry->GetIcon().iSkinId );
         }
-    if( iQuery.Find( KSQLIcSkinMajorId ) != KErrNotFound )
+    if( iQuery.Find( KSQLIcAppId ) != KErrNotFound )
         {
-        BindIntL( iStatement.ParameterIndex( KSQLIcSkinMajorId ),
-                aEntry->GetIcon().iSkinMajorId );
-        }
-    if( iQuery.Find( KSQLIcSkinMinorId ) != KErrNotFound )
-        {
-        BindIntL( iStatement.ParameterIndex( KSQLIcSkinMinorId ),
-                aEntry->GetIcon().iSkinMinorId );
+        BindTextL( iStatement.ParameterIndex( KSQLIcAppId ),
+                aEntry->GetIcon().iApplicationId );
         }
     }
 
@@ -674,28 +664,17 @@
     TInt rowCount(0);
     while( iStatement.Next() == KSqlAtRow )
         {
-        TInt entryId = iStatement.
-            ColumnInt( ColumnIndexL( iStatement, KColumnEntryId ) );
-        TInt role = iStatement.
-            ColumnInt( ColumnIndexL( iStatement, KColumnEnRole ) );
-        //        TODO get NULL ???
-        TInt32 uid = 
-        iStatement.ColumnInt( ColumnIndexL( iStatement, KColumnEnUid ) ) 
-        ? iStatement.ColumnInt( ColumnIndexL( iStatement, KColumnEnUid ) )
-        : 0;
-        TUint flags = iStatement.ColumnInt( ColumnIndexL( iStatement,
-                KColumnEnFlags ) );
-        TInt idIcon = iStatement.ColumnInt( ColumnIndexL( iStatement,
-                KColumnEnIdIcon ) );
-        TInt bitmapId = iStatement.ColumnInt( ColumnIndexL( iStatement,
-                KColumnIcBitmapId ) );
-        TInt maskId = iStatement.ColumnInt( ColumnIndexL( iStatement,
-                KColumnIcMaskId ) );
-        TInt skinMajorId = iStatement.ColumnInt( ColumnIndexL( iStatement,
-                KColumnIcSkinMajorId ) );
-        TInt skinMinorId = iStatement.ColumnInt( ColumnIndexL( iStatement,
-                KColumnIcSkinMinorId ) );
-
+        TInt entryId = iStatement.ColumnInt( 
+        		ColumnIndexL( iStatement, KColumnEntryId ) );
+        TInt role = iStatement.ColumnInt( 
+        		ColumnIndexL( iStatement, KColumnEnRole ) );
+        TInt32 uid = iStatement.ColumnInt( 
+        		ColumnIndexL( iStatement, KColumnEnUid ) );
+        TUint flags = iStatement.ColumnInt( 
+        		ColumnIndexL( iStatement, KColumnEnFlags ) );
+        TInt idIcon = iStatement.ColumnInt( 
+        		ColumnIndexL( iStatement, KColumnEnIdIcon ) );
+        
         TPtrC text;
         User::LeaveIfError( iStatement. ColumnText( ColumnIndexL(
                 iStatement, KColumnEnText ), text ) );
@@ -706,15 +685,24 @@
         TPtrC typeName;
         User::LeaveIfError( iStatement.ColumnText( 
                 ColumnIndexL(iStatement, KColumnEnTypeName ), typeName) );
+                
         TPtrC iconFilename;
         User::LeaveIfError( iStatement.ColumnText( ColumnIndexL(
                 iStatement, KColumnIcFileName ), iconFilename ) );
 
+        TPtrC iconSkinId;
+        User::LeaveIfError( iStatement.ColumnText( ColumnIndexL(
+                iStatement, KColumnIcSkinId ), iconSkinId ) );
+
+        TPtrC iconApplicationId;
+        User::LeaveIfError( iStatement.ColumnText( ColumnIndexL(
+                iStatement, KColumnIcAppId ), iconApplicationId ) );
+
         CCaInnerEntry* result = CCaInnerEntry::NewLC();
         result->SetId( entryId );
         result->SetRole( role );
-        result->SetIconDataL( bitmapId, maskId, skinMajorId, skinMinorId,
-                iconFilename );
+        result->SetIconDataL(
+                iconFilename, iconSkinId, iconApplicationId );
         result->SetIconId( idIcon );
         result->SetFlags( flags );
         result->SetUid( uid );
@@ -875,14 +863,12 @@
         User::LeaveIfError(iStatement.ColumnText(
                 ColumnIndexL( iStatement, KColumnIcFileName),
                 aIconAttributes.iFileName));
-        aIconAttributes.iBitmapId = iStatement.ColumnInt(
-                ColumnIndexL( iStatement, KColumnIcBitmapId ) );
-        aIconAttributes.iMaskId = iStatement.ColumnInt(
-                ColumnIndexL( iStatement, KColumnIcMaskId ) );
-        aIconAttributes.iSkinMajorId = iStatement.ColumnInt(
-                ColumnIndexL( iStatement, KColumnIcSkinMajorId ) );
-        aIconAttributes.iSkinMinorId = iStatement.ColumnInt(
-                ColumnIndexL( iStatement, KColumnIcSkinMinorId ) );
+        User::LeaveIfError(iStatement.ColumnText(
+                ColumnIndexL( iStatement, KColumnIcSkinId),
+                aIconAttributes.iSkinId));       
+        User::LeaveIfError(iStatement.ColumnText(
+                ColumnIndexL( iStatement, KColumnIcAppId),
+                aIconAttributes.iApplicationId));
         columnCount++;
         }
     return columnCount;