Diffstat (limited to 'libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp b/libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp index abfd944..221e977 100644 --- a/libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp +++ b/libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp | |||
@@ -842,6 +842,7 @@ OPimContact OPimContactAccessBackend_SQL::requestContactsAndCache( int uid, cons | |||
842 | // All contacts will be stored in the cache, afterwards the contact with the user id "uid" will be returned | 842 | // All contacts will be stored in the cache, afterwards the contact with the user id "uid" will be returned |
843 | // by using the cache.. | 843 | // by using the cache.. |
844 | QArray<int> cachelist = uidlist; | 844 | QArray<int> cachelist = uidlist; |
845 | OPimContact retContact; | ||
845 | 846 | ||
846 | odebug << "Reqest and cache" << cachelist.size() << "elements !" << oendl; | 847 | odebug << "Reqest and cache" << cachelist.size() << "elements !" << oendl; |
847 | 848 | ||
@@ -865,6 +866,8 @@ OPimContact OPimContactAccessBackend_SQL::requestContactsAndCache( int uid, cons | |||
865 | contact.setExtraMap( requestCustom( contact.uid() ) ); | 866 | contact.setExtraMap( requestCustom( contact.uid() ) ); |
866 | odebug << "Caching uid: " << contact.uid() << oendl; | 867 | odebug << "Caching uid: " << contact.uid() << oendl; |
867 | cache( contact ); | 868 | cache( contact ); |
869 | if ( contact.uid() == uid ) | ||
870 | retContact = contact; | ||
868 | resItem = res_noncustom.next(); | 871 | resItem = res_noncustom.next(); |
869 | } while ( ! res_noncustom.atEnd() ); //atEnd() is true if we are past(!) the list !! | 872 | } while ( ! res_noncustom.atEnd() ); //atEnd() is true if we are past(!) the list !! |
870 | t3needed = t3.elapsed(); | 873 | t3needed = t3.elapsed(); |
@@ -874,7 +877,7 @@ OPimContact OPimContactAccessBackend_SQL::requestContactsAndCache( int uid, cons | |||
874 | odebug << "RequestContactsAndCache needed: insg.:" << t.elapsed() << " ms, query: " << t2needed | 877 | odebug << "RequestContactsAndCache needed: insg.:" << t.elapsed() << " ms, query: " << t2needed |
875 | << " ms, mapping: " << t3needed << " ms" << oendl; | 878 | << " ms, mapping: " << t3needed << " ms" << oendl; |
876 | 879 | ||
877 | return cacheFind( uid ); | 880 | return retContact; |
878 | } | 881 | } |
879 | 882 | ||
880 | QMap<int, QString> OPimContactAccessBackend_SQL::fillNonCustomMap( const OSQLResultItem& resultItem ) const | 883 | QMap<int, QString> OPimContactAccessBackend_SQL::fillNonCustomMap( const OSQLResultItem& resultItem ) const |