summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp
Side-by-side diff
Diffstat (limited to 'libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp12
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;