author | zecke <zecke> | 2004-11-18 21:49:23 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-11-18 21:49:23 (UTC) |
commit | 1e7f8f22fc10e3ed85b6563332ddc348c95792d0 (patch) (side-by-side diff) | |
tree | 59498ba1d4a7dbff05228c09bebcf0c849e916be /libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp | |
parent | 41fa1c196965f17f9748f835d90c307b7e594883 (diff) | |
download | opie-1e7f8f22fc10e3ed85b6563332ddc348c95792d0.zip opie-1e7f8f22fc10e3ed85b6563332ddc348c95792d0.tar.gz opie-1e7f8f22fc10e3ed85b6563332ddc348c95792d0.tar.bz2 |
Backend Changes:
Each Backend can:
-Sort and Filter a set of Records/AllRecords (which can be filtered again)
-QueryByExample by every Backend
-Occurrences for a period of time and a QDateTime
-More common implementation
-OPimBackendOccurrence with common splitting to OPimOccurrence
Diffstat (limited to 'libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp b/libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp index 0f99d50..55e47e2 100644 --- a/libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp +++ b/libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp @@ -119,13 +119,12 @@ namespace { FRecChildren, FExceptions }; // FIXME: Use OPimEvent::toMap() here !! (eilers) static void save( const OPimEvent& ev, QString& buf ) { - owarn << "Saving " << ev.uid() << " " << ev.description() << "" << oendl; buf += " description=\"" + Qtopia::escapeString(ev.description() ) + "\""; if (!ev.location().isEmpty() ) buf += " location=\"" + Qtopia::escapeString(ev.location() ) + "\""; if (!ev.categories().isEmpty() ) buf += " categories=\""+ Qtopia::escapeString( Qtopia::Record::idsToString( ev.categories() ) ) + "\""; @@ -323,15 +322,13 @@ bool ODateBookAccessBackend_XML::remove( int uid ) { return true; } bool ODateBookAccessBackend_XML::replace( const OPimEvent& ev ) { replace( ev.uid() ); // ??? Shouldn't this be "remove( ev.uid() ) ??? (eilers) return add( ev ); } -QArray<int> ODateBookAccessBackend_XML::rawEvents()const { - return allRecords(); -} + QArray<int> ODateBookAccessBackend_XML::rawRepeats()const { QArray<int> ints( m_rep.count() ); uint i = 0; QMap<int, OPimEvent>::ConstIterator it; for ( it = m_rep.begin(); it != m_rep.end(); ++it ) { @@ -350,21 +347,21 @@ QArray<int> ODateBookAccessBackend_XML::nonRepeats()const { ints[i] = it.key(); i++; } return ints; } -OPimEvent::ValueList ODateBookAccessBackend_XML::directNonRepeats() { +OPimEvent::ValueList ODateBookAccessBackend_XML::directNonRepeats()const { OPimEvent::ValueList list; QMap<int, OPimEvent>::ConstIterator it; for (it = m_raw.begin(); it != m_raw.end(); ++it ) list.append( it.data() ); return list; } -OPimEvent::ValueList ODateBookAccessBackend_XML::directRawRepeats() { +OPimEvent::ValueList ODateBookAccessBackend_XML::directRawRepeats()const { OPimEvent::ValueList list; QMap<int, OPimEvent>::ConstIterator it; for (it = m_rep.begin(); it != m_rep.end(); ++it ) list.append( it.data() ); return list; @@ -536,24 +533,22 @@ void ODateBookAccessBackend_XML::finalizeRecord( OPimEvent& ev ) { if (alarmTime != -1 ) { QDateTime dt = ev.startDateTime().addSecs( -1*alarmTime*60 ); OPimAlarm al( snd , dt ); ev.notifiers().add( al ); } if ( m_raw.contains( ev.uid() ) || m_rep.contains( ev.uid() ) ) { - owarn << "already contains assign uid" << oendl; ev.setUid( 1 ); } if ( ev.hasRecurrence() ) m_rep.insert( ev.uid(), ev ); else m_raw.insert( ev.uid(), ev ); } void ODateBookAccessBackend_XML::setField( OPimEvent& e, int id, const QString& value) { -// owarn << " setting " << value << "" << oendl; switch( id ) { case FDescription: e.setDescription( value ); break; case FLocation: e.setLocation( value ); @@ -631,13 +626,12 @@ void ODateBookAccessBackend_XML::setField( OPimEvent& e, int id, const QString& } break; case FExceptions:{ QStringList list = QStringList::split(' ', value ); for (QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { QDate date( (*it).left(4).toInt(), (*it).mid(4, 2).toInt(), (*it).right(2).toInt() ); - owarn << "adding exception " << date.toString() << "" << oendl; recur()->exceptions().append( date ); } } break; case FTimeZone: m_noTimeZone = false; |