summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/ChangeLog1
-rw-r--r--libopie2/opiepim/backend/opimaccessbackend.h1
2 files changed, 2 insertions, 0 deletions
diff --git a/libopie2/opiepim/ChangeLog b/libopie2/opiepim/ChangeLog
index a1b4db0..84517fb 100644
--- a/libopie2/opiepim/ChangeLog
+++ b/libopie2/opiepim/ChangeLog
@@ -1,33 +1,34 @@
2005-03.19 Stefan Eilers <stefan@eilers-online.net>
* Minor update for sorted(). Now ignoring any category search if "DoNotShowWithCategory" filter is activated.
+ * Fixing uninitialized member variable, caused crash of backend
2005-03-18 Stefan Eilers <stefan@eilers-online.net>
* Rewrote generic sorted filter and added filter for "DoNotShowWithCategory", needed by addressbook (other filters need to be added!)
2005-01-16 Stefan Eilers <stefan@eilers-online.net>
* Added new OPimEventSortVector class, improved OPimSortVector
* OPimAccessBackend now supports generic sorting.
2005-01-03 Stefan Eilers <stefan@eilers-online.net>
* Fixing bug in API documentation
* Moving hasQuerySettings() and querySettings() to OPimAccessTemplate to be available for all frontends
2004-12-28 Stefan Eilers <stefan@eilers-online.net>
* Make improved query by example accessable via frontend
* Some API documentation improvement
* Cleanup of backend api..
* Fixing bug #1501
2004-11-23 Stefan Eilers <stefan@eilers-online.net>
* Implement fast and full featured version of sorted() for addressbook
* Implement generic queryByExample for all Addressboook backends. It allows incremental search.
* Update of API Documentation
2004-11-18 Holger Freyther <freyther@handhelds.org>
* Every Access can give a set of Occurrences for a period or a datetime
* QueryByExample, Find, Sort can be generically accessed by OPimBase
pointer interface
* OPimBackendOccurrence gets split up to OPimOccurrences by
OPimTemplateBase
* Add safeCast to various OPimRecords
* Kill memleak in OPimTodo
* Add SortVector implementations for OPimTodo and OPimContact
2004-??-?? The Opie Team <opie@handhelds.org>
* Implemented some important modifications to allow to use OPimRecords as it is, without
have to cast them. This makes it possible to write applications which handling pim
data in a generic manner (see opimconvertion tool) (eilers) \ No newline at end of file
diff --git a/libopie2/opiepim/backend/opimaccessbackend.h b/libopie2/opiepim/backend/opimaccessbackend.h
index 6666fd6..71f81f4 100644
--- a/libopie2/opiepim/backend/opimaccessbackend.h
+++ b/libopie2/opiepim/backend/opimaccessbackend.h
@@ -97,96 +97,97 @@ public:
virtual UIDArray sorted( bool asc, int sortOrder, int sortFilter, const QArray<int>& cats )const;
virtual OPimBackendOccurrence::List occurrences( const QDate& start, const QDate& end)const;
virtual OPimBackendOccurrence::List occurrences( const QDateTime& dt )const;
//@}
//@{
virtual T find(UID uid )const = 0;
virtual T find(UID uid, const QArray<UID>& items,
uint current, typename Frontend::CacheDirection )const ;
//@}
//@{
virtual bool add( const T& t ) = 0;
virtual bool remove( UID uid ) = 0;
virtual bool replace( const T& t ) = 0;
//@}
void setFrontend( Frontend* front );
/**
* set the read ahead count
*/
void setReadAhead( uint count );
protected:
//@{
int access()const;
void cache( const T& t )const;
void setSaneCacheSize( int );
uint readAhead()const;
//@}
private:
OPimAccessBackendPrivate *d;
Frontend* m_front;
uint m_read;
int m_acc;
};
template <class T>
OPimAccessBackend<T>::OPimAccessBackend(int acc)
: m_acc( acc )
{
m_front = 0l;
+ m_read = 20;
}
template <class T>
OPimAccessBackend<T>::~OPimAccessBackend() {
}
/*
* Slow but default matchRegexp Implementation
* Create a Big Enough QArray and then iterate
* over all Records and matchRegexp them.
* At the end we will resize the array to the actual
* number of items
*/
template <class T>
UIDArray OPimAccessBackend<T>::matchRegexp( const QRegExp& reg )const {
UIDArray all_rec = allRecords();
UIDArray result( all_rec.count() );
uint used_records = 0, all_rec_count = all_rec.count();
for ( uint i = 0; i < all_rec_count; ++i )
if (find( all_rec[i], all_rec, i, Frontend::Forward ).match( reg ) )
result[used_records++] = all_rec[i];
/* shrink to fit */
result.resize( used_records );
return result;
}
template <class T>
UIDArray OPimAccessBackend<T>::queryByExample( const T& rec, int settings,
const QDateTime& datetime )const {
return queryByExample( allRecords(), rec, settings, datetime );
}
template <class T>
UIDArray OPimAccessBackend<T>::queryByExample( const OPimRecord* rec, int settings,
const QDateTime& datetime )const {
T* tmp_rec = T::safeCast( rec );
UIDArray ar;
if ( tmp_rec )
ar = queryByExample( *tmp_rec, settings, datetime );
return ar;
}
template <class T>
UIDArray OPimAccessBackend<T>::sorted( bool asc, int order, int filter,