--- a/phonebookengines/VirtualPhonebook/VPbkCntModel/src/CContactStoreInfo.cpp Wed Mar 31 21:13:53 2010 +0300
+++ b/phonebookengines/VirtualPhonebook/VPbkCntModel/src/CContactStoreInfo.cpp Wed Apr 14 15:45:35 2010 +0300
@@ -74,8 +74,7 @@
//
TInt CContactStoreInfo::NumberOfContactsL() const
{
- TInt groupCount = iStore.NativeDatabase().GroupCount();
- return iStore.NativeDatabase().CountL() - groupCount;
+ return iStore.NativeDatabase().CountL() - NumberOfGroupsL();
}
// -----------------------------------------------------------------------------
@@ -116,6 +115,14 @@
//
TInt CContactStoreInfo::NumberOfGroupsL() const
{
+ if( !iGroupsFetched )
+ {
+ CContactIdArray* arr = iStore.NativeDatabase().GetGroupIdListL();
+ iGroupsFetched = ETrue;
+ const TInt count = arr->Count();
+ delete arr;
+ return count;
+ }
return iStore.NativeDatabase().GroupCount();
}