From 310c7dce0c9043f66725bc79449fe958a12ad459 Mon Sep 17 00:00:00 2001 From: eilers Date: Mon, 03 Jan 2005 16:44:42 +0000 Subject: Fixing stupid API documentation error. Moving hasQuerySettings() and querySettings up to OPimAccessTemplate to be available for all frontends.. --- (limited to 'libopie2/opiepim') diff --git a/libopie2/opiepim/ChangeLog b/libopie2/opiepim/ChangeLog index 2007744..320b189 100644 --- a/libopie2/opiepim/ChangeLog +++ b/libopie2/opiepim/ChangeLog @@ -1,3 +1,6 @@ +2005-01-03 Stefan Eilers + * Fixing bug in API documentation + * Moving hasQuerySettings() and querySettings() to OPimAccessTemplate to be available for all frontends 2004-12-28 Stefan Eilers * Make improved query by example accessable via frontend * Some API documentation improvement diff --git a/libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp b/libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp index 41b714e..629e4da 100644 --- a/libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp +++ b/libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp @@ -208,6 +208,7 @@ QArray ODateBookAccessBackend_SQL::allRecords()const } QArray ODateBookAccessBackend_SQL::queryByExample(const OPimEvent&, int, const QDateTime& ) { + qDebug( "Accessing ODateBookAccessBackend_SQL::queryByExample() which is not implemented!" ); return QArray(); } diff --git a/libopie2/opiepim/backend/otodoaccessbackend.cpp b/libopie2/opiepim/backend/otodoaccessbackend.cpp index f979976..c7ce123 100644 --- a/libopie2/opiepim/backend/otodoaccessbackend.cpp +++ b/libopie2/opiepim/backend/otodoaccessbackend.cpp @@ -54,7 +54,7 @@ bool OPimTodoAccessBackend::hasQuerySettings (uint querySettings) const UIDArray OPimTodoAccessBackend::queryByExample( const UIDArray& uidlist, const OPimTodo& query, int settings, - const QDateTime& endperiod )const + const QDateTime& startperiod )const { qDebug( "Accessing OPimTodoAccessBackend::queryByExample() which is not implemented!" ); return UIDArray(); diff --git a/libopie2/opiepim/backend/otodoaccessbackend.h b/libopie2/opiepim/backend/otodoaccessbackend.h index 870ee57..06cece3 100644 --- a/libopie2/opiepim/backend/otodoaccessbackend.h +++ b/libopie2/opiepim/backend/otodoaccessbackend.h @@ -64,7 +64,7 @@ public: */ bool hasQuerySettings (uint querySettings) const; - UIDArray queryByExample( const UIDArray& uidlist, const OPimTodo& query, int settings, const QDateTime& endperiod = QDateTime() )const; + UIDArray queryByExample( const UIDArray& uidlist, const OPimTodo& query, int settings, const QDateTime& startperiod = QDateTime() )const; UIDArray sorted( const UIDArray&, bool asc, int, int, const QArray& )const; OPimBackendOccurrence::List occurrences( const QDate&, const QDate& )const; //@} diff --git a/libopie2/opiepim/core/ocontactaccess.cpp b/libopie2/opiepim/core/ocontactaccess.cpp index 9bbc820..9d18d47 100644 --- a/libopie2/opiepim/core/ocontactaccess.cpp +++ b/libopie2/opiepim/core/ocontactaccess.cpp @@ -118,15 +118,6 @@ bool OPimContactAccess::save () return true; } -const uint OPimContactAccess::querySettings() -{ - return ( m_backEnd->querySettings() ); -} - -bool OPimContactAccess::hasQuerySettings ( int querySettings ) const -{ - return ( m_backEnd->hasQuerySettings ( querySettings ) ); -} #if 0 OPimRecordList OPimContactAccess::sorted( bool ascending, int sortOrder, int sortFilter, int cat ) const diff --git a/libopie2/opiepim/core/ocontactaccess.h b/libopie2/opiepim/core/ocontactaccess.h index 5051321..9a2ecaf 100644 --- a/libopie2/opiepim/core/ocontactaccess.h +++ b/libopie2/opiepim/core/ocontactaccess.h @@ -116,21 +116,6 @@ class OPimContactAccess: public QObject, public OPimAccessTemplate ~OPimContactAccess (); - /** - * Return all possible settings for queryByExample(). - * @return All settings provided by the current backend - * (i.e.: WildCards & IgnoreCase) - * @see QuerySettings in OPimBase for details of the parameter, queryByExample() - */ - const uint querySettings(); - - /** - * Check whether settings are correct for queryByExample(). - * @return true if the given settings are correct and possible. - * @see QuerySettings in OPimBase for details of the parameter - */ - bool hasQuerySettings ( int querySettings ) const; - /** * if the resource was changed externally. * You should use the signal instead of polling possible changes ! diff --git a/libopie2/opiepim/core/opimaccesstemplate.h b/libopie2/opiepim/core/opimaccesstemplate.h index 3875f09..823f03d 100644 --- a/libopie2/opiepim/core/opimaccesstemplate.h +++ b/libopie2/opiepim/core/opimaccesstemplate.h @@ -87,45 +87,60 @@ public: virtual List allRecords()const; virtual List matchRegexp( const QRegExp &r ) const; + /** + * Return all possible settings for queryByExample(). + * @return All settings provided by the current backend + * (i.e.: WildCards & IgnoreCase) + * @see QuerySettings in OPimBase for details of the parameter, queryByExample() + */ + const uint querySettings(); + + /** + * Check whether settings are correct for queryByExample(). + * @return true if the given settings are correct and possible. + * @see QuerySettings in OPimBase for details of the parameter + */ + bool hasQuerySettings ( int querySettings ) const; + /** * Query by example search interface. * "Query by Example" provides a very powerful search engine. Use the query object * (this may be a contact, a todo or databook event) * as a search mask which is converted into a query regarding the querySettings. If a time period is needed - * (as for OpimBase::DateDiff), you have to use the date/time in the query object and the endperiod (the last parameter). + * (as for OpimBase::DateDiff), you have to use the date/time in the query object and the startperiod (the last parameter). * @see QuerySettings in class OPimBase * @param query The object which contains the query set * @param querySettings This parameter defines what should be searched and how the query should be interpreted - * @param endperiod Defines the end of a period for some special queries. + * @param startperiod Defines the start of a period for some special queries. */ - virtual List queryByExample( const T& query, int querySettings, const QDateTime& endperiod = QDateTime() ); + virtual List queryByExample( const T& query, int querySettings, const QDateTime& startperiod = QDateTime() ); /** * Generic query by example search interface. This is a special version which handles generic OPimRecord types. They are converted * automatically into the right datatype. * "Query by Example" provides a very powerful search engine. Use the query object (this may be a contact, a todo or databook event) * as a search mask which is converted into a query regarding the querySettings. If a time period is needed - * (as for OpimBase::DateDiff), you have to use the date/time in the query object and the endperiod (the last parameter). + * (as for OpimBase::DateDiff), you have to use the date/time in the query object and the startperiod (the last parameter). * @see QuerySettings in class OPimBase * @param query The object which contains the query set * @param querySettings This parameter defines what should be searched and how the query should be interpreted - * @param endperiod Defines the end of a period for some special queries. + * @param startperiod Defines the start of a period for some special queries. */ - virtual List queryByExample( const OPimRecord* query, int querySettings, const QDateTime& endperiod = QDateTime() ); + virtual List queryByExample( const OPimRecord* query, int querySettings, const QDateTime& startperiod = QDateTime() ); /** * Incremental query by example search interface. Providing incremental search, this one provides the feature * to search in a list of records which may be returned by an other search. * "Query by Example" provides a very powerful search engine. Use the query object (this may be a contact, a todo or databook event) * as a search mask which is converted into a query regarding the querySettings. If a time period is needed - * (as for OpimBase::DateDiff), you have to use the date/time in the query object and the endperiod (the last parameter). + * (as for OpimBase::DateDiff), you have to use the date/time in the query object and the startperiod (the last parameter). * @see QuerySettings in class OPimBase * @param uidlist List of uid's which should be incorporated into the next search * @param query The object which contains the query set * @param querySettings This parameter defines what should be searched and how the query should be interpreted - * @param endperiod Defines the end of a period for some special queries. + * @param startperiod Defines the start of a period for some special queries. */ virtual List queryByExample( const OPimAccessTemplate::List& uidlist, const T& query, int querySettings, - const QDateTime& endperiod = QDateTime() ); + const QDateTime& startperiod = QDateTime() ); virtual T find( UID uid )const; virtual T find( UID uid, const QArray&, @@ -308,6 +323,16 @@ QArray OPimAccessTemplate::records()const { return m_backEnd->allRecords(); } +template +const uint OPimAccessTemplate::querySettings(){ + return m_backEnd->querySettings(); +} + +template +bool OPimAccessTemplate::hasQuerySettings ( int querySettings ) const { + return m_backEnd->hasQuerySettings( querySettings ); +} + template typename OPimAccessTemplate::List -- cgit v0.9.0.2