contentstorage/castorage/src/casqlitestorage.cpp
changeset 66 32469d7d46ff
parent 61 8e5041d13c84
child 80 397d00875918
--- a/contentstorage/castorage/src/casqlitestorage.cpp	Fri Apr 16 15:16:09 2010 +0300
+++ b/contentstorage/castorage/src/casqlitestorage.cpp	Mon May 03 12:48:45 2010 +0300
@@ -500,12 +500,12 @@
             {
             //check if icon exists - just update
             CCaSqlQuery* query = CCaSqlQuery::NewLC( iSqlDb );
-            query->SetQueryL( KSQLGetIconId );
+            CaSqlQueryCreator::CreateFindIconQueryL(aEntry, query);
             query->SetTableType( CCaSqlQuery::EIconTable );
             query->PrepareL();
             query->BindValuesForGetIconL( aEntry );
-            CCaInnerEntry::TIconAttributes iconAttributes;
-            TInt countIcons = query->ExecuteL( iconAttributes );
+            TInt idIcon( 0 );
+            query->ExecuteL( idIcon );
             CleanupStack::PopAndDestroy( query );
 
             aSqlQuery[i]->PrepareL();
@@ -513,11 +513,10 @@
             TInt tmpId( 0 );
             TRAPD( err, tmpId = aSqlQuery[i]->ExecuteL() );
             aSqlQuery[i]->CloseStatement();
-            if( !countIcons && !aEntry->GetIconId() )
+            if( !idIcon && !aEntry->GetIconId() )
                 { // new icon added
                 aEntry->SetIconId( tmpId );
                 }
-
             if( err == KSqlErrConstraint )
                 {
                 // ignore, this means that the icon cannot be removed