23 files changed, 593 insertions, 593 deletions
diff --git a/libopie2/opiepim/backend/obackendfactory.h b/libopie2/opiepim/backend/obackendfactory.h index 346e2f5..06421d1 100644 --- a/libopie2/opiepim/backend/obackendfactory.h +++ b/libopie2/opiepim/backend/obackendfactory.h @@ -62,3 +62,3 @@ class OBackendPrivate; * <pre> - * OTodoAccessBackend* backend = OBackEndFactory<OTodoAccessBackend>::Default("todo", QString::null ); + * OPimTodoAccessBackend* backend = OBackEndFactory<OPimTodoAccessBackend>::Default("todo", QString::null ); * backend->load(); @@ -110,3 +110,3 @@ class OBackendFactory if ( backend == "sql" ) - return (T*) new OTodoAccessBackendSQL(""); + return (T*) new OPimTodoAccessBackendSQL(""); #else @@ -116,3 +116,3 @@ class OBackendFactory - return (T*) new OTodoAccessXML( appName ); + return (T*) new OPimTodoAccessXML( appName ); case CONTACT: @@ -120,3 +120,3 @@ class OBackendFactory if ( backend == "sql" ) - return (T*) new OContactAccessBackend_SQL(""); + return (T*) new OPimContactAccessBackend_SQL(""); #else @@ -126,3 +126,3 @@ class OBackendFactory - return (T*) new OContactAccessBackend_XML( appName ); + return (T*) new OPimContactAccessBackend_XML( appName ); case DATE: diff --git a/libopie2/opiepim/backend/ocontactaccessbackend.h b/libopie2/opiepim/backend/ocontactaccessbackend.h index 6113cea..8436adc 100644 --- a/libopie2/opiepim/backend/ocontactaccessbackend.h +++ b/libopie2/opiepim/backend/ocontactaccessbackend.h @@ -41,3 +41,3 @@ -#include <opie2/ocontact.h> +#include <opie2/opimcontact.h> #include <opie2/opimaccessbackend.h> @@ -54,6 +54,6 @@ namespace Opie { * - * @see OContactAccessBackend_VCard - * @see OContactAccessBackend_XML + * @see OPimContactAccessBackend_VCard + * @see OPimContactAccessBackend_XML */ -class OContactAccessBackend: public OPimAccessBackend<OContact> { +class OPimContactAccessBackend: public OPimAccessBackend<OPimContact> { public: @@ -62,3 +62,3 @@ class OContactAccessBackend: public OPimAccessBackend<OContact> { */ - OContactAccessBackend() {} + OPimContactAccessBackend() {} /** @@ -66,3 +66,3 @@ class OContactAccessBackend: public OPimAccessBackend<OContact> { */ - virtual ~OContactAccessBackend() {} + virtual ~OPimContactAccessBackend() {} diff --git a/libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp b/libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp index d0c8052..f121cc2 100644 --- a/libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp +++ b/libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp @@ -41,4 +41,4 @@ -#include <opie2/ocontactfields.h> -#include <opie2/oconversion.h> +#include <opie2/opimcontactfields.h> +#include <opie2/opimdateconversion.h> #include <opie2/osqldriver.h> @@ -107,3 +107,3 @@ namespace Opie { /** - * inserts/adds a OContact to the table + * inserts/adds a OPimContact to the table */ @@ -111,3 +111,3 @@ namespace Opie { public: - InsertQuery(const OContact& ); + InsertQuery(const OPimContact& ); ~InsertQuery(); @@ -115,3 +115,3 @@ namespace Opie { private: - OContact m_contact; + OPimContact m_contact; }; @@ -178,3 +178,3 @@ namespace Opie { - QStringList fieldList = OContactFields::untrfields( false ); + QStringList fieldList = OPimContactFields::untrfields( false ); for ( QStringList::Iterator it = ++fieldList.begin(); it != fieldList.end(); ++it ){ @@ -225,3 +225,3 @@ namespace Opie { - InsertQuery::InsertQuery( const OContact& contact ) + InsertQuery::InsertQuery( const OPimContact& contact ) : OSQLQuery(), m_contact( contact ) { @@ -233,3 +233,3 @@ namespace Opie { /* - * converts from a OContact to a query + * converts from a OPimContact to a query */ @@ -246,4 +246,4 @@ namespace Opie { - QStringList fieldList = OContactFields::untrfields( false ); - QMap<QString, int> translate = OContactFields::untrFieldsToId(); + QStringList fieldList = OPimContactFields::untrfields( false ); + QMap<QString, int> translate = OPimContactFields::untrFieldsToId(); for ( QStringList::Iterator it = ++fieldList.begin(); it != fieldList.end(); ++it ){ @@ -297,3 +297,3 @@ namespace Opie { // Get the translation from the ID to the String - QMap<int, QString> transMap = OContactFields::idToUntrFields(); + QMap<int, QString> transMap = OPimContactFields::idToUntrFields(); @@ -461,7 +461,7 @@ namespace Opie { -OContactAccessBackend_SQL::OContactAccessBackend_SQL ( const QString& /* appname */, +OPimContactAccessBackend_SQL::OPimContactAccessBackend_SQL ( const QString& /* appname */, const QString& filename ): - OContactAccessBackend(), m_changed(false), m_driver( NULL ) + OPimContactAccessBackend(), m_changed(false), m_driver( NULL ) { - qWarning("C'tor OContactAccessBackend_SQL starts"); + qWarning("C'tor OPimContactAccessBackend_SQL starts"); QTime t; @@ -482,6 +482,6 @@ OContactAccessBackend_SQL::OContactAccessBackend_SQL ( const QString& /* appname - qWarning("C'tor OContactAccessBackend_SQL ends: %d ms", t.elapsed() ); + qWarning("C'tor OPimContactAccessBackend_SQL ends: %d ms", t.elapsed() ); } -OContactAccessBackend_SQL::~OContactAccessBackend_SQL () +OPimContactAccessBackend_SQL::~OPimContactAccessBackend_SQL () { @@ -491,3 +491,3 @@ OContactAccessBackend_SQL::~OContactAccessBackend_SQL () -bool OContactAccessBackend_SQL::load () +bool OPimContactAccessBackend_SQL::load () { @@ -508,3 +508,3 @@ bool OContactAccessBackend_SQL::load () -bool OContactAccessBackend_SQL::reload() +bool OPimContactAccessBackend_SQL::reload() { @@ -513,3 +513,3 @@ bool OContactAccessBackend_SQL::reload() -bool OContactAccessBackend_SQL::save() +bool OPimContactAccessBackend_SQL::save() { @@ -519,3 +519,3 @@ bool OContactAccessBackend_SQL::save() -void OContactAccessBackend_SQL::clear () +void OPimContactAccessBackend_SQL::clear () { @@ -527,3 +527,3 @@ void OContactAccessBackend_SQL::clear () -bool OContactAccessBackend_SQL::wasChangedExternally() +bool OPimContactAccessBackend_SQL::wasChangedExternally() { @@ -532,3 +532,3 @@ bool OContactAccessBackend_SQL::wasChangedExternally() -QArray<int> OContactAccessBackend_SQL::allRecords() const +QArray<int> OPimContactAccessBackend_SQL::allRecords() const { @@ -538,3 +538,3 @@ QArray<int> OContactAccessBackend_SQL::allRecords() const if ( m_changed ) - ((OContactAccessBackend_SQL*)this)->update(); + ((OPimContactAccessBackend_SQL*)this)->update(); @@ -543,3 +543,3 @@ QArray<int> OContactAccessBackend_SQL::allRecords() const -bool OContactAccessBackend_SQL::add ( const OContact &newcontact ) +bool OPimContactAccessBackend_SQL::add ( const OPimContact &newcontact ) { @@ -559,3 +559,3 @@ bool OContactAccessBackend_SQL::add ( const OContact &newcontact ) -bool OContactAccessBackend_SQL::remove ( int uid ) +bool OPimContactAccessBackend_SQL::remove ( int uid ) { @@ -572,3 +572,3 @@ bool OContactAccessBackend_SQL::remove ( int uid ) -bool OContactAccessBackend_SQL::replace ( const OContact &contact ) +bool OPimContactAccessBackend_SQL::replace ( const OPimContact &contact ) { @@ -581,5 +581,5 @@ bool OContactAccessBackend_SQL::replace ( const OContact &contact ) -OContact OContactAccessBackend_SQL::find ( int uid ) const +OPimContact OPimContactAccessBackend_SQL::find ( int uid ) const { - qWarning("OContactAccessBackend_SQL::find()"); + qWarning("OPimContactAccessBackend_SQL::find()"); QTime t; @@ -587,6 +587,6 @@ OContact OContactAccessBackend_SQL::find ( int uid ) const - OContact retContact( requestNonCustom( uid ) ); + OPimContact retContact( requestNonCustom( uid ) ); retContact.setExtraMap( requestCustom( uid ) ); - qWarning("OContactAccessBackend_SQL::find() needed: %d ms", t.elapsed() ); + qWarning("OPimContactAccessBackend_SQL::find() needed: %d ms", t.elapsed() ); return retContact; @@ -596,3 +596,3 @@ OContact OContactAccessBackend_SQL::find ( int uid ) const -QArray<int> OContactAccessBackend_SQL::queryByExample ( const OContact &query, int settings, const QDateTime& d = QDateTime() ) +QArray<int> OPimContactAccessBackend_SQL::queryByExample ( const OPimContact &query, int settings, const QDateTime& d = QDateTime() ) { @@ -601,4 +601,4 @@ QArray<int> OContactAccessBackend_SQL::queryByExample ( const OContact &query, i QMap<int, QString> queryFields = query.toMap(); - QStringList fieldList = OContactFields::untrfields( false ); - QMap<QString, int> translate = OContactFields::untrFieldsToId(); + QStringList fieldList = OPimContactFields::untrfields( false ); + QMap<QString, int> translate = OPimContactFields::untrFieldsToId(); @@ -616,3 +616,3 @@ QArray<int> OContactAccessBackend_SQL::queryByExample ( const OContact &query, i // Do exist a better solution to switch this ? - if ( settings & OContactAccess::IgnoreCase ) + if ( settings & OPimContactAccess::IgnoreCase ) qu += "(\"" + *it + "\"" + " LIKE " + "'" @@ -645,3 +645,3 @@ QArray<int> OContactAccessBackend_SQL::queryByExample ( const OContact &query, i -QArray<int> OContactAccessBackend_SQL::matchRegexp( const QRegExp &r ) const +QArray<int> OPimContactAccessBackend_SQL::matchRegexp( const QRegExp &r ) const { @@ -651,11 +651,11 @@ QArray<int> OContactAccessBackend_SQL::matchRegexp( const QRegExp &r ) const -const uint OContactAccessBackend_SQL::querySettings() +const uint OPimContactAccessBackend_SQL::querySettings() { - return OContactAccess::IgnoreCase - || OContactAccess::WildCards; + return OPimContactAccess::IgnoreCase + || OPimContactAccess::WildCards; } -bool OContactAccessBackend_SQL::hasQuerySettings (uint querySettings) const +bool OPimContactAccessBackend_SQL::hasQuerySettings (uint querySettings) const { - /* OContactAccess::IgnoreCase, DateDiff, DateYear, DateMonth, DateDay + /* OPimContactAccess::IgnoreCase, DateDiff, DateYear, DateMonth, DateDay * may be added with any of the other settings. IgnoreCase should never used alone. @@ -666,10 +666,10 @@ bool OContactAccessBackend_SQL::hasQuerySettings (uint querySettings) const if ( ( querySettings & ( - OContactAccess::IgnoreCase - | OContactAccess::WildCards -// | OContactAccess::DateDiff -// | OContactAccess::DateYear -// | OContactAccess::DateMonth -// | OContactAccess::DateDay -// | OContactAccess::RegExp -// | OContactAccess::ExactMatch + OPimContactAccess::IgnoreCase + | OPimContactAccess::WildCards +// | OPimContactAccess::DateDiff +// | OPimContactAccess::DateYear +// | OPimContactAccess::DateMonth +// | OPimContactAccess::DateDay +// | OPimContactAccess::RegExp +// | OPimContactAccess::ExactMatch ) ) != querySettings ) @@ -680,3 +680,3 @@ bool OContactAccessBackend_SQL::hasQuerySettings (uint querySettings) const // IngoreCase alone is invalid - if ( querySettings == OContactAccess::IgnoreCase ) + if ( querySettings == OPimContactAccess::IgnoreCase ) return false; @@ -684,14 +684,14 @@ bool OContactAccessBackend_SQL::hasQuerySettings (uint querySettings) const // WildCards, RegExp and ExactMatch should never used at the same time - switch ( querySettings & ~( OContactAccess::IgnoreCase - | OContactAccess::DateDiff - | OContactAccess::DateYear - | OContactAccess::DateMonth - | OContactAccess::DateDay + switch ( querySettings & ~( OPimContactAccess::IgnoreCase + | OPimContactAccess::DateDiff + | OPimContactAccess::DateYear + | OPimContactAccess::DateMonth + | OPimContactAccess::DateDay ) ){ - case OContactAccess::RegExp: + case OPimContactAccess::RegExp: return ( true ); - case OContactAccess::WildCards: + case OPimContactAccess::WildCards: return ( true ); - case OContactAccess::ExactMatch: + case OPimContactAccess::ExactMatch: return ( true ); @@ -705,3 +705,3 @@ bool OContactAccessBackend_SQL::hasQuerySettings (uint querySettings) const -QArray<int> OContactAccessBackend_SQL::sorted( bool asc, int , int , int ) +QArray<int> OPimContactAccessBackend_SQL::sorted( bool asc, int , int , int ) { @@ -737,3 +737,3 @@ QArray<int> OContactAccessBackend_SQL::sorted( bool asc, int , int , int ) -void OContactAccessBackend_SQL::update() +void OPimContactAccessBackend_SQL::update() { @@ -758,3 +758,3 @@ void OContactAccessBackend_SQL::update() -QArray<int> OContactAccessBackend_SQL::extractUids( OSQLResult& res ) const +QArray<int> OPimContactAccessBackend_SQL::extractUids( OSQLResult& res ) const { @@ -780,3 +780,3 @@ QArray<int> OContactAccessBackend_SQL::extractUids( OSQLResult& res ) const #ifdef __STORE_HORIZONTAL_ -QMap<int, QString> OContactAccessBackend_SQL::requestNonCustom( int uid ) const +QMap<int, QString> OPimContactAccessBackend_SQL::requestNonCustom( int uid ) const { @@ -800,4 +800,4 @@ QMap<int, QString> OContactAccessBackend_SQL::requestNonCustom( int uid ) const // Now loop through all columns - QStringList fieldList = OContactFields::untrfields( false ); - QMap<QString, int> translate = OContactFields::untrFieldsToId(); + QStringList fieldList = OPimContactFields::untrfields( false ); + QMap<QString, int> translate = OPimContactFields::untrFieldsToId(); for ( QStringList::Iterator it = ++fieldList.begin(); it != fieldList.end(); ++it ){ @@ -822,3 +822,3 @@ QMap<int, QString> OContactAccessBackend_SQL::requestNonCustom( int uid ) const QDate date( year, month, day ); - nonCustomMap.insert( id, OConversion::dateToString( date ) ); + nonCustomMap.insert( id, OPimDateConversion::dateToString( date ) ); } @@ -845,3 +845,3 @@ QMap<int, QString> OContactAccessBackend_SQL::requestNonCustom( int uid ) const -QMap<int, QString> OContactAccessBackend_SQL::requestNonCustom( int uid ) const +QMap<int, QString> OPimContactAccessBackend_SQL::requestNonCustom( int uid ) const { @@ -868,3 +868,3 @@ QMap<int, QString> OContactAccessBackend_SQL::requestNonCustom( int uid ) const t3.start(); - QMap<QString, int> translateMap = OContactFields::untrFieldsToId(); + QMap<QString, int> translateMap = OPimContactFields::untrFieldsToId(); @@ -889,3 +889,3 @@ QMap<int, QString> OContactAccessBackend_SQL::requestNonCustom( int uid ) const QDate date( year, month, day ); - nonCustomMap.insert( typeId, OConversion::dateToString( date ) ); + nonCustomMap.insert( typeId, OPimDateConversion::dateToString( date ) ); } @@ -908,3 +908,3 @@ QMap<int, QString> OContactAccessBackend_SQL::requestNonCustom( int uid ) const -QMap<QString, QString> OContactAccessBackend_SQL::requestCustom( int uid ) const +QMap<QString, QString> OPimContactAccessBackend_SQL::requestCustom( int uid ) const { diff --git a/libopie2/opiepim/backend/ocontactaccessbackend_sql.h b/libopie2/opiepim/backend/ocontactaccessbackend_sql.h index 55b95fd..58ae2ae 100644 --- a/libopie2/opiepim/backend/ocontactaccessbackend_sql.h +++ b/libopie2/opiepim/backend/ocontactaccessbackend_sql.h @@ -32,4 +32,4 @@ -#ifndef _OContactAccessBackend_SQL_ -#define _OContactAccessBackend_SQL_ +#ifndef _OPimContactAccessBackend_SQL_ +#define _OPimContactAccessBackend_SQL_ @@ -51,10 +51,10 @@ namespace Opie { * This class is the SQL implementation of a Contact backend - * it does implement everything available for OContact. + * it does implement everything available for OPimContact. * @see OPimAccessBackend for more information of available methods */ -class OContactAccessBackend_SQL : public OContactAccessBackend { +class OPimContactAccessBackend_SQL : public OPimContactAccessBackend { public: - OContactAccessBackend_SQL ( const QString& appname, const QString& filename = QString::null ); + OPimContactAccessBackend_SQL ( const QString& appname, const QString& filename = QString::null ); - ~OContactAccessBackend_SQL (); + ~OPimContactAccessBackend_SQL (); @@ -70,7 +70,7 @@ class OContactAccessBackend_SQL : public OContactAccessBackend { - OContact find ( int uid ) const; + OPimContact find ( int uid ) const; // FIXME: Add lookahead-cache support ! - //OContact find(int uid, const QArray<int>&, uint cur, Frontend::CacheDirection )const; + //OPimContact find(int uid, const QArray<int>&, uint cur, Frontend::CacheDirection )const; - QArray<int> queryByExample ( const OContact &query, int settings, + QArray<int> queryByExample ( const OPimContact &query, int settings, const QDateTime& d ); @@ -85,5 +85,5 @@ class OContactAccessBackend_SQL : public OContactAccessBackend { QArray<int> sorted( bool asc, int , int , int ); - bool add ( const OContact &newcontact ); + bool add ( const OPimContact &newcontact ); - bool replace ( const OContact &contact ); + bool replace ( const OPimContact &contact ); diff --git a/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp b/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp index f85cf38..b569f8b 100644 --- a/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp +++ b/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp @@ -41,3 +41,3 @@ namespace Opie { -OContactAccessBackend_VCard::OContactAccessBackend_VCard ( const QString& , const QString& filename ): +OPimContactAccessBackend_VCard::OPimContactAccessBackend_VCard ( const QString& , const QString& filename ): m_dirty( false ), @@ -49,3 +49,3 @@ OContactAccessBackend_VCard::OContactAccessBackend_VCard ( const QString& , cons -bool OContactAccessBackend_VCard::load () +bool OPimContactAccessBackend_VCard::load () { @@ -66,3 +66,3 @@ bool OContactAccessBackend_VCard::load () while ( obj ) { - OContact con = parseVObject( obj ); + OPimContact con = parseVObject( obj ); /* @@ -87,3 +87,3 @@ bool OContactAccessBackend_VCard::load () } -bool OContactAccessBackend_VCard::reload() +bool OPimContactAccessBackend_VCard::reload() { @@ -91,3 +91,3 @@ bool OContactAccessBackend_VCard::reload() } -bool OContactAccessBackend_VCard::save() +bool OPimContactAccessBackend_VCard::save() { @@ -105,3 +105,3 @@ bool OContactAccessBackend_VCard::save() VObject *vo; - for(QMap<int, OContact>::ConstIterator it=m_map.begin(); it !=m_map.end(); ++it ){ + for(QMap<int, OPimContact>::ConstIterator it=m_map.begin(); it !=m_map.end(); ++it ){ vo = createVObject( *it ); @@ -118,3 +118,3 @@ bool OContactAccessBackend_VCard::save() } -void OContactAccessBackend_VCard::clear () +void OPimContactAccessBackend_VCard::clear () { @@ -124,3 +124,3 @@ void OContactAccessBackend_VCard::clear () -bool OContactAccessBackend_VCard::add ( const OContact& newcontact ) +bool OPimContactAccessBackend_VCard::add ( const OPimContact& newcontact ) { @@ -131,3 +131,3 @@ bool OContactAccessBackend_VCard::add ( const OContact& newcontact ) -bool OContactAccessBackend_VCard::remove ( int uid ) +bool OPimContactAccessBackend_VCard::remove ( int uid ) { @@ -138,3 +138,3 @@ bool OContactAccessBackend_VCard::remove ( int uid ) -bool OContactAccessBackend_VCard::replace ( const OContact &contact ) +bool OPimContactAccessBackend_VCard::replace ( const OPimContact &contact ) { @@ -145,3 +145,3 @@ bool OContactAccessBackend_VCard::replace ( const OContact &contact ) -OContact OContactAccessBackend_VCard::find ( int uid ) const +OPimContact OPimContactAccessBackend_VCard::find ( int uid ) const { @@ -150,6 +150,6 @@ OContact OContactAccessBackend_VCard::find ( int uid ) const -QArray<int> OContactAccessBackend_VCard::allRecords() const +QArray<int> OPimContactAccessBackend_VCard::allRecords() const { QArray<int> ar( m_map.count() ); - QMap<int, OContact>::ConstIterator it; + QMap<int, OPimContact>::ConstIterator it; int i = 0; @@ -163,3 +163,3 @@ QArray<int> OContactAccessBackend_VCard::allRecords() const // Not implemented -QArray<int> OContactAccessBackend_VCard::queryByExample ( const OContact&, int, const QDateTime& ) +QArray<int> OPimContactAccessBackend_VCard::queryByExample ( const OPimContact&, int, const QDateTime& ) { @@ -170,3 +170,3 @@ QArray<int> OContactAccessBackend_VCard::queryByExample ( const OContact&, int, // Not implemented -QArray<int> OContactAccessBackend_VCard::matchRegexp( const QRegExp& ) const +QArray<int> OPimContactAccessBackend_VCard::matchRegexp( const QRegExp& ) const { @@ -176,3 +176,3 @@ QArray<int> OContactAccessBackend_VCard::matchRegexp( const QRegExp& ) const -const uint OContactAccessBackend_VCard::querySettings() +const uint OPimContactAccessBackend_VCard::querySettings() { @@ -181,3 +181,3 @@ const uint OContactAccessBackend_VCard::querySettings() -bool OContactAccessBackend_VCard::hasQuerySettings (uint ) const +bool OPimContactAccessBackend_VCard::hasQuerySettings (uint ) const { @@ -186,3 +186,3 @@ bool OContactAccessBackend_VCard::hasQuerySettings (uint ) const -bool OContactAccessBackend_VCard::wasChangedExternally() +bool OPimContactAccessBackend_VCard::wasChangedExternally() { @@ -192,3 +192,3 @@ bool OContactAccessBackend_VCard::wasChangedExternally() // Not implemented -QArray<int> OContactAccessBackend_VCard::sorted( bool , int, int, int ) +QArray<int> OPimContactAccessBackend_VCard::sorted( bool , int, int, int ) { @@ -201,5 +201,5 @@ QArray<int> OContactAccessBackend_VCard::sorted( bool , int, int, int ) -OContact OContactAccessBackend_VCard::parseVObject( VObject *obj ) +OPimContact OPimContactAccessBackend_VCard::parseVObject( VObject *obj ) { - OContact c; + OPimContact c; @@ -429,3 +429,3 @@ OContact OContactAccessBackend_VCard::parseVObject( VObject *obj ) -VObject* OContactAccessBackend_VCard::createVObject( const OContact &c ) +VObject* OPimContactAccessBackend_VCard::createVObject( const OPimContact &c ) { @@ -535,3 +535,3 @@ VObject* OContactAccessBackend_VCard::createVObject( const OContact &c ) -QString OContactAccessBackend_VCard::convDateToVCardDate( const QDate& d ) const +QString OPimContactAccessBackend_VCard::convDateToVCardDate( const QDate& d ) const { @@ -549,3 +549,3 @@ QString OContactAccessBackend_VCard::convDateToVCardDate( const QDate& d ) const -QDate OContactAccessBackend_VCard::convVCardDateToDate( const QString& datestr ) +QDate OPimContactAccessBackend_VCard::convVCardDateToDate( const QString& datestr ) { @@ -574,3 +574,3 @@ QDate OContactAccessBackend_VCard::convVCardDateToDate( const QString& datestr ) -VObject* OContactAccessBackend_VCard::safeAddPropValue( VObject *o, const char *prop, const QString &value ) +VObject* OPimContactAccessBackend_VCard::safeAddPropValue( VObject *o, const char *prop, const QString &value ) { @@ -582,3 +582,3 @@ VObject* OContactAccessBackend_VCard::safeAddPropValue( VObject *o, const char * -VObject* OContactAccessBackend_VCard::safeAddProp( VObject *o, const char *prop) +VObject* OPimContactAccessBackend_VCard::safeAddProp( VObject *o, const char *prop) { diff --git a/libopie2/opiepim/backend/ocontactaccessbackend_vcard.h b/libopie2/opiepim/backend/ocontactaccessbackend_vcard.h index 11be027..2a786af 100644 --- a/libopie2/opiepim/backend/ocontactaccessbackend_vcard.h +++ b/libopie2/opiepim/backend/ocontactaccessbackend_vcard.h @@ -34,3 +34,3 @@ -#include <opie2/ocontact.h> +#include <opie2/opimcontact.h> @@ -43,8 +43,8 @@ namespace Opie { * This is the vCard 2.1 implementation of the Contact Storage - * @see OContactAccessBackend_XML + * @see OPimContactAccessBackend_XML * @see OPimAccessBackend */ -class OContactAccessBackend_VCard : public OContactAccessBackend { +class OPimContactAccessBackend_VCard : public OPimContactAccessBackend { public: - OContactAccessBackend_VCard ( const QString& appname, const QString& filename = QString::null ); + OPimContactAccessBackend_VCard ( const QString& appname, const QString& filename = QString::null ); @@ -55,9 +55,9 @@ class OContactAccessBackend_VCard : public OContactAccessBackend { - bool add ( const OContact& newcontact ); + bool add ( const OPimContact& newcontact ); bool remove ( int uid ); - bool replace ( const OContact& contact ); + bool replace ( const OPimContact& contact ); - OContact find ( int uid ) const; + OPimContact find ( int uid ) const; QArray<int> allRecords() const; - QArray<int> queryByExample ( const OContact &query, int settings, const QDateTime& d = QDateTime() ); + QArray<int> queryByExample ( const OPimContact &query, int settings, const QDateTime& d = QDateTime() ); QArray<int> matchRegexp( const QRegExp &r ) const; @@ -70,4 +70,4 @@ class OContactAccessBackend_VCard : public OContactAccessBackend { private: - OContact parseVObject( VObject* obj ); - VObject* createVObject( const OContact& c ); + OPimContact parseVObject( VObject* obj ); + VObject* createVObject( const OPimContact& c ); QString convDateToVCardDate( const QDate& c ) const; @@ -79,3 +79,3 @@ private: QString m_file; - QMap<int, OContact> m_map; + QMap<int, OPimContact> m_map; }; diff --git a/libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp b/libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp index 07ad29a..0adba68 100644 --- a/libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp +++ b/libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp @@ -56,3 +56,3 @@ using namespace Opie; namespace Opie { -OContactAccessBackend_XML::OContactAccessBackend_XML ( const QString& appname, const QString& filename ): +OPimContactAccessBackend_XML::OPimContactAccessBackend_XML ( const QString& appname, const QString& filename ): m_changed( false ) @@ -80,3 +80,3 @@ OContactAccessBackend_XML::OContactAccessBackend_XML ( const QString& appname, c -bool OContactAccessBackend_XML::save() +bool OPimContactAccessBackend_XML::save() { @@ -106,3 +106,3 @@ bool OContactAccessBackend_XML::save() // Write all contacts - QListIterator<OContact> it( m_contactList ); + QListIterator<OPimContact> it( m_contactList ); for ( ; it.current(); ++it ) { @@ -150,3 +150,3 @@ bool OContactAccessBackend_XML::save() -bool OContactAccessBackend_XML::load () +bool OPimContactAccessBackend_XML::load () { @@ -169,3 +169,3 @@ bool OContactAccessBackend_XML::load () -void OContactAccessBackend_XML::clear () +void OPimContactAccessBackend_XML::clear () { @@ -177,3 +177,3 @@ void OContactAccessBackend_XML::clear () -bool OContactAccessBackend_XML::wasChangedExternally() +bool OPimContactAccessBackend_XML::wasChangedExternally() { @@ -186,3 +186,3 @@ bool OContactAccessBackend_XML::wasChangedExternally() -QArray<int> OContactAccessBackend_XML::allRecords() const +QArray<int> OPimContactAccessBackend_XML::allRecords() const { @@ -191,3 +191,3 @@ QArray<int> OContactAccessBackend_XML::allRecords() const uint counter = 0; - QListIterator<OContact> it( m_contactList ); + QListIterator<OPimContact> it( m_contactList ); for( ; it.current(); ++it ){ @@ -199,7 +199,7 @@ QArray<int> OContactAccessBackend_XML::allRecords() const -OContact OContactAccessBackend_XML::find ( int uid ) const +OPimContact OPimContactAccessBackend_XML::find ( int uid ) const { - OContact foundContact; //Create empty contact + OPimContact foundContact; //Create empty contact - OContact* found = m_uidToContact.find( QString().setNum( uid ) ); + OPimContact* found = m_uidToContact.find( QString().setNum( uid ) ); @@ -212,3 +212,3 @@ OContact OContactAccessBackend_XML::find ( int uid ) const -QArray<int> OContactAccessBackend_XML::queryByExample ( const OContact &query, int settings, +QArray<int> OPimContactAccessBackend_XML::queryByExample ( const OPimContact &query, int settings, const QDateTime& d ) @@ -217,3 +217,3 @@ QArray<int> OContactAccessBackend_XML::queryByExample ( const OContact &query, i QArray<int> m_currentQuery( m_contactList.count() ); - QListIterator<OContact> it( m_contactList ); + QListIterator<OPimContact> it( m_contactList ); uint arraycounter = 0; @@ -242,3 +242,3 @@ QArray<int> OContactAccessBackend_XML::queryByExample ( const OContact &query, i if( checkDate->isValid() ){ - if ( settings & OContactAccess::DateYear ){ + if ( settings & OPimContactAccess::DateYear ){ if ( queryDate->year() != checkDate->year() ) @@ -246,3 +246,3 @@ QArray<int> OContactAccessBackend_XML::queryByExample ( const OContact &query, i } - if ( settings & OContactAccess::DateMonth ){ + if ( settings & OPimContactAccess::DateMonth ){ if ( queryDate->month() != checkDate->month() ) @@ -250,3 +250,3 @@ QArray<int> OContactAccessBackend_XML::queryByExample ( const OContact &query, i } - if ( settings & OContactAccess::DateDay ){ + if ( settings & OPimContactAccess::DateDay ){ if ( queryDate->day() != checkDate->day() ) @@ -254,3 +254,3 @@ QArray<int> OContactAccessBackend_XML::queryByExample ( const OContact &query, i } - if ( settings & OContactAccess::DateDiff ) { + if ( settings & OPimContactAccess::DateDiff ) { QDate current; @@ -303,13 +303,13 @@ QArray<int> OContactAccessBackend_XML::queryByExample ( const OContact &query, i if ( !query.field(i).isEmpty() ){ - switch ( settings & ~( OContactAccess::IgnoreCase - | OContactAccess::DateDiff - | OContactAccess::DateYear - | OContactAccess::DateMonth - | OContactAccess::DateDay - | OContactAccess::MatchOne + switch ( settings & ~( OPimContactAccess::IgnoreCase + | OPimContactAccess::DateDiff + | OPimContactAccess::DateYear + | OPimContactAccess::DateMonth + | OPimContactAccess::DateDay + | OPimContactAccess::MatchOne ) ){ - case OContactAccess::RegExp:{ + case OPimContactAccess::RegExp:{ QRegExp expr ( query.field(i), - !(settings & OContactAccess::IgnoreCase), + !(settings & OPimContactAccess::IgnoreCase), false ); @@ -319,5 +319,5 @@ QArray<int> OContactAccessBackend_XML::queryByExample ( const OContact &query, i break; - case OContactAccess::WildCards:{ + case OPimContactAccess::WildCards:{ QRegExp expr ( query.field(i), - !(settings & OContactAccess::IgnoreCase), + !(settings & OPimContactAccess::IgnoreCase), true ); @@ -327,4 +327,4 @@ QArray<int> OContactAccessBackend_XML::queryByExample ( const OContact &query, i break; - case OContactAccess::ExactMatch:{ - if (settings & OContactAccess::IgnoreCase){ + case OPimContactAccess::ExactMatch:{ + if (settings & OPimContactAccess::IgnoreCase){ if ( query.field(i).upper() != @@ -353,6 +353,6 @@ QArray<int> OContactAccessBackend_XML::queryByExample ( const OContact &query, i -QArray<int> OContactAccessBackend_XML::matchRegexp( const QRegExp &r ) const +QArray<int> OPimContactAccessBackend_XML::matchRegexp( const QRegExp &r ) const { QArray<int> m_currentQuery( m_contactList.count() ); - QListIterator<OContact> it( m_contactList ); + QListIterator<OPimContact> it( m_contactList ); uint arraycounter = 0; @@ -371,12 +371,12 @@ QArray<int> OContactAccessBackend_XML::matchRegexp( const QRegExp &r ) const -const uint OContactAccessBackend_XML::querySettings() +const uint OPimContactAccessBackend_XML::querySettings() { - return ( OContactAccess::WildCards - | OContactAccess::IgnoreCase - | OContactAccess::RegExp - | OContactAccess::ExactMatch - | OContactAccess::DateDiff - | OContactAccess::DateYear - | OContactAccess::DateMonth - | OContactAccess::DateDay + return ( OPimContactAccess::WildCards + | OPimContactAccess::IgnoreCase + | OPimContactAccess::RegExp + | OPimContactAccess::ExactMatch + | OPimContactAccess::DateDiff + | OPimContactAccess::DateYear + | OPimContactAccess::DateMonth + | OPimContactAccess::DateDay ); @@ -384,5 +384,5 @@ const uint OContactAccessBackend_XML::querySettings() -bool OContactAccessBackend_XML::hasQuerySettings (uint querySettings) const +bool OPimContactAccessBackend_XML::hasQuerySettings (uint querySettings) const { - /* OContactAccess::IgnoreCase, DateDiff, DateYear, DateMonth, DateDay + /* OPimContactAccess::IgnoreCase, DateDiff, DateYear, DateMonth, DateDay * may be added with any of the other settings. IgnoreCase should never used alone. @@ -393,10 +393,10 @@ bool OContactAccessBackend_XML::hasQuerySettings (uint querySettings) const if ( ( querySettings & ( - OContactAccess::IgnoreCase - | OContactAccess::WildCards - | OContactAccess::DateDiff - | OContactAccess::DateYear - | OContactAccess::DateMonth - | OContactAccess::DateDay - | OContactAccess::RegExp - | OContactAccess::ExactMatch + OPimContactAccess::IgnoreCase + | OPimContactAccess::WildCards + | OPimContactAccess::DateDiff + | OPimContactAccess::DateYear + | OPimContactAccess::DateMonth + | OPimContactAccess::DateDay + | OPimContactAccess::RegExp + | OPimContactAccess::ExactMatch ) ) != querySettings ) @@ -407,3 +407,3 @@ bool OContactAccessBackend_XML::hasQuerySettings (uint querySettings) const // IngoreCase alone is invalid - if ( querySettings == OContactAccess::IgnoreCase ) + if ( querySettings == OPimContactAccess::IgnoreCase ) return false; @@ -411,14 +411,14 @@ bool OContactAccessBackend_XML::hasQuerySettings (uint querySettings) const // WildCards, RegExp and ExactMatch should never used at the same time - switch ( querySettings & ~( OContactAccess::IgnoreCase - | OContactAccess::DateDiff - | OContactAccess::DateYear - | OContactAccess::DateMonth - | OContactAccess::DateDay + switch ( querySettings & ~( OPimContactAccess::IgnoreCase + | OPimContactAccess::DateDiff + | OPimContactAccess::DateYear + | OPimContactAccess::DateMonth + | OPimContactAccess::DateDay ) ){ - case OContactAccess::RegExp: + case OPimContactAccess::RegExp: return ( true ); - case OContactAccess::WildCards: + case OPimContactAccess::WildCards: return ( true ); - case OContactAccess::ExactMatch: + case OPimContactAccess::ExactMatch: return ( true ); @@ -432,3 +432,3 @@ bool OContactAccessBackend_XML::hasQuerySettings (uint querySettings) const // Currently only asc implemented.. -QArray<int> OContactAccessBackend_XML::sorted( bool asc, int , int , int ) +QArray<int> OPimContactAccessBackend_XML::sorted( bool asc, int , int , int ) { @@ -440,3 +440,3 @@ QArray<int> OContactAccessBackend_XML::sorted( bool asc, int , int , int ) // Afterwards sort namelist and use map to fill array to return.. - QListIterator<OContact> it( m_contactList ); + QListIterator<OPimContact> it( m_contactList ); for( ; it.current(); ++it ){ @@ -460,3 +460,3 @@ QArray<int> OContactAccessBackend_XML::sorted( bool asc, int , int , int ) -bool OContactAccessBackend_XML::add ( const OContact &newcontact ) +bool OPimContactAccessBackend_XML::add ( const OPimContact &newcontact ) { @@ -471,3 +471,3 @@ bool OContactAccessBackend_XML::add ( const OContact &newcontact ) -bool OContactAccessBackend_XML::replace ( const OContact &contact ) +bool OPimContactAccessBackend_XML::replace ( const OPimContact &contact ) { @@ -475,6 +475,6 @@ bool OContactAccessBackend_XML::replace ( const OContact &contact ) - OContact* found = m_uidToContact.find ( QString().setNum( contact.uid() ) ); + OPimContact* found = m_uidToContact.find ( QString().setNum( contact.uid() ) ); if ( found ) { - OContact* newCont = new OContact( contact ); + OPimContact* newCont = new OPimContact( contact ); @@ -493,3 +493,3 @@ bool OContactAccessBackend_XML::replace ( const OContact &contact ) -bool OContactAccessBackend_XML::remove ( int uid ) +bool OPimContactAccessBackend_XML::remove ( int uid ) { @@ -497,3 +497,3 @@ bool OContactAccessBackend_XML::remove ( int uid ) - OContact* found = m_uidToContact.find ( QString().setNum( uid ) ); + OPimContact* found = m_uidToContact.find ( QString().setNum( uid ) ); @@ -509,3 +509,3 @@ bool OContactAccessBackend_XML::remove ( int uid ) -bool OContactAccessBackend_XML::reload(){ +bool OPimContactAccessBackend_XML::reload(){ /* Reload is the same as load in this implementation */ @@ -514,5 +514,5 @@ bool OContactAccessBackend_XML::reload(){ -void OContactAccessBackend_XML::addContact_p( const OContact &newcontact ) +void OPimContactAccessBackend_XML::addContact_p( const OPimContact &newcontact ) { - OContact* contRef = new OContact( newcontact ); + OPimContact* contRef = new OPimContact( newcontact ); @@ -523,3 +523,3 @@ void OContactAccessBackend_XML::addContact_p( const OContact &newcontact ) /* This function loads the xml-database and the journalfile */ -bool OContactAccessBackend_XML::load( const QString filename, bool isJournal ) +bool OPimContactAccessBackend_XML::load( const QString filename, bool isJournal ) { @@ -592,3 +592,3 @@ bool OContactAccessBackend_XML::load( const QString filename, bool isJournal ) - //qWarning( "OContactDefaultBackEnd::loading %s", filename.latin1() ); + //qWarning( "OPimContactDefaultBackEnd::loading %s", filename.latin1() ); @@ -600,3 +600,3 @@ bool OContactAccessBackend_XML::load( const QString filename, bool isJournal ) XMLElement *element = root->firstChild(); - //qWarning("OContactAccess::load tagName(): %s", root->tagName().latin1() ); + //qWarning("OPimContactAccess::load tagName(): %s", root->tagName().latin1() ); element = element->firstChild(); @@ -606,3 +606,3 @@ bool OContactAccessBackend_XML::load( const QString filename, bool isJournal ) if( element->tagName() != QString::fromLatin1("Contacts") ){ - //qWarning ("OContactDefBack::Searching for Tag \"Contacts\"! Found: %s", + //qWarning ("OPimContactDefBack::Searching for Tag \"Contacts\"! Found: %s", // element->tagName().latin1()); @@ -617,3 +617,3 @@ bool OContactAccessBackend_XML::load( const QString filename, bool isJournal ) if( element->tagName() != QString::fromLatin1("Contact") ){ - //qWarning ("OContactDefBack::Searching for Tag \"Contact\"! Found: %s", + //qWarning ("OPimContactDefBack::Searching for Tag \"Contact\"! Found: %s", // element->tagName().latin1()); @@ -625,3 +625,3 @@ bool OContactAccessBackend_XML::load( const QString filename, bool isJournal ) */ - //qWarning("OContactDefBack::load element tagName() : %s", + //qWarning("OPimContactDefBack::load element tagName() : %s", // element->tagName().latin1() ); @@ -672,3 +672,3 @@ bool OContactAccessBackend_XML::load( const QString filename, bool isJournal ) /* now generate the Contact contact */ - OContact contact( contactMap ); + OPimContact contact( contactMap ); @@ -715,3 +715,3 @@ bool OContactAccessBackend_XML::load( const QString filename, bool isJournal ) -void OContactAccessBackend_XML::updateJournal( const OContact& cnt, +void OPimContactAccessBackend_XML::updateJournal( const OPimContact& cnt, journal_action action ) @@ -743,3 +743,3 @@ void OContactAccessBackend_XML::updateJournal( const OContact& cnt, -void OContactAccessBackend_XML::removeJournal() +void OPimContactAccessBackend_XML::removeJournal() { diff --git a/libopie2/opiepim/backend/ocontactaccessbackend_xml.h b/libopie2/opiepim/backend/ocontactaccessbackend_xml.h index f439c4c..eaea352 100644 --- a/libopie2/opiepim/backend/ocontactaccessbackend_xml.h +++ b/libopie2/opiepim/backend/ocontactaccessbackend_xml.h @@ -32,4 +32,4 @@ -#ifndef _OContactAccessBackend_XML_ -#define _OContactAccessBackend_XML_ +#ifndef _OPimContactAccessBackend_XML_ +#define _OPimContactAccessBackend_XML_ @@ -45,8 +45,8 @@ namespace Opie { * This class is the XML implementation of a Contact backend - * it does implement everything available for OContact. + * it does implement everything available for OPimContact. * @see OPimAccessBackend for more information of available methods */ -class OContactAccessBackend_XML : public OContactAccessBackend { +class OPimContactAccessBackend_XML : public OPimContactAccessBackend { public: - OContactAccessBackend_XML ( const QString& appname, const QString& filename = QString::null ); + OPimContactAccessBackend_XML ( const QString& appname, const QString& filename = QString::null ); @@ -62,5 +62,5 @@ class OContactAccessBackend_XML : public OContactAccessBackend { - OContact find ( int uid ) const; + OPimContact find ( int uid ) const; - QArray<int> queryByExample ( const OContact &query, int settings, const QDateTime& d = QDateTime() ); + QArray<int> queryByExample ( const OPimContact &query, int settings, const QDateTime& d = QDateTime() ); @@ -74,5 +74,5 @@ class OContactAccessBackend_XML : public OContactAccessBackend { QArray<int> sorted( bool asc, int , int , int ); - bool add ( const OContact &newcontact ); + bool add ( const OPimContact &newcontact ); - bool replace ( const OContact &contact ); + bool replace ( const OPimContact &contact ); @@ -85,3 +85,3 @@ class OContactAccessBackend_XML : public OContactAccessBackend { - void addContact_p( const OContact &newcontact ); + void addContact_p( const OPimContact &newcontact ); @@ -91,3 +91,3 @@ class OContactAccessBackend_XML : public OContactAccessBackend { - void updateJournal( const OContact& cnt, journal_action action ); + void updateJournal( const OPimContact& cnt, journal_action action ); void removeJournal(); @@ -99,6 +99,6 @@ class OContactAccessBackend_XML : public OContactAccessBackend { QString m_appName; - QList<OContact> m_contactList; + QList<OPimContact> m_contactList; QDateTime m_readtime; - QDict<OContact> m_uidToContact; + QDict<OPimContact> m_uidToContact; }; diff --git a/libopie2/opiepim/backend/odatebookaccessbackend.cpp b/libopie2/opiepim/backend/odatebookaccessbackend.cpp index 9bf4bf0..f3b7b5f 100644 --- a/libopie2/opiepim/backend/odatebookaccessbackend.cpp +++ b/libopie2/opiepim/backend/odatebookaccessbackend.cpp @@ -30,3 +30,3 @@ -#include <opie2/orecur.h> +#include <opie2/opimrecurrence.h> @@ -38,3 +38,3 @@ namespace { /* a small helper to get all NonRepeating events for a range of time */ - void events( OEffectiveEvent::ValueList& tmpList, const OEvent::ValueList& events, + void events( OEffectiveEvent::ValueList& tmpList, const OPimEvent::ValueList& events, const QDate& from, const QDate& to ) { @@ -42,3 +42,3 @@ namespace { - for ( OEvent::ValueList::ConstIterator it = events.begin(); it != events.end(); ++it ) { + for ( OPimEvent::ValueList::ConstIterator it = events.begin(); it != events.end(); ++it ) { dtStart = (*it).startDateTime(); @@ -93,9 +93,9 @@ namespace { - void repeat( OEffectiveEvent::ValueList& tmpList, const OEvent::ValueList& list, + void repeat( OEffectiveEvent::ValueList& tmpList, const OPimEvent::ValueList& list, const QDate& from, const QDate& to ) { QDate repeat; - for ( OEvent::ValueList::ConstIterator it = list.begin(); it != list.end(); ++it ) { + for ( OPimEvent::ValueList::ConstIterator it = list.begin(); it != list.end(); ++it ) { int dur = (*it).startDateTime().date().daysTo( (*it).endDateTime().date() ); QDate itDate = from.addDays(-dur ); - ORecur rec = (*it).recurrence(); + OPimRecurrence rec = (*it).recurrence(); if ( !rec.hasEndDate() || rec.endDate() > to ) { @@ -154,3 +154,3 @@ namespace Opie { ODateBookAccessBackend::ODateBookAccessBackend() - : OPimAccessBackend<OEvent>() + : OPimAccessBackend<OPimEvent>() { @@ -164,3 +164,3 @@ OEffectiveEvent::ValueList ODateBookAccessBackend::effectiveEvents( const QDate& OEffectiveEvent::ValueList tmpList; - OEvent::ValueList list = directNonRepeats(); + OPimEvent::ValueList list = directNonRepeats(); @@ -192,3 +192,3 @@ OEffectiveEvent::ValueList ODateBookAccessBackend::effectiveNonRepeatingEvents( OEffectiveEvent::ValueList tmpList; - OEvent::ValueList list = directNonRepeats(); + OPimEvent::ValueList list = directNonRepeats(); diff --git a/libopie2/opiepim/backend/odatebookaccessbackend.h b/libopie2/opiepim/backend/odatebookaccessbackend.h index 6853670..a9cce6a 100644 --- a/libopie2/opiepim/backend/odatebookaccessbackend.h +++ b/libopie2/opiepim/backend/odatebookaccessbackend.h @@ -34,3 +34,3 @@ #include <opie2/opimaccessbackend.h> -#include <opie2/oevent.h> +#include <opie2/opimevent.h> @@ -42,3 +42,3 @@ namespace Opie { */ -class ODateBookAccessBackend : public OPimAccessBackend<OEvent> { +class ODateBookAccessBackend : public OPimAccessBackend<OPimEvent> { public: @@ -78,3 +78,3 @@ public: */ - virtual OEvent::ValueList directNonRepeats() = 0; + virtual OPimEvent::ValueList directNonRepeats() = 0; @@ -83,3 +83,3 @@ public: */ - virtual OEvent::ValueList directRawRepeats() = 0; + virtual OPimEvent::ValueList directRawRepeats() = 0; diff --git a/libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp b/libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp index e79696c..2ee76cc 100644 --- a/libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp +++ b/libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp @@ -45,3 +45,3 @@ -#include <opie2/orecur.h> +#include <opie2/opimrecurrence.h> #include <opie2/odatebookaccessbackend_sql.h> @@ -77,23 +77,23 @@ void ODateBookAccessBackend_SQL::initFields() // the names of the table columns - m_fieldMap.insert( OEvent::FUid, "uid" ); - m_fieldMap.insert( OEvent::FCategories, "Categories" ); - m_fieldMap.insert( OEvent::FDescription, "Description" ); - m_fieldMap.insert( OEvent::FLocation, "Location" ); - m_fieldMap.insert( OEvent::FType, "Type" ); - m_fieldMap.insert( OEvent::FAlarm, "Alarm" ); - m_fieldMap.insert( OEvent::FSound, "Sound" ); - m_fieldMap.insert( OEvent::FRType, "RType" ); - m_fieldMap.insert( OEvent::FRWeekdays, "RWeekdays" ); - m_fieldMap.insert( OEvent::FRPosition, "RPosition" ); - m_fieldMap.insert( OEvent::FRFreq, "RFreq" ); - m_fieldMap.insert( OEvent::FRHasEndDate, "RHasEndDate" ); - m_fieldMap.insert( OEvent::FREndDate, "REndDate" ); - m_fieldMap.insert( OEvent::FRCreated, "RCreated" ); - m_fieldMap.insert( OEvent::FRExceptions, "RExceptions" ); - m_fieldMap.insert( OEvent::FStart, "Start" ); - m_fieldMap.insert( OEvent::FEnd, "End" ); - m_fieldMap.insert( OEvent::FNote, "Note" ); - m_fieldMap.insert( OEvent::FTimeZone, "TimeZone" ); - m_fieldMap.insert( OEvent::FRecParent, "RecParent" ); - m_fieldMap.insert( OEvent::FRecChildren, "Recchildren" ); + m_fieldMap.insert( OPimEvent::FUid, "uid" ); + m_fieldMap.insert( OPimEvent::FCategories, "Categories" ); + m_fieldMap.insert( OPimEvent::FDescription, "Description" ); + m_fieldMap.insert( OPimEvent::FLocation, "Location" ); + m_fieldMap.insert( OPimEvent::FType, "Type" ); + m_fieldMap.insert( OPimEvent::FAlarm, "Alarm" ); + m_fieldMap.insert( OPimEvent::FSound, "Sound" ); + m_fieldMap.insert( OPimEvent::FRType, "RType" ); + m_fieldMap.insert( OPimEvent::FRWeekdays, "RWeekdays" ); + m_fieldMap.insert( OPimEvent::FRPosition, "RPosition" ); + m_fieldMap.insert( OPimEvent::FRFreq, "RFreq" ); + m_fieldMap.insert( OPimEvent::FRHasEndDate, "RHasEndDate" ); + m_fieldMap.insert( OPimEvent::FREndDate, "REndDate" ); + m_fieldMap.insert( OPimEvent::FRCreated, "RCreated" ); + m_fieldMap.insert( OPimEvent::FRExceptions, "RExceptions" ); + m_fieldMap.insert( OPimEvent::FStart, "Start" ); + m_fieldMap.insert( OPimEvent::FEnd, "End" ); + m_fieldMap.insert( OPimEvent::FNote, "Note" ); + m_fieldMap.insert( OPimEvent::FTimeZone, "TimeZone" ); + m_fieldMap.insert( OPimEvent::FRecParent, "RecParent" ); + m_fieldMap.insert( OPimEvent::FRecChildren, "Recchildren" ); @@ -167,3 +167,3 @@ QArray<int> ODateBookAccessBackend_SQL::allRecords()const -QArray<int> ODateBookAccessBackend_SQL::queryByExample(const OEvent&, int, const QDateTime& ) { +QArray<int> ODateBookAccessBackend_SQL::queryByExample(const OPimEvent&, int, const QDateTime& ) { return QArray<int>(); @@ -183,3 +183,3 @@ void ODateBookAccessBackend_SQL::clear() -OEvent ODateBookAccessBackend_SQL::find( int uid ) const{ +OPimEvent ODateBookAccessBackend_SQL::find( int uid ) const{ QString qu = "select *"; @@ -194,3 +194,3 @@ OEvent ODateBookAccessBackend_SQL::find( int uid ) const{ QMap<int,QString> dateEventMap; - dateEventMap.insert( OEvent::FUid, QString::number( uid ) ); + dateEventMap.insert( OPimEvent::FUid, QString::number( uid ) ); @@ -203,3 +203,3 @@ OEvent ODateBookAccessBackend_SQL::find( int uid ) const{ // Last step: Put map into date event and return it - OEvent retDate( dateEventMap ); + OPimEvent retDate( dateEventMap ); @@ -209,3 +209,3 @@ OEvent ODateBookAccessBackend_SQL::find( int uid ) const{ // FIXME: Speed up update of uid's.. -bool ODateBookAccessBackend_SQL::add( const OEvent& ev ) +bool ODateBookAccessBackend_SQL::add( const OPimEvent& ev ) { @@ -274,3 +274,3 @@ bool ODateBookAccessBackend_SQL::remove( int uid ) -bool ODateBookAccessBackend_SQL::replace( const OEvent& ev ) +bool ODateBookAccessBackend_SQL::replace( const OPimEvent& ev ) { @@ -311,6 +311,6 @@ QArray<int> ODateBookAccessBackend_SQL::nonRepeats()const -OEvent::ValueList ODateBookAccessBackend_SQL::directNonRepeats() +OPimEvent::ValueList ODateBookAccessBackend_SQL::directNonRepeats() { QArray<int> nonRepUids = nonRepeats(); - OEvent::ValueList list; + OPimEvent::ValueList list; @@ -323,6 +323,6 @@ OEvent::ValueList ODateBookAccessBackend_SQL::directNonRepeats() } -OEvent::ValueList ODateBookAccessBackend_SQL::directRawRepeats() +OPimEvent::ValueList ODateBookAccessBackend_SQL::directRawRepeats() { QArray<int> rawRepUids = rawRepeats(); - OEvent::ValueList list; + OPimEvent::ValueList list; diff --git a/libopie2/opiepim/backend/odatebookaccessbackend_sql.h b/libopie2/opiepim/backend/odatebookaccessbackend_sql.h index 89939ef..cbfeb97 100644 --- a/libopie2/opiepim/backend/odatebookaccessbackend_sql.h +++ b/libopie2/opiepim/backend/odatebookaccessbackend_sql.h @@ -57,8 +57,8 @@ public: QArray<int> matchRegexp(const QRegExp &r) const; - QArray<int> queryByExample( const OEvent&, int, const QDateTime& d = QDateTime() ); - OEvent find( int uid )const; + QArray<int> queryByExample( const OPimEvent&, int, const QDateTime& d = QDateTime() ); + OPimEvent find( int uid )const; void clear(); - bool add( const OEvent& ev ); + bool add( const OPimEvent& ev ); bool remove( int uid ); - bool replace( const OEvent& ev ); + bool replace( const OPimEvent& ev ); @@ -68,4 +68,4 @@ public: - OEvent::ValueList directNonRepeats(); - OEvent::ValueList directRawRepeats(); + OPimEvent::ValueList directNonRepeats(); + OPimEvent::ValueList directRawRepeats(); diff --git a/libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp b/libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp index 0ebda98..77c0253 100644 --- a/libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp +++ b/libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp @@ -48,4 +48,4 @@ #include <opie2/opimnotifymanager.h> -#include <opie2/orecur.h> -#include <opie2/otimezone.h> +#include <opie2/opimrecurrence.h> +#include <opie2/opimtimezone.h> #include <opie2/odatebookaccessbackend_xml.h> @@ -83,6 +83,6 @@ namespace { time_t start, end, created, rp_end; - ORecur* rec; - ORecur* recur() { + OPimRecurrence* rec; + OPimRecurrence* recur() { if (!rec) - rec = new ORecur; + rec = new OPimRecurrence; @@ -116,4 +116,4 @@ namespace { - // FIXME: Use OEvent::toMap() here !! (eilers) - inline void save( const OEvent& ev, QString& buf ) { + // FIXME: Use OPimEvent::toMap() here !! (eilers) + inline void save( const OPimEvent& ev, QString& buf ) { qWarning("Saving %d %s", ev.uid(), ev.description().latin1() ); @@ -148,5 +148,5 @@ namespace { */ - OTimeZone zone( ev.timeZone().isEmpty() ? OTimeZone::current() : ev.timeZone() ); - buf += " start=\"" + QString::number( zone.fromUTCDateTime( zone.toDateTime( ev.startDateTime(), OTimeZone::utc() ) ) ) + "\""; - buf += " end=\"" + QString::number( zone.fromUTCDateTime( zone.toDateTime( ev.endDateTime() , OTimeZone::utc() ) ) ) + "\""; + OPimTimeZone zone( ev.timeZone().isEmpty() ? OPimTimeZone::current() : ev.timeZone() ); + buf += " start=\"" + QString::number( zone.fromUTCDateTime( zone.toDateTime( ev.startDateTime(), OPimTimeZone::utc() ) ) ) + "\""; + buf += " end=\"" + QString::number( zone.fromUTCDateTime( zone.toDateTime( ev.endDateTime() , OPimTimeZone::utc() ) ) ) + "\""; if (!ev.note().isEmpty() ) { @@ -179,4 +179,4 @@ namespace { - inline bool forAll( const QMap<int, OEvent>& list, QFile& file ) { - QMap<int, OEvent>::ConstIterator it; + inline bool forAll( const QMap<int, OPimEvent>& list, QFile& file ) { + QMap<int, OPimEvent>::ConstIterator it; QString buf; @@ -266,3 +266,3 @@ QArray<int> ODateBookAccessBackend_XML::allRecords()const { uint i = 0; - QMap<int, OEvent>::ConstIterator it; + QMap<int, OPimEvent>::ConstIterator it; @@ -279,3 +279,3 @@ QArray<int> ODateBookAccessBackend_XML::allRecords()const { } -QArray<int> ODateBookAccessBackend_XML::queryByExample(const OEvent&, int, const QDateTime& ) { +QArray<int> ODateBookAccessBackend_XML::queryByExample(const OPimEvent&, int, const QDateTime& ) { return QArray<int>(); @@ -287,3 +287,3 @@ void ODateBookAccessBackend_XML::clear() { } -OEvent ODateBookAccessBackend_XML::find( int uid ) const{ +OPimEvent ODateBookAccessBackend_XML::find( int uid ) const{ if ( m_raw.contains( uid ) ) @@ -293,3 +293,3 @@ OEvent ODateBookAccessBackend_XML::find( int uid ) const{ } -bool ODateBookAccessBackend_XML::add( const OEvent& ev ) { +bool ODateBookAccessBackend_XML::add( const OPimEvent& ev ) { m_changed = true; @@ -309,3 +309,3 @@ bool ODateBookAccessBackend_XML::remove( int uid ) { } -bool ODateBookAccessBackend_XML::replace( const OEvent& ev ) { +bool ODateBookAccessBackend_XML::replace( const OPimEvent& ev ) { replace( ev.uid() ); // ??? Shouldn't this be "remove( ev.uid() ) ??? (eilers) @@ -319,3 +319,3 @@ QArray<int> ODateBookAccessBackend_XML::rawRepeats()const { uint i = 0; - QMap<int, OEvent>::ConstIterator it; + QMap<int, OPimEvent>::ConstIterator it; @@ -331,3 +331,3 @@ QArray<int> ODateBookAccessBackend_XML::nonRepeats()const { uint i = 0; - QMap<int, OEvent>::ConstIterator it; + QMap<int, OPimEvent>::ConstIterator it; @@ -340,5 +340,5 @@ QArray<int> ODateBookAccessBackend_XML::nonRepeats()const { } -OEvent::ValueList ODateBookAccessBackend_XML::directNonRepeats() { - OEvent::ValueList list; - QMap<int, OEvent>::ConstIterator it; +OPimEvent::ValueList ODateBookAccessBackend_XML::directNonRepeats() { + OPimEvent::ValueList list; + QMap<int, OPimEvent>::ConstIterator it; for (it = m_raw.begin(); it != m_raw.end(); ++it ) @@ -348,5 +348,5 @@ OEvent::ValueList ODateBookAccessBackend_XML::directNonRepeats() { } -OEvent::ValueList ODateBookAccessBackend_XML::directRawRepeats() { - OEvent::ValueList list; - QMap<int, OEvent>::ConstIterator it; +OPimEvent::ValueList ODateBookAccessBackend_XML::directRawRepeats() { + OPimEvent::ValueList list; + QMap<int, OPimEvent>::ConstIterator it; for (it = m_rep.begin(); it != m_rep.end(); ++it ) @@ -357,3 +357,3 @@ OEvent::ValueList ODateBookAccessBackend_XML::directRawRepeats() { -// FIXME: Use OEvent::fromMap() (eilers) +// FIXME: Use OPimEvent::fromMap() (eilers) bool ODateBookAccessBackend_XML::loadFile() { @@ -416,3 +416,3 @@ bool ODateBookAccessBackend_XML::loadFile() { - OEvent ev; + OPimEvent ev; rec = 0; @@ -482,7 +482,7 @@ bool ODateBookAccessBackend_XML::loadFile() { -// FIXME: Use OEvent::fromMap() which makes this obsolete.. (eilers) -void ODateBookAccessBackend_XML::finalizeRecord( OEvent& ev ) { +// FIXME: Use OPimEvent::fromMap() which makes this obsolete.. (eilers) +void ODateBookAccessBackend_XML::finalizeRecord( OPimEvent& ev ) { /* AllDay is alway in UTC */ if ( ev.isAllDay() ) { - OTimeZone utc = OTimeZone::utc(); + OPimTimeZone utc = OPimTimeZone::utc(); ev.setStartDateTime( utc.fromUTCDateTime( start ) ); @@ -493,13 +493,13 @@ void ODateBookAccessBackend_XML::finalizeRecord( OEvent& ev ) { // qWarning(" Start is %d", start ); - OTimeZone zone( ev.timeZone().isEmpty() ? OTimeZone::current() : ev.timeZone() ); + OPimTimeZone zone( ev.timeZone().isEmpty() ? OPimTimeZone::current() : ev.timeZone() ); QDateTime date = zone.toDateTime( start ); qWarning(" Start is %s", date.toString().latin1() ); - ev.setStartDateTime( zone.toDateTime( date, OTimeZone::current() ) ); + ev.setStartDateTime( zone.toDateTime( date, OPimTimeZone::current() ) ); date = zone.toDateTime( end ); - ev.setEndDateTime ( zone.toDateTime( date, OTimeZone::current() ) ); + ev.setEndDateTime ( zone.toDateTime( date, OPimTimeZone::current() ) ); } if ( rec && rec->doesRecur() ) { - OTimeZone utc = OTimeZone::utc(); - ORecur recu( *rec ); // call copy c'tor; + OPimTimeZone utc = OPimTimeZone::utc(); + OPimRecurrence recu( *rec ); // call copy c'tor; recu.setEndDate ( utc.fromUTCDateTime( rp_end ).date() ); @@ -526,3 +526,3 @@ void ODateBookAccessBackend_XML::finalizeRecord( OEvent& ev ) { } -void ODateBookAccessBackend_XML::setField( OEvent& e, int id, const QString& value) { +void ODateBookAccessBackend_XML::setField( OPimEvent& e, int id, const QString& value) { // qWarning(" setting %s", value.latin1() ); @@ -556,13 +556,13 @@ void ODateBookAccessBackend_XML::setField( OEvent& e, int id, const QString& val if ( value == "Daily" ) - recur()->setType( ORecur::Daily ); + recur()->setType( OPimRecurrence::Daily ); else if ( value == "Weekly" ) - recur()->setType( ORecur::Weekly); + recur()->setType( OPimRecurrence::Weekly); else if ( value == "MonthlyDay" ) - recur()->setType( ORecur::MonthlyDay ); + recur()->setType( OPimRecurrence::MonthlyDay ); else if ( value == "MonthlyDate" ) - recur()->setType( ORecur::MonthlyDate ); + recur()->setType( OPimRecurrence::MonthlyDate ); else if ( value == "Yearly" ) - recur()->setType( ORecur::Yearly ); + recur()->setType( OPimRecurrence::Yearly ); else - recur()->setType( ORecur::NoRepeat ); + recur()->setType( OPimRecurrence::NoRepeat ); break; @@ -629,3 +629,3 @@ QArray<int> ODateBookAccessBackend_XML::matchRegexp( const QRegExp &r ) const uint arraycounter = 0; - QMap<int, OEvent>::ConstIterator it; + QMap<int, OPimEvent>::ConstIterator it; diff --git a/libopie2/opiepim/backend/odatebookaccessbackend_xml.h b/libopie2/opiepim/backend/odatebookaccessbackend_xml.h index 29f5f4f..6823ce6 100644 --- a/libopie2/opiepim/backend/odatebookaccessbackend_xml.h +++ b/libopie2/opiepim/backend/odatebookaccessbackend_xml.h @@ -54,8 +54,8 @@ public: QArray<int> matchRegexp(const QRegExp &r) const; - QArray<int> queryByExample( const OEvent&, int, const QDateTime& d = QDateTime() ); - OEvent find( int uid )const; + QArray<int> queryByExample( const OPimEvent&, int, const QDateTime& d = QDateTime() ); + OPimEvent find( int uid )const; void clear(); - bool add( const OEvent& ev ); + bool add( const OPimEvent& ev ); bool remove( int uid ); - bool replace( const OEvent& ev ); + bool replace( const OPimEvent& ev ); @@ -65,4 +65,4 @@ public: - OEvent::ValueList directNonRepeats(); - OEvent::ValueList directRawRepeats(); + OPimEvent::ValueList directNonRepeats(); + OPimEvent::ValueList directRawRepeats(); @@ -71,7 +71,7 @@ private: bool loadFile(); - inline void finalizeRecord( OEvent& ev ); - inline void setField( OEvent&, int field, const QString& val ); + inline void finalizeRecord( OPimEvent& ev ); + inline void setField( OPimEvent&, int field, const QString& val ); QString m_name; - QMap<int, OEvent> m_raw; - QMap<int, OEvent> m_rep; + QMap<int, OPimEvent> m_raw; + QMap<int, OPimEvent> m_rep; diff --git a/libopie2/opiepim/backend/opimaccessbackend.h b/libopie2/opiepim/backend/opimaccessbackend.h index 505358e..0682063 100644 --- a/libopie2/opiepim/backend/opimaccessbackend.h +++ b/libopie2/opiepim/backend/opimaccessbackend.h @@ -34,3 +34,3 @@ -#include <opie2/otemplatebase.h> +#include <opie2/opimtemplatebase.h> #include <opie2/opimrecord.h> diff --git a/libopie2/opiepim/backend/otodoaccessbackend.cpp b/libopie2/opiepim/backend/otodoaccessbackend.cpp index d27f5ef..790a764 100644 --- a/libopie2/opiepim/backend/otodoaccessbackend.cpp +++ b/libopie2/opiepim/backend/otodoaccessbackend.cpp @@ -32,7 +32,7 @@ namespace Opie { -OTodoAccessBackend::OTodoAccessBackend() - : OPimAccessBackend<OTodo>() +OPimTodoAccessBackend::OPimTodoAccessBackend() + : OPimAccessBackend<OPimTodo>() { } -OTodoAccessBackend::~OTodoAccessBackend() { +OPimTodoAccessBackend::~OPimTodoAccessBackend() { diff --git a/libopie2/opiepim/backend/otodoaccessbackend.h b/libopie2/opiepim/backend/otodoaccessbackend.h index 54b52cc..9dfda45 100644 --- a/libopie2/opiepim/backend/otodoaccessbackend.h +++ b/libopie2/opiepim/backend/otodoaccessbackend.h @@ -33,3 +33,3 @@ -#include <opie2/otodo.h> +#include <opie2/opimtodo.h> #include <opie2/opimaccessbackend.h> @@ -37,6 +37,6 @@ namespace Opie { -class OTodoAccessBackend : public OPimAccessBackend<OTodo> { +class OPimTodoAccessBackend : public OPimAccessBackend<OPimTodo> { public: - OTodoAccessBackend(); - ~OTodoAccessBackend(); + OPimTodoAccessBackend(); + ~OPimTodoAccessBackend(); virtual QArray<int> effectiveToDos( const QDate& start, diff --git a/libopie2/opiepim/backend/otodoaccesssql.cpp b/libopie2/opiepim/backend/otodoaccesssql.cpp index 944f82a..72232e5 100644 --- a/libopie2/opiepim/backend/otodoaccesssql.cpp +++ b/libopie2/opiepim/backend/otodoaccesssql.cpp @@ -41,3 +41,3 @@ #include <opie2/opimnotifymanager.h> -#include <opie2/orecur.h> +#include <opie2/opimrecurrence.h> @@ -75,3 +75,3 @@ namespace { /** - * inserts/adds a OTodo to the table + * inserts/adds a OPimTodo to the table */ @@ -79,3 +79,3 @@ namespace { public: - InsertQuery(const OTodo& ); + InsertQuery(const OPimTodo& ); ~InsertQuery(); @@ -83,3 +83,3 @@ namespace { private: - OTodo m_todo; + OPimTodo m_todo; }; @@ -154,3 +154,3 @@ namespace { qu += "description, summary, priority, DueDate, progress , state, "; - // This is the recurrance-stuff .. Exceptions are currently not supported (see ORecur.cpp) ! (eilers) + // This is the recurrance-stuff .. Exceptions are currently not supported (see OPimRecurrence.cpp) ! (eilers) qu += "RType, RWeekdays, RPosition, RFreq, RHasEndDate, EndDate, Created, Exceptions, "; @@ -172,3 +172,3 @@ namespace { - InsertQuery::InsertQuery( const OTodo& todo ) + InsertQuery::InsertQuery( const OPimTodo& todo ) : OSQLQuery(), m_todo( todo ) { @@ -178,3 +178,3 @@ namespace { /* - * converts from a OTodo to a query + * converts from a OPimTodo to a query * we leave out X-Ref + Alarms @@ -220,10 +220,10 @@ namespace { + QString::number( m_todo.state().state() ) + "," - + "'" + recMap[ ORecur::RType ] + "'" + "," - + "'" + recMap[ ORecur::RWeekdays ] + "'" + "," - + "'" + recMap[ ORecur::RPosition ] + "'" + "," - + "'" + recMap[ ORecur::RFreq ] + "'" + "," - + "'" + recMap[ ORecur::RHasEndDate ] + "'" + "," - + "'" + recMap[ ORecur::EndDate ] + "'" + "," - + "'" + recMap[ ORecur::Created ] + "'" + "," - + "'" + recMap[ ORecur::Exceptions ] + "'" + ","; + + "'" + recMap[ OPimRecurrence::RType ] + "'" + "," + + "'" + recMap[ OPimRecurrence::RWeekdays ] + "'" + "," + + "'" + recMap[ OPimRecurrence::RPosition ] + "'" + "," + + "'" + recMap[ OPimRecurrence::RFreq ] + "'" + "," + + "'" + recMap[ OPimRecurrence::RHasEndDate ] + "'" + "," + + "'" + recMap[ OPimRecurrence::EndDate ] + "'" + "," + + "'" + recMap[ OPimRecurrence::Created ] + "'" + "," + + "'" + recMap[ OPimRecurrence::Exceptions ] + "'" + ","; @@ -331,4 +331,4 @@ namespace { namespace Opie { -OTodoAccessBackendSQL::OTodoAccessBackendSQL( const QString& file ) - : OTodoAccessBackend(), m_dict(15), m_driver(NULL), m_dirty(true) +OPimTodoAccessBackendSQL::OPimTodoAccessBackendSQL( const QString& file ) + : OPimTodoAccessBackend(), m_dict(15), m_driver(NULL), m_dirty(true) { @@ -343,3 +343,3 @@ OTodoAccessBackendSQL::OTodoAccessBackendSQL( const QString& file ) -OTodoAccessBackendSQL::~OTodoAccessBackendSQL(){ +OPimTodoAccessBackendSQL::~OPimTodoAccessBackendSQL(){ if( m_driver ) @@ -348,3 +348,3 @@ OTodoAccessBackendSQL::~OTodoAccessBackendSQL(){ -bool OTodoAccessBackendSQL::load(){ +bool OPimTodoAccessBackendSQL::load(){ if (!m_driver->open() ) @@ -358,3 +358,3 @@ bool OTodoAccessBackendSQL::load(){ } -bool OTodoAccessBackendSQL::reload(){ +bool OPimTodoAccessBackendSQL::reload(){ return load(); @@ -362,6 +362,6 @@ bool OTodoAccessBackendSQL::reload(){ -bool OTodoAccessBackendSQL::save(){ +bool OPimTodoAccessBackendSQL::save(){ return m_driver->close(); // Shouldn't m_driver->sync be better than close ? (eilers) } -QArray<int> OTodoAccessBackendSQL::allRecords()const { +QArray<int> OPimTodoAccessBackendSQL::allRecords()const { if (m_dirty ) @@ -371,3 +371,3 @@ QArray<int> OTodoAccessBackendSQL::allRecords()const { } -QArray<int> OTodoAccessBackendSQL::queryByExample( const OTodo& , int, const QDateTime& ){ +QArray<int> OPimTodoAccessBackendSQL::queryByExample( const OPimTodo& , int, const QDateTime& ){ QArray<int> ints(0); @@ -375,3 +375,3 @@ QArray<int> OTodoAccessBackendSQL::queryByExample( const OTodo& , int, const QDa } -OTodo OTodoAccessBackendSQL::find(int uid ) const{ +OPimTodo OPimTodoAccessBackendSQL::find(int uid ) const{ FindQuery query( uid ); @@ -380,3 +380,3 @@ OTodo OTodoAccessBackendSQL::find(int uid ) const{ } -OTodo OTodoAccessBackendSQL::find( int uid, const QArray<int>& ints, +OPimTodo OPimTodoAccessBackendSQL::find( int uid, const QArray<int>& ints, uint cur, Frontend::CacheDirection dir ) const{ @@ -386,3 +386,3 @@ OTodo OTodoAccessBackendSQL::find( int uid, const QArray<int>& ints, uint size =0; - OTodo to; + OPimTodo to; @@ -414,3 +414,3 @@ OTodo OTodoAccessBackendSQL::find( int uid, const QArray<int>& ints, } -void OTodoAccessBackendSQL::clear() { +void OPimTodoAccessBackendSQL::clear() { ClearQuery cle; @@ -420,3 +420,3 @@ void OTodoAccessBackendSQL::clear() { } -bool OTodoAccessBackendSQL::add( const OTodo& t) { +bool OPimTodoAccessBackendSQL::add( const OPimTodo& t) { InsertQuery ins( t ); @@ -432,3 +432,3 @@ bool OTodoAccessBackendSQL::add( const OTodo& t) { } -bool OTodoAccessBackendSQL::remove( int uid ) { +bool OPimTodoAccessBackendSQL::remove( int uid ) { RemoveQuery rem( uid ); @@ -447,3 +447,3 @@ bool OTodoAccessBackendSQL::remove( int uid ) { */ -bool OTodoAccessBackendSQL::replace( const OTodo& t) { +bool OPimTodoAccessBackendSQL::replace( const OPimTodo& t) { remove( t.uid() ); @@ -453,3 +453,3 @@ bool OTodoAccessBackendSQL::replace( const OTodo& t) { } -QArray<int> OTodoAccessBackendSQL::overDue() { +QArray<int> OPimTodoAccessBackendSQL::overDue() { OverDueQuery qu; @@ -457,3 +457,3 @@ QArray<int> OTodoAccessBackendSQL::overDue() { } -QArray<int> OTodoAccessBackendSQL::effectiveToDos( const QDate& s, +QArray<int> OPimTodoAccessBackendSQL::effectiveToDos( const QDate& s, const QDate& t, @@ -466,3 +466,3 @@ QArray<int> OTodoAccessBackendSQL::effectiveToDos( const QDate& s, */ -QArray<int> OTodoAccessBackendSQL::sorted( bool asc, int sortOrder, +QArray<int> OPimTodoAccessBackendSQL::sorted( bool asc, int sortOrder, int sortFilter, int cat ) { @@ -532,3 +532,3 @@ QArray<int> OTodoAccessBackendSQL::sorted( bool asc, int sortOrder, } -bool OTodoAccessBackendSQL::date( QDate& da, const QString& str ) const{ +bool OPimTodoAccessBackendSQL::date( QDate& da, const QString& str ) const{ if ( str == "0-0-0" ) @@ -545,5 +545,5 @@ bool OTodoAccessBackendSQL::date( QDate& da, const QString& str ) const{ } -OTodo OTodoAccessBackendSQL::todo( const OSQLResult& res) const{ +OPimTodo OPimTodoAccessBackendSQL::todo( const OSQLResult& res) const{ if ( res.state() == OSQLResult::Failure ) { - OTodo to; + OPimTodo to; return to; @@ -554,3 +554,3 @@ OTodo OTodoAccessBackendSQL::todo( const OSQLResult& res) const{ qWarning("todo1"); - OTodo to = todo( (*it) ); + OPimTodo to = todo( (*it) ); cache( to ); @@ -564,3 +564,3 @@ OTodo OTodoAccessBackendSQL::todo( const OSQLResult& res) const{ } -OTodo OTodoAccessBackendSQL::todo( OSQLResultItem& item )const { +OPimTodo OPimTodoAccessBackendSQL::todo( OSQLResultItem& item )const { qWarning("todo"); @@ -572,3 +572,3 @@ OTodo OTodoAccessBackendSQL::todo( OSQLResultItem& item )const { - OTodo to( (bool)item.data("completed").toInt(), item.data("priority").toInt(), + OPimTodo to( (bool)item.data("completed").toInt(), item.data("priority").toInt(), cats, item.data("summary"), item.data("description"), @@ -601,12 +601,12 @@ OTodo OTodoAccessBackendSQL::todo( OSQLResultItem& item )const { QMap<int, QString> recMap; - recMap.insert( ORecur::RType , item.data("RType") ); - recMap.insert( ORecur::RWeekdays , item.data("RWeekdays") ); - recMap.insert( ORecur::RPosition , item.data("RPosition") ); - recMap.insert( ORecur::RFreq , item.data("RFreq") ); - recMap.insert( ORecur::RHasEndDate, item.data("RHasEndDate") ); - recMap.insert( ORecur::EndDate , item.data("EndDate") ); - recMap.insert( ORecur::Created , item.data("Created") ); - recMap.insert( ORecur::Exceptions , item.data("Exceptions") ); + recMap.insert( OPimRecurrence::RType , item.data("RType") ); + recMap.insert( OPimRecurrence::RWeekdays , item.data("RWeekdays") ); + recMap.insert( OPimRecurrence::RPosition , item.data("RPosition") ); + recMap.insert( OPimRecurrence::RFreq , item.data("RFreq") ); + recMap.insert( OPimRecurrence::RHasEndDate, item.data("RHasEndDate") ); + recMap.insert( OPimRecurrence::EndDate , item.data("EndDate") ); + recMap.insert( OPimRecurrence::Created , item.data("Created") ); + recMap.insert( OPimRecurrence::Exceptions , item.data("Exceptions") ); - ORecur recur; + OPimRecurrence recur; recur.fromMap( recMap ); @@ -616,3 +616,3 @@ OTodo OTodoAccessBackendSQL::todo( OSQLResultItem& item )const { } -OTodo OTodoAccessBackendSQL::todo( int uid )const { +OPimTodo OPimTodoAccessBackendSQL::todo( int uid )const { FindQuery find( uid ); @@ -623,3 +623,3 @@ OTodo OTodoAccessBackendSQL::todo( int uid )const { */ -void OTodoAccessBackendSQL::fillDict() { +void OPimTodoAccessBackendSQL::fillDict() { /* initialize dict */ @@ -630,17 +630,17 @@ void OTodoAccessBackendSQL::fillDict() { m_dict.setAutoDelete( TRUE ); - m_dict.insert("Categories" , new int(OTodo::Category) ); - m_dict.insert("Uid" , new int(OTodo::Uid) ); - m_dict.insert("HasDate" , new int(OTodo::HasDate) ); - m_dict.insert("Completed" , new int(OTodo::Completed) ); - m_dict.insert("Description" , new int(OTodo::Description) ); - m_dict.insert("Summary" , new int(OTodo::Summary) ); - m_dict.insert("Priority" , new int(OTodo::Priority) ); - m_dict.insert("DateDay" , new int(OTodo::DateDay) ); - m_dict.insert("DateMonth" , new int(OTodo::DateMonth) ); - m_dict.insert("DateYear" , new int(OTodo::DateYear) ); - m_dict.insert("Progress" , new int(OTodo::Progress) ); - m_dict.insert("Completed", new int(OTodo::Completed) ); // Why twice ? (eilers) - m_dict.insert("CrossReference", new int(OTodo::CrossReference) ); -// m_dict.insert("HasAlarmDateTime",new int(OTodo::HasAlarmDateTime) ); // old stuff (eilers) -// m_dict.insert("AlarmDateTime", new int(OTodo::AlarmDateTime) ); // old stuff (eilers) + m_dict.insert("Categories" , new int(OPimTodo::Category) ); + m_dict.insert("Uid" , new int(OPimTodo::Uid) ); + m_dict.insert("HasDate" , new int(OPimTodo::HasDate) ); + m_dict.insert("Completed" , new int(OPimTodo::Completed) ); + m_dict.insert("Description" , new int(OPimTodo::Description) ); + m_dict.insert("Summary" , new int(OPimTodo::Summary) ); + m_dict.insert("Priority" , new int(OPimTodo::Priority) ); + m_dict.insert("DateDay" , new int(OPimTodo::DateDay) ); + m_dict.insert("DateMonth" , new int(OPimTodo::DateMonth) ); + m_dict.insert("DateYear" , new int(OPimTodo::DateYear) ); + m_dict.insert("Progress" , new int(OPimTodo::Progress) ); + m_dict.insert("Completed", new int(OPimTodo::Completed) ); // Why twice ? (eilers) + m_dict.insert("CrossReference", new int(OPimTodo::CrossReference) ); +// m_dict.insert("HasAlarmDateTime",new int(OPimTodo::HasAlarmDateTime) ); // old stuff (eilers) +// m_dict.insert("AlarmDateTime", new int(OPimTodo::AlarmDateTime) ); // old stuff (eilers) } @@ -650,4 +650,4 @@ void OTodoAccessBackendSQL::fillDict() { */ -void OTodoAccessBackendSQL::update()const { - ((OTodoAccessBackendSQL*)this)->m_dirty = false; +void OPimTodoAccessBackendSQL::update()const { + ((OPimTodoAccessBackendSQL*)this)->m_dirty = false; LoadQuery lo; @@ -657,5 +657,5 @@ void OTodoAccessBackendSQL::update()const { - ((OTodoAccessBackendSQL*)this)->m_uids = uids( res ); + ((OPimTodoAccessBackendSQL*)this)->m_uids = uids( res ); } -QArray<int> OTodoAccessBackendSQL::uids( const OSQLResult& res) const{ +QArray<int> OPimTodoAccessBackendSQL::uids( const OSQLResult& res) const{ @@ -674,6 +674,6 @@ QArray<int> OTodoAccessBackendSQL::uids( const OSQLResult& res) const{ -QArray<int> OTodoAccessBackendSQL::matchRegexp( const QRegExp &r ) const +QArray<int> OPimTodoAccessBackendSQL::matchRegexp( const QRegExp &r ) const { -#warning OTodoAccessBackendSQL::matchRegexp() not implemented !! +#warning OPimTodoAccessBackendSQL::matchRegexp() not implemented !! @@ -688,3 +688,3 @@ QArray<int> OTodoAccessBackendSQL::matchRegexp( const QRegExp &r ) const - QMap<int, OTodo>::ConstIterator it; + QMap<int, OPimTodo>::ConstIterator it; for (it = m_events.begin(); it != m_events.end(); ++it ) { @@ -702,3 +702,3 @@ QArray<int> OTodoAccessBackendSQL::matchRegexp( const QRegExp &r ) const } -QBitArray OTodoAccessBackendSQL::supports()const { +QBitArray OPimTodoAccessBackendSQL::supports()const { @@ -707,11 +707,11 @@ QBitArray OTodoAccessBackendSQL::supports()const { -QBitArray OTodoAccessBackendSQL::sup() const{ +QBitArray OPimTodoAccessBackendSQL::sup() const{ - QBitArray ar( OTodo::CompletedDate + 1 ); + QBitArray ar( OPimTodo::CompletedDate + 1 ); ar.fill( true ); - ar[OTodo::CrossReference] = false; - ar[OTodo::State ] = false; - ar[OTodo::Reminders] = false; - ar[OTodo::Notifiers] = false; - ar[OTodo::Maintainer] = false; + ar[OPimTodo::CrossReference] = false; + ar[OPimTodo::State ] = false; + ar[OPimTodo::Reminders] = false; + ar[OPimTodo::Notifiers] = false; + ar[OPimTodo::Maintainer] = false; @@ -720,4 +720,4 @@ QBitArray OTodoAccessBackendSQL::sup() const{ -void OTodoAccessBackendSQL::removeAllCompleted(){ -#warning OTodoAccessBackendSQL::removeAllCompleted() not implemented !! +void OPimTodoAccessBackendSQL::removeAllCompleted(){ +#warning OPimTodoAccessBackendSQL::removeAllCompleted() not implemented !! diff --git a/libopie2/opiepim/backend/otodoaccesssql.h b/libopie2/opiepim/backend/otodoaccesssql.h index 1a6f614..e945863 100644 --- a/libopie2/opiepim/backend/otodoaccesssql.h +++ b/libopie2/opiepim/backend/otodoaccesssql.h @@ -41,6 +41,6 @@ namespace Opie { -class OTodoAccessBackendSQL : public OTodoAccessBackend { +class OPimTodoAccessBackendSQL : public OPimTodoAccessBackend { public: - OTodoAccessBackendSQL( const QString& file ); - ~OTodoAccessBackendSQL(); + OPimTodoAccessBackendSQL( const QString& file ); + ~OPimTodoAccessBackendSQL(); @@ -51,9 +51,9 @@ public: - QArray<int> queryByExample( const OTodo& t, int settings, const QDateTime& d = QDateTime() ); - OTodo find(int uid)const; - OTodo find(int uid, const QArray<int>&, uint cur, Frontend::CacheDirection )const; + QArray<int> queryByExample( const OPimTodo& t, int settings, const QDateTime& d = QDateTime() ); + OPimTodo find(int uid)const; + OPimTodo find(int uid, const QArray<int>&, uint cur, Frontend::CacheDirection )const; void clear(); - bool add( const OTodo& t ); + bool add( const OPimTodo& t ); bool remove( int uid ); - bool replace( const OTodo& t ); + bool replace( const OPimTodo& t ); @@ -73,6 +73,6 @@ private: inline bool date( QDate& date, const QString& )const; - inline OTodo todo( const OSQLResult& )const; - inline OTodo todo( OSQLResultItem& )const; + inline OPimTodo todo( const OSQLResult& )const; + inline OPimTodo todo( OSQLResultItem& )const; inline QArray<int> uids( const OSQLResult& )const; - OTodo todo( int uid )const; + OPimTodo todo( int uid )const; QBitArray sup() const; diff --git a/libopie2/opiepim/backend/otodoaccessvcal.cpp b/libopie2/opiepim/backend/otodoaccessvcal.cpp index e364ee2..0a1baf9 100644 --- a/libopie2/opiepim/backend/otodoaccessvcal.cpp +++ b/libopie2/opiepim/backend/otodoaccessvcal.cpp @@ -39,4 +39,4 @@ using namespace Opie; namespace { - static OTodo eventByVObj( VObject *obj ){ - OTodo event; + static OPimTodo eventByVObj( VObject *obj ){ + OPimTodo event; VObject *ob; @@ -93,3 +93,3 @@ namespace { }; - static VObject *vobjByEvent( const OTodo &event ) { + static VObject *vobjByEvent( const OPimTodo &event ) { VObject *task = newVObject( VCTodoProp ); @@ -140,3 +140,3 @@ namespace { namespace Opie { -OTodoAccessVCal::OTodoAccessVCal( const QString& path ) +OPimTodoAccessVCal::OPimTodoAccessVCal( const QString& path ) : m_dirty(false), m_file( path ) @@ -144,5 +144,5 @@ OTodoAccessVCal::OTodoAccessVCal( const QString& path ) } -OTodoAccessVCal::~OTodoAccessVCal() { +OPimTodoAccessVCal::~OPimTodoAccessVCal() { } -bool OTodoAccessVCal::load() { +bool OPimTodoAccessVCal::load() { m_map.clear(); @@ -165,3 +165,3 @@ bool OTodoAccessVCal::load() { if( name == VCTodoProp ){ - OTodo to = eventByVObj( vobj ); + OPimTodo to = eventByVObj( vobj ); m_map.insert( to.uid(), to ); @@ -174,6 +174,6 @@ bool OTodoAccessVCal::load() { } -bool OTodoAccessVCal::reload() { +bool OPimTodoAccessVCal::reload() { return load(); } -bool OTodoAccessVCal::save() { +bool OPimTodoAccessVCal::save() { if (!m_dirty ) @@ -189,3 +189,3 @@ bool OTodoAccessVCal::save() { VObject *vo; - for(QMap<int, OTodo>::ConstIterator it=m_map.begin(); it !=m_map.end(); ++it ){ + for(QMap<int, OPimTodo>::ConstIterator it=m_map.begin(); it !=m_map.end(); ++it ){ vo = vobjByEvent( it.data() ); @@ -200,3 +200,3 @@ bool OTodoAccessVCal::save() { } -void OTodoAccessVCal::clear() { +void OPimTodoAccessVCal::clear() { m_map.clear(); @@ -204,3 +204,3 @@ void OTodoAccessVCal::clear() { } -bool OTodoAccessVCal::add( const OTodo& to ) { +bool OPimTodoAccessVCal::add( const OPimTodo& to ) { m_map.insert( to.uid(), to ); @@ -209,3 +209,3 @@ bool OTodoAccessVCal::add( const OTodo& to ) { } -bool OTodoAccessVCal::remove( int uid ) { +bool OPimTodoAccessVCal::remove( int uid ) { m_map.remove( uid ); @@ -214,4 +214,4 @@ bool OTodoAccessVCal::remove( int uid ) { } -void OTodoAccessVCal::removeAllCompleted() { - for ( QMap<int, OTodo>::Iterator it = m_map.begin(); it != m_map.end(); ++it ) { +void OPimTodoAccessVCal::removeAllCompleted() { + for ( QMap<int, OPimTodo>::Iterator it = m_map.begin(); it != m_map.end(); ++it ) { if ( (*it).isCompleted() ) @@ -220,3 +220,3 @@ void OTodoAccessVCal::removeAllCompleted() { } -bool OTodoAccessVCal::replace( const OTodo& to ) { +bool OPimTodoAccessVCal::replace( const OPimTodo& to ) { m_map.replace( to.uid(), to ); @@ -225,6 +225,6 @@ bool OTodoAccessVCal::replace( const OTodo& to ) { } -OTodo OTodoAccessVCal::find(int uid )const { +OPimTodo OPimTodoAccessVCal::find(int uid )const { return m_map[uid]; } -QArray<int> OTodoAccessVCal::sorted( bool, int, int, int ) { +QArray<int> OPimTodoAccessVCal::sorted( bool, int, int, int ) { QArray<int> ar(0); @@ -232,5 +232,5 @@ QArray<int> OTodoAccessVCal::sorted( bool, int, int, int ) { } -QArray<int> OTodoAccessVCal::allRecords()const { +QArray<int> OPimTodoAccessVCal::allRecords()const { QArray<int> ar( m_map.count() ); - QMap<int, OTodo>::ConstIterator it; + QMap<int, OPimTodo>::ConstIterator it; int i = 0; @@ -242,3 +242,3 @@ QArray<int> OTodoAccessVCal::allRecords()const { } -QArray<int> OTodoAccessVCal::matchRegexp(const QRegExp& /* r */)const { +QArray<int> OPimTodoAccessVCal::matchRegexp(const QRegExp& /* r */)const { QArray<int> ar(0); @@ -246,3 +246,3 @@ QArray<int> OTodoAccessVCal::matchRegexp(const QRegExp& /* r */)const { } -QArray<int> OTodoAccessVCal::queryByExample( const OTodo&, int, const QDateTime& ) { +QArray<int> OPimTodoAccessVCal::queryByExample( const OPimTodo&, int, const QDateTime& ) { QArray<int> ar(0); @@ -250,3 +250,3 @@ QArray<int> OTodoAccessVCal::queryByExample( const OTodo&, int, const QDateTime& } -QArray<int> OTodoAccessVCal::effectiveToDos( const QDate& , +QArray<int> OPimTodoAccessVCal::effectiveToDos( const QDate& , const QDate& , @@ -256,3 +256,3 @@ QArray<int> OTodoAccessVCal::effectiveToDos( const QDate& , } -QArray<int> OTodoAccessVCal::overDue() { +QArray<int> OPimTodoAccessVCal::overDue() { QArray<int> ar(0); @@ -260,3 +260,3 @@ QArray<int> OTodoAccessVCal::overDue() { } -QBitArray OTodoAccessVCal::supports()const { +QBitArray OPimTodoAccessVCal::supports()const { static QBitArray ar = sup(); @@ -265,14 +265,14 @@ QBitArray OTodoAccessVCal::supports()const { } -QBitArray OTodoAccessVCal::sup() { - QBitArray ar ( OTodo::CompletedDate +1 ); +QBitArray OPimTodoAccessVCal::sup() { + QBitArray ar ( OPimTodo::CompletedDate +1 ); ar.fill( true ); - ar[OTodo::CrossReference] = false; - ar[OTodo::State ] = false; - ar[OTodo::Reminders] = false; - ar[OTodo::Notifiers] = false; - ar[OTodo::Maintainer] = false; - ar[OTodo::Progress] = false; - ar[OTodo::Alarms ] = false; - ar[OTodo::Recurrence] = false; + ar[OPimTodo::CrossReference] = false; + ar[OPimTodo::State ] = false; + ar[OPimTodo::Reminders] = false; + ar[OPimTodo::Notifiers] = false; + ar[OPimTodo::Maintainer] = false; + ar[OPimTodo::Progress] = false; + ar[OPimTodo::Alarms ] = false; + ar[OPimTodo::Recurrence] = false; diff --git a/libopie2/opiepim/backend/otodoaccessvcal.h b/libopie2/opiepim/backend/otodoaccessvcal.h index f9323fb..1e106d3 100644 --- a/libopie2/opiepim/backend/otodoaccessvcal.h +++ b/libopie2/opiepim/backend/otodoaccessvcal.h @@ -35,6 +35,6 @@ namespace Opie { -class OTodoAccessVCal : public OTodoAccessBackend { +class OPimTodoAccessVCal : public OPimTodoAccessBackend { public: - OTodoAccessVCal(const QString& ); - ~OTodoAccessVCal(); + OPimTodoAccessVCal(const QString& ); + ~OPimTodoAccessVCal(); @@ -46,3 +46,3 @@ public: QArray<int> matchRegexp(const QRegExp &r) const; - QArray<int> queryByExample( const OTodo& t, int sort, const QDateTime& d = QDateTime() ); + QArray<int> queryByExample( const OPimTodo& t, int sort, const QDateTime& d = QDateTime() ); QArray<int> effectiveToDos( const QDate& start, @@ -53,7 +53,7 @@ public: int cat ); - OTodo find(int uid)const; + OPimTodo find(int uid)const; void clear(); - bool add( const OTodo& ); + bool add( const OPimTodo& ); bool remove( int uid ); - bool replace( const OTodo& ); + bool replace( const OPimTodo& ); @@ -66,3 +66,3 @@ private: QString m_file; - QMap<int, OTodo> m_map; + QMap<int, OPimTodo> m_map; }; diff --git a/libopie2/opiepim/backend/otodoaccessxml.cpp b/libopie2/opiepim/backend/otodoaccessxml.cpp index 2d50ecd..cce6111 100644 --- a/libopie2/opiepim/backend/otodoaccessxml.cpp +++ b/libopie2/opiepim/backend/otodoaccessxml.cpp @@ -45,7 +45,7 @@ -#include <opie2/oconversion.h> +#include <opie2/opimdateconversion.h> #include <opie2/opimstate.h> -#include <opie2/otimezone.h> +#include <opie2/opimtimezone.h> #include <opie2/opimnotifymanager.h> -#include <opie2/orecur.h> +#include <opie2/opimrecurrence.h> #include <opie2/otodoaccessxml.h> @@ -56,5 +56,5 @@ namespace { time_t rp_end; - ORecur* rec; - ORecur *recur() { - if (!rec ) rec = new ORecur; + OPimRecurrence* rec; + OPimRecurrence *recur() { + if (!rec ) rec = new OPimRecurrence; return rec; @@ -63,3 +63,3 @@ namespace { enum MoreAttributes { - FRType = OTodo::CompletedDate + 2, + FRType = OPimTodo::CompletedDate + 2, FRWeekdays, @@ -100,5 +100,5 @@ namespace Opie { -OTodoAccessXML::OTodoAccessXML( const QString& appName, +OPimTodoAccessXML::OPimTodoAccessXML( const QString& appName, const QString& fileName ) - : OTodoAccessBackend(), m_app( appName ), m_opened( false ), m_changed( false ) + : OPimTodoAccessBackend(), m_app( appName ), m_opened( false ), m_changed( false ) { @@ -109,6 +109,6 @@ OTodoAccessXML::OTodoAccessXML( const QString& appName, } -OTodoAccessXML::~OTodoAccessXML() { +OPimTodoAccessXML::~OPimTodoAccessXML() { } -bool OTodoAccessXML::load() { +bool OPimTodoAccessXML::load() { rec = 0; @@ -122,21 +122,21 @@ bool OTodoAccessXML::load() { dict.setAutoDelete( TRUE ); - dict.insert("Categories" , new int(OTodo::Category) ); - dict.insert("Uid" , new int(OTodo::Uid) ); - dict.insert("HasDate" , new int(OTodo::HasDate) ); - dict.insert("Completed" , new int(OTodo::Completed) ); - dict.insert("Description" , new int(OTodo::Description) ); - dict.insert("Summary" , new int(OTodo::Summary) ); - dict.insert("Priority" , new int(OTodo::Priority) ); - dict.insert("DateDay" , new int(OTodo::DateDay) ); - dict.insert("DateMonth" , new int(OTodo::DateMonth) ); - dict.insert("DateYear" , new int(OTodo::DateYear) ); - dict.insert("Progress" , new int(OTodo::Progress) ); - dict.insert("CompletedDate", new int(OTodo::CompletedDate) ); - dict.insert("StartDate", new int(OTodo::StartDate) ); - dict.insert("CrossReference", new int(OTodo::CrossReference) ); - dict.insert("State", new int(OTodo::State) ); - dict.insert("Alarms", new int(OTodo::Alarms) ); - dict.insert("Reminders", new int(OTodo::Reminders) ); - dict.insert("Notifiers", new int(OTodo::Notifiers) ); - dict.insert("Maintainer", new int(OTodo::Maintainer) ); + dict.insert("Categories" , new int(OPimTodo::Category) ); + dict.insert("Uid" , new int(OPimTodo::Uid) ); + dict.insert("HasDate" , new int(OPimTodo::HasDate) ); + dict.insert("Completed" , new int(OPimTodo::Completed) ); + dict.insert("Description" , new int(OPimTodo::Description) ); + dict.insert("Summary" , new int(OPimTodo::Summary) ); + dict.insert("Priority" , new int(OPimTodo::Priority) ); + dict.insert("DateDay" , new int(OPimTodo::DateDay) ); + dict.insert("DateMonth" , new int(OPimTodo::DateMonth) ); + dict.insert("DateYear" , new int(OPimTodo::DateYear) ); + dict.insert("Progress" , new int(OPimTodo::Progress) ); + dict.insert("CompletedDate", new int(OPimTodo::CompletedDate) ); + dict.insert("StartDate", new int(OPimTodo::StartDate) ); + dict.insert("CrossReference", new int(OPimTodo::CrossReference) ); + dict.insert("State", new int(OPimTodo::State) ); + dict.insert("Alarms", new int(OPimTodo::Alarms) ); + dict.insert("Reminders", new int(OPimTodo::Reminders) ); + dict.insert("Notifiers", new int(OPimTodo::Notifiers) ); + dict.insert("Maintainer", new int(OPimTodo::Maintainer) ); dict.insert("rtype", new int(FRType) ); @@ -181,3 +181,3 @@ bool OTodoAccessXML::load() { - OTodo ev; + OPimTodo ev; m_year = m_month = m_day = 0; @@ -244,4 +244,4 @@ bool OTodoAccessXML::load() { if ( rec && rec->doesRecur() ) { - OTimeZone utc = OTimeZone::utc(); - ORecur recu( *rec ); // call copy c'tor + OPimTimeZone utc = OPimTimeZone::utc(); + OPimRecurrence recu( *rec ); // call copy c'tor recu.setEndDate( utc.fromUTCDateTime( rp_end ).date() ); @@ -261,3 +261,3 @@ bool OTodoAccessXML::load() { } -bool OTodoAccessXML::reload() { +bool OPimTodoAccessXML::reload() { m_events.clear(); @@ -265,3 +265,3 @@ bool OTodoAccessXML::reload() { } -bool OTodoAccessXML::save() { +bool OPimTodoAccessXML::save() { // qWarning("saving"); @@ -281,3 +281,3 @@ bool OTodoAccessXML::save() { // for all todos - QMap<int, OTodo>::Iterator it; + QMap<int, OPimTodo>::Iterator it; for (it = m_events.begin(); it != m_events.end(); ++it ) { @@ -316,5 +316,5 @@ bool OTodoAccessXML::save() { } -QArray<int> OTodoAccessXML::allRecords()const { +QArray<int> OPimTodoAccessXML::allRecords()const { QArray<int> ids( m_events.count() ); - QMap<int, OTodo>::ConstIterator it; + QMap<int, OPimTodo>::ConstIterator it; int i = 0; @@ -327,3 +327,3 @@ QArray<int> OTodoAccessXML::allRecords()const { } -QArray<int> OTodoAccessXML::queryByExample( const OTodo&, int, const QDateTime& ) { +QArray<int> OPimTodoAccessXML::queryByExample( const OPimTodo&, int, const QDateTime& ) { QArray<int> ids(0); @@ -331,6 +331,6 @@ QArray<int> OTodoAccessXML::queryByExample( const OTodo&, int, const QDateTime& } -OTodo OTodoAccessXML::find( int uid )const { - OTodo todo; +OPimTodo OPimTodoAccessXML::find( int uid )const { + OPimTodo todo; todo.setUid( 0 ); // isEmpty() - QMap<int, OTodo>::ConstIterator it = m_events.find( uid ); + QMap<int, OPimTodo>::ConstIterator it = m_events.find( uid ); if ( it != m_events.end() ) @@ -340,3 +340,3 @@ OTodo OTodoAccessXML::find( int uid )const { } -void OTodoAccessXML::clear() { +void OPimTodoAccessXML::clear() { if (m_opened ) @@ -346,3 +346,3 @@ void OTodoAccessXML::clear() { } -bool OTodoAccessXML::add( const OTodo& todo ) { +bool OPimTodoAccessXML::add( const OPimTodo& todo ) { // qWarning("add"); @@ -353,3 +353,3 @@ bool OTodoAccessXML::add( const OTodo& todo ) { } -bool OTodoAccessXML::remove( int uid ) { +bool OPimTodoAccessXML::remove( int uid ) { m_changed = true; @@ -359,3 +359,3 @@ bool OTodoAccessXML::remove( int uid ) { } -bool OTodoAccessXML::replace( const OTodo& todo) { +bool OPimTodoAccessXML::replace( const OPimTodo& todo) { m_changed = true; @@ -365,3 +365,3 @@ bool OTodoAccessXML::replace( const OTodo& todo) { } -QArray<int> OTodoAccessXML::effectiveToDos( const QDate& start, +QArray<int> OPimTodoAccessXML::effectiveToDos( const QDate& start, const QDate& end, @@ -369,3 +369,3 @@ QArray<int> OTodoAccessXML::effectiveToDos( const QDate& start, QArray<int> ids( m_events.count() ); - QMap<int, OTodo>::Iterator it; + QMap<int, OPimTodo>::Iterator it; @@ -387,3 +387,3 @@ QArray<int> OTodoAccessXML::effectiveToDos( const QDate& start, } -QArray<int> OTodoAccessXML::overDue() { +QArray<int> OPimTodoAccessXML::overDue() { QArray<int> ids( m_events.count() ); @@ -391,3 +391,3 @@ QArray<int> OTodoAccessXML::overDue() { - QMap<int, OTodo>::Iterator it; + QMap<int, OPimTodo>::Iterator it; for ( it = m_events.begin(); it != m_events.end(); ++it ) { @@ -404,3 +404,3 @@ QArray<int> OTodoAccessXML::overDue() { /* private */ -void OTodoAccessXML::todo( QAsciiDict<int>* dict, OTodo& ev, +void OPimTodoAccessXML::todo( QAsciiDict<int>* dict, OPimTodo& ev, const QCString& attr, const QString& val) { @@ -418,45 +418,45 @@ void OTodoAccessXML::todo( QAsciiDict<int>* dict, OTodo& ev, switch( *find ) { - case OTodo::Uid: + case OPimTodo::Uid: ev.setUid( val.toInt() ); break; - case OTodo::Category: + case OPimTodo::Category: ev.setCategories( ev.idsFromString( val ) ); break; - case OTodo::HasDate: + case OPimTodo::HasDate: ev.setHasDueDate( val.toInt() ); break; - case OTodo::Completed: + case OPimTodo::Completed: ev.setCompleted( val.toInt() ); break; - case OTodo::Description: + case OPimTodo::Description: ev.setDescription( val ); break; - case OTodo::Summary: + case OPimTodo::Summary: ev.setSummary( val ); break; - case OTodo::Priority: + case OPimTodo::Priority: ev.setPriority( val.toInt() ); break; - case OTodo::DateDay: + case OPimTodo::DateDay: m_day = val.toInt(); break; - case OTodo::DateMonth: + case OPimTodo::DateMonth: m_month = val.toInt(); break; - case OTodo::DateYear: + case OPimTodo::DateYear: m_year = val.toInt(); break; - case OTodo::Progress: + case OPimTodo::Progress: ev.setProgress( val.toInt() ); break; - case OTodo::CompletedDate: - ev.setCompletedDate( OConversion::dateFromString( val ) ); + case OPimTodo::CompletedDate: + ev.setCompletedDate( OPimDateConversion::dateFromString( val ) ); break; - case OTodo::StartDate: - ev.setStartDate( OConversion::dateFromString( val ) ); + case OPimTodo::StartDate: + ev.setStartDate( OPimDateConversion::dateFromString( val ) ); break; - case OTodo::State: + case OPimTodo::State: ev.setState( val.toInt() ); break; - case OTodo::Alarms:{ + case OPimTodo::Alarms:{ OPimNotifyManager &manager = ev.notifiers(); @@ -466,4 +466,4 @@ void OTodoAccessXML::todo( QAsciiDict<int>* dict, OTodo& ev, qWarning("alarm: %s", alarm.join("___").latin1() ); - qWarning("alarm[0]: %s %s", alarm[0].latin1(), OConversion::dateTimeFromString( alarm[0] ).toString().latin1() ); - OPimAlarm al( alarm[2].toInt(), OConversion::dateTimeFromString( alarm[0] ), alarm[1].toInt() ); + qWarning("alarm[0]: %s %s", alarm[0].latin1(), OPimDateConversion::dateTimeFromString( alarm[0] ).toString().latin1() ); + OPimAlarm al( alarm[2].toInt(), OPimDateConversion::dateTimeFromString( alarm[0] ), alarm[1].toInt() ); manager.add( al ); @@ -472,3 +472,3 @@ void OTodoAccessXML::todo( QAsciiDict<int>* dict, OTodo& ev, break; - case OTodo::Reminders:{ + case OPimTodo::Reminders:{ OPimNotifyManager &manager = ev.notifiers(); @@ -481,3 +481,3 @@ void OTodoAccessXML::todo( QAsciiDict<int>* dict, OTodo& ev, break; - case OTodo::CrossReference: + case OPimTodo::CrossReference: { @@ -501,13 +501,13 @@ void OTodoAccessXML::todo( QAsciiDict<int>* dict, OTodo& ev, if ( val == "Daily" ) - recur()->setType( ORecur::Daily ); + recur()->setType( OPimRecurrence::Daily ); else if ( val == "Weekly" ) - recur()->setType( ORecur::Weekly); + recur()->setType( OPimRecurrence::Weekly); else if ( val == "MonthlyDay" ) - recur()->setType( ORecur::MonthlyDay ); + recur()->setType( OPimRecurrence::MonthlyDay ); else if ( val == "MonthlyDate" ) - recur()->setType( ORecur::MonthlyDate ); + recur()->setType( OPimRecurrence::MonthlyDate ); else if ( val == "Yearly" ) - recur()->setType( ORecur::Yearly ); + recur()->setType( OPimRecurrence::Yearly ); else - recur()->setType( ORecur::NoRepeat ); + recur()->setType( OPimRecurrence::NoRepeat ); break; @@ -555,3 +555,3 @@ QString customToXml(const QMap<QString, QString>& customMap ) -QString OTodoAccessXML::toString( const OTodo& ev )const { +QString OPimTodoAccessXML::toString( const OPimTodo& ev )const { QString str; @@ -593,5 +593,5 @@ QString OTodoAccessXML::toString( const OTodo& ev )const { if ( ev.hasStartDate() ) - str += "StartDate=\""+ OConversion::dateToString( ev.startDate() ) +"\" "; + str += "StartDate=\""+ OPimDateConversion::dateToString( ev.startDate() ) +"\" "; if ( ev.hasCompletedDate() ) - str += "CompletedDate=\""+ OConversion::dateToString( ev.completedDate() ) +"\" "; + str += "CompletedDate=\""+ OPimDateConversion::dateToString( ev.completedDate() ) +"\" "; if ( ev.hasState() ) @@ -612,3 +612,3 @@ QString OTodoAccessXML::toString( const OTodo& ev )const { if ( (*it).dateTime().isValid() ) { - als << OConversion::dateTimeToString( (*it).dateTime() ) + als << OPimDateConversion::dateTimeToString( (*it).dateTime() ) + ":" + QString::number( (*it).duration() ) @@ -624,3 +624,3 @@ QString OTodoAccessXML::toString( const OTodo& ev )const { /* - * now the same for reminders but more easy. We just save the uid of the OEvent. + * now the same for reminders but more easy. We just save the uid of the OPimEvent. */ @@ -641,3 +641,3 @@ QString OTodoAccessXML::toString( const OTodo& ev )const { } -QString OTodoAccessXML::toString( const QArray<int>& ints ) const { +QString OPimTodoAccessXML::toString( const QArray<int>& ints ) const { return Qtopia::Record::idsToString( ints ); @@ -650,4 +650,4 @@ QString OTodoAccessXML::toString( const QArray<int>& ints ) const { -struct OTodoXMLContainer { - OTodo todo; +struct OPimTodoXMLContainer { + OPimTodo todo; }; @@ -655,3 +655,3 @@ struct OTodoXMLContainer { namespace { - inline QString string( const OTodo& todo) { + inline QString string( const OPimTodo& todo) { return todo.summary().isEmpty() ? @@ -660,3 +660,3 @@ namespace { } - inline int completed( const OTodo& todo1, const OTodo& todo2) { + inline int completed( const OPimTodo& todo1, const OPimTodo& todo2) { int ret = 0; @@ -666,9 +666,9 @@ namespace { } - inline int priority( const OTodo& t1, const OTodo& t2) { + inline int priority( const OPimTodo& t1, const OPimTodo& t2) { return ( t1.priority() - t2.priority() ); } - inline int description( const OTodo& t1, const OTodo& t2) { + inline int description( const OPimTodo& t1, const OPimTodo& t2) { return QString::compare( string(t1), string(t2) ); } - inline int deadline( const OTodo& t1, const OTodo& t2) { + inline int deadline( const OPimTodo& t1, const OPimTodo& t2) { int ret = 0; @@ -705,6 +705,6 @@ namespace { */ -class OTodoXMLVector : public QVector<OTodoXMLContainer> { +class OPimTodoXMLVector : public QVector<OPimTodoXMLContainer> { public: - OTodoXMLVector(int size, bool asc, int sort) - : QVector<OTodoXMLContainer>( size ) + OPimTodoXMLVector(int size, bool asc, int sort) + : QVector<OPimTodoXMLContainer>( size ) { @@ -715,3 +715,3 @@ public: /* return the summary/description */ - QString string( const OTodo& todo) { + QString string( const OPimTodo& todo) { return todo.summary().isEmpty() ? @@ -728,4 +728,4 @@ public: int ret =0; - OTodoXMLContainer* con1 = (OTodoXMLContainer*)d1; - OTodoXMLContainer* con2 = (OTodoXMLContainer*)d2; + OPimTodoXMLContainer* con1 = (OPimTodoXMLContainer*)d1; + OPimTodoXMLContainer* con2 = (OPimTodoXMLContainer*)d2; @@ -818,6 +818,6 @@ public: -QArray<int> OTodoAccessXML::sorted( bool asc, int sortOrder, +QArray<int> OPimTodoAccessXML::sorted( bool asc, int sortOrder, int sortFilter, int cat ) { - OTodoXMLVector vector(m_events.count(), asc,sortOrder ); - QMap<int, OTodo>::Iterator it; + OPimTodoXMLVector vector(m_events.count(), asc,sortOrder ); + QMap<int, OPimTodo>::Iterator it; int item = 0; @@ -853,3 +853,3 @@ QArray<int> OTodoAccessXML::sorted( bool asc, int sortOrder, - OTodoXMLContainer* con = new OTodoXMLContainer(); + OPimTodoXMLContainer* con = new OPimTodoXMLContainer(); con->todo = (*it); @@ -868,5 +868,5 @@ QArray<int> OTodoAccessXML::sorted( bool asc, int sortOrder, }; -void OTodoAccessXML::removeAllCompleted() { - QMap<int, OTodo> events = m_events; - for ( QMap<int, OTodo>::Iterator it = m_events.begin(); it != m_events.end(); ++it ) { +void OPimTodoAccessXML::removeAllCompleted() { + QMap<int, OPimTodo> events = m_events; + for ( QMap<int, OPimTodo>::Iterator it = m_events.begin(); it != m_events.end(); ++it ) { if ( (*it).isCompleted() ) @@ -876,3 +876,3 @@ void OTodoAccessXML::removeAllCompleted() { } -QBitArray OTodoAccessXML::supports()const { +QBitArray OPimTodoAccessXML::supports()const { static QBitArray ar = sup(); @@ -880,10 +880,10 @@ QBitArray OTodoAccessXML::supports()const { } -QBitArray OTodoAccessXML::sup() { - QBitArray ar( OTodo::CompletedDate +1 ); +QBitArray OPimTodoAccessXML::sup() { + QBitArray ar( OPimTodo::CompletedDate +1 ); ar.fill( true ); - ar[OTodo::CrossReference] = false; - ar[OTodo::State ] = false; - ar[OTodo::Reminders] = false; - ar[OTodo::Notifiers] = false; - ar[OTodo::Maintainer] = false; + ar[OPimTodo::CrossReference] = false; + ar[OPimTodo::State ] = false; + ar[OPimTodo::Reminders] = false; + ar[OPimTodo::Notifiers] = false; + ar[OPimTodo::Maintainer] = false; @@ -891,3 +891,3 @@ QBitArray OTodoAccessXML::sup() { } -QArray<int> OTodoAccessXML::matchRegexp( const QRegExp &r ) const +QArray<int> OPimTodoAccessXML::matchRegexp( const QRegExp &r ) const { @@ -896,3 +896,3 @@ QArray<int> OTodoAccessXML::matchRegexp( const QRegExp &r ) const - QMap<int, OTodo>::ConstIterator it; + QMap<int, OPimTodo>::ConstIterator it; for (it = m_events.begin(); it != m_events.end(); ++it ) { diff --git a/libopie2/opiepim/backend/otodoaccessxml.h b/libopie2/opiepim/backend/otodoaccessxml.h index d634398..3a51543 100644 --- a/libopie2/opiepim/backend/otodoaccessxml.h +++ b/libopie2/opiepim/backend/otodoaccessxml.h @@ -39,3 +39,3 @@ namespace Opie { -class OTodoAccessXML : public OTodoAccessBackend { +class OPimTodoAccessXML : public OPimTodoAccessBackend { public: @@ -44,5 +44,5 @@ public: */ - OTodoAccessXML( const QString& appName, + OPimTodoAccessXML( const QString& appName, const QString& fileName = QString::null ); - ~OTodoAccessXML(); + ~OPimTodoAccessXML(); @@ -54,9 +54,9 @@ public: QArray<int> matchRegexp(const QRegExp &r) const; - QArray<int> queryByExample( const OTodo&, int querysettings, const QDateTime& d = QDateTime() ); - OTodo find( int uid )const; + QArray<int> queryByExample( const OPimTodo&, int querysettings, const QDateTime& d = QDateTime() ); + OPimTodo find( int uid )const; void clear(); - bool add( const OTodo& ); + bool add( const OPimTodo& ); bool remove( int uid ); void removeAllCompleted(); - bool replace( const OTodo& ); + bool replace( const OPimTodo& ); @@ -72,6 +72,6 @@ private: static QBitArray sup(); - void todo( QAsciiDict<int>*, OTodo&,const QCString&,const QString& ); - QString toString( const OTodo& )const; + void todo( QAsciiDict<int>*, OPimTodo&,const QCString&,const QString& ); + QString toString( const OPimTodo& )const; QString toString( const QArray<int>& ints ) const; - QMap<int, OTodo> m_events; + QMap<int, OPimTodo> m_events; QString m_file; @@ -80,4 +80,4 @@ private: bool m_changed : 1; - class OTodoAccessXMLPrivate; - OTodoAccessXMLPrivate* d; + class OPimTodoAccessXMLPrivate; + OPimTodoAccessXMLPrivate* d; int m_year, m_month, m_day; |