author | eilers <eilers> | 2004-09-05 15:46:47 (UTC) |
---|---|---|
committer | eilers <eilers> | 2004-09-05 15:46:47 (UTC) |
commit | 97a40bb7f35a8323dd99712bf014387add283177 (patch) (side-by-side diff) | |
tree | ec50fbb430f00c86af6ca5bd7c6b94fa29cfe3b1 /libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp | |
parent | f8b02e2ae752ce98b8840735260c4e9b0ff25cb8 (diff) | |
download | opie-97a40bb7f35a8323dd99712bf014387add283177.zip opie-97a40bb7f35a8323dd99712bf014387add283177.tar.gz opie-97a40bb7f35a8323dd99712bf014387add283177.tar.bz2 |
Fixing really stupid caching bug.. Thanks to zecke who found it..
Removed cachefind in backend which isn't needed anymore and not a goot idea...
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 // All contacts will be stored in the cache, afterwards the contact with the user id "uid" will be returned // by using the cache.. QArray<int> cachelist = uidlist; + OPimContact retContact; odebug << "Reqest and cache" << cachelist.size() << "elements !" << oendl; @@ -865,6 +866,8 @@ OPimContact OPimContactAccessBackend_SQL::requestContactsAndCache( int uid, cons contact.setExtraMap( requestCustom( contact.uid() ) ); odebug << "Caching uid: " << contact.uid() << oendl; cache( contact ); + if ( contact.uid() == uid ) + retContact = contact; resItem = res_noncustom.next(); } while ( ! res_noncustom.atEnd() ); //atEnd() is true if we are past(!) the list !! t3needed = t3.elapsed(); @@ -874,7 +877,7 @@ OPimContact OPimContactAccessBackend_SQL::requestContactsAndCache( int uid, cons odebug << "RequestContactsAndCache needed: insg.:" << t.elapsed() << " ms, query: " << t2needed << " ms, mapping: " << t3needed << " ms" << oendl; - return cacheFind( uid ); + return retContact; } QMap<int, QString> OPimContactAccessBackend_SQL::fillNonCustomMap( const OSQLResultItem& resultItem ) const |