summaryrefslogtreecommitdiff
path: root/libopie2/opiepim
Side-by-side diff
Diffstat (limited to 'libopie2/opiepim') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp7
-rw-r--r--libopie2/opiepim/ui/opimmainwindow.h2
2 files changed, 7 insertions, 2 deletions
diff --git a/libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp b/libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp
index 24b69fe..4a6b7b8 100644
--- a/libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp
+++ b/libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp
@@ -75,24 +75,25 @@ namespace {
FRHasEndDate,
FREndDate,
FRStart,
FREnd,
FNote,
FCreated,
FTimeZone,
FRecParent,
FRecChildren,
FExceptions
};
inline void save( const OEvent& ev, QString& buf ) {
+ qWarning("Saving %d %s", ev.uid(), ev.description().latin1() );
buf += " description=\"" + Qtopia::escapeString(ev.description() ) + "\"";
if (!ev.location().isEmpty() )
buf += " location=\"" + Qtopia::escapeString(ev.location() ) + "\"";
buf += " categories=\""+ Qtopia::escapeString( Qtopia::Record::idsToString( ev.categories() ) ) + "\"";
buf += " uid=\"" + QString::number( ev.uid() ) + "\"";
if (ev.isAllDay() )
buf += " type=\"AllDay\"";
if (ev.hasNotifiers() ) {
OPimAlarm alarm = ev.notifiers().alarms()[0]; // take only the first
@@ -116,24 +117,25 @@ 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() ) ) ) + "\"";
if (!ev.note().isEmpty() ) {
buf += " note=\"" + Qtopia::escapeString( ev.note() ) + "\"";
}
buf += " timezone=\"";
if ( ev.timeZone().isEmpty() )
buf += "None";
else
buf += ev.timeZone();
+ buf += "\"";
if (ev.parent() != 0 ) {
buf += " recparent=\""+QString::number(ev.parent() )+"\"";
}
if (ev.children().count() != 0 ) {
QArray<int> children = ev.children();
buf += " recchildren=\"";
for ( uint i = 0; i < children.count(); i++ ) {
if ( i != 0 ) buf += " ";
buf += QString::number( children[i] );
}
@@ -425,65 +427,68 @@ bool ODateBookAccessBackend_XML::loadFile() {
/*
* add key + value
*/
find = dict[attr.data()];
if (!find)
ev.setCustomField( attr, value );
else {
setField( ev, *find, value );
}
}
/* time to finalize */
finalizeRecord( ev );
- add( ev );
delete rec;
}
::munmap(map_addr, attribute.st_size );
m_changed = false; // changed during add
return true;
}
void ODateBookAccessBackend_XML::finalizeRecord( OEvent& ev ) {
/* AllDay is alway in UTC */
if ( ev.isAllDay() ) {
OTimeZone utc = OTimeZone::utc();
ev.setStartDateTime( utc.fromUTCDateTime( start ) );
ev.setEndDateTime ( utc.fromUTCDateTime( end ) );
ev.setTimeZone( "UTC"); // make sure it is really utc
}else {
/* to current date time */
+ qWarning(" Start is %d", start );
OTimeZone zone( ev.timeZone().isEmpty() ? OTimeZone::current() : ev.timeZone() );
QDateTime date = zone.toDateTime( start );
+ qWarning(" Start is %s", date.toString().latin1() );
ev.setStartDateTime( zone.toDateTime( date, OTimeZone::current() ) );
date = zone.toDateTime( end );
ev.setEndDateTime ( zone.toDateTime( date, OTimeZone::current() ) );
}
if ( rec && rec->doesRecur() ) {
OTimeZone utc = OTimeZone::utc();
ORecur recu( *rec ); // call copy c'tor;
recu.setEndDate ( utc.fromUTCDateTime( rp_end ).date() );
recu.setCreatedDateTime( utc.fromUTCDateTime( created ) );
recu.setStart( ev.startDateTime().date() );
ev.setRecurrence( recu );
}
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() ) ) {
+ qWarning("already contains assign uid");
ev.setUid( 1 );
}
+ qWarning("addind %d %s", ev.uid(), ev.description().latin1() );
if ( ev.hasRecurrence() )
m_rep.insert( ev.uid(), ev );
else
m_raw.insert( ev.uid(), ev );
}
void ODateBookAccessBackend_XML::setField( OEvent& e, int id, const QString& value) {
// qWarning(" setting %s", value.latin1() );
switch( id ) {
case FDescription:
e.setDescription( value );
break;
diff --git a/libopie2/opiepim/ui/opimmainwindow.h b/libopie2/opiepim/ui/opimmainwindow.h
index 34b8a71..dca3c82 100644
--- a/libopie2/opiepim/ui/opimmainwindow.h
+++ b/libopie2/opiepim/ui/opimmainwindow.h
@@ -37,25 +37,25 @@ protected slots:
* couldn't be handled by this window
*/
virtual void doSetDocument( const QString& );
/* for syncing */
virtual void flush() = 0;
virtual void reload() = 0;
/** create a new Records and return the uid */
virtual int create() = 0;
/** remove a record with UID == uid */
virtual bool remove( int uid ) = 0;
/** beam the record with UID = uid */
- virtual void beam( int uid , int transport = IrDa) = 0;
+ virtual void beam( int uid ) = 0;
/** show the record with UID == uid */
virtual void show( int uid ) = 0;
/** edit the record */
virtual void edit( int uid ) = 0;
/** make a copy of it! */
virtual void add( const OPimRecord& ) = 0;
QCopChannel* channel();