author | mickeyl <mickeyl> | 2004-02-24 12:46:23 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-02-24 12:46:23 (UTC) |
commit | 911473db35a9fce5f3589f03c27210456faaba86 (patch) (side-by-side diff) | |
tree | 7d55b6117b24de6ab18747b00a4641d38001c0ed /libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp | |
parent | a2ead23c3614fe581261455cb4c3f31cee2098f3 (diff) | |
download | opie-911473db35a9fce5f3589f03c27210456faaba86.zip opie-911473db35a9fce5f3589f03c27210456faaba86.tar.gz opie-911473db35a9fce5f3589f03c27210456faaba86.tar.bz2 |
*phew* here is the class and file rename patch. not converted yet: backend,
but that will be not visible to application classes so we can change it later.
Diffstat (limited to 'libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp | 158 |
1 files changed, 79 insertions, 79 deletions
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() { |