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) (show whitespace changes)
-rw-r--r--libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp42
1 files changed, 24 insertions, 18 deletions
diff --git a/libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp b/libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp
index 77c0253..2ff36e3 100644
--- a/libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp
+++ b/libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp
@@ -23,35 +23,41 @@
-_. . . )=. = Library General Public License along with
-- :-=` this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
+
+/* OPIE */
+#include <opie2/opimnotifymanager.h>
+#include <opie2/opimrecurrence.h>
+#include <opie2/opimtimezone.h>
+#include <opie2/odatebookaccessbackend_xml.h>
+#include <opie2/odebug.h>
+
+#include <qtopia/global.h>
+#include <qtopia/stringutil.h>
+#include <qtopia/timeconversion.h>
+
+/* QT */
+#include <qasciidict.h>
+#include <qfile.h>
+
+/* STD */
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <unistd.h>
-#include <qasciidict.h>
-#include <qfile.h>
-
-#include <qtopia/global.h>
-#include <qtopia/stringutil.h>
-#include <qtopia/timeconversion.h>
-
-#include <opie2/opimnotifymanager.h>
-#include <opie2/opimrecurrence.h>
-#include <opie2/opimtimezone.h>
-#include <opie2/odatebookaccessbackend_xml.h>
using namespace Opie;
namespace {
// FROM TT again
char *strstrlen(const char *haystack, int hLen, const char* needle, int nLen)
@@ -113,13 +119,13 @@ namespace {
FRecChildren,
FExceptions
};
// FIXME: Use OPimEvent::toMap() here !! (eilers)
inline void save( const OPimEvent& ev, QString& buf ) {
- qWarning("Saving %d %s", ev.uid(), ev.description().latin1() );
+ owarn << "Saving " << ev.uid() << " " << ev.description() << "" << oendl;
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() ) + "\"";
@@ -487,16 +493,16 @@ void ODateBookAccessBackend_XML::finalizeRecord( OPimEvent& ev ) {
OPimTimeZone utc = OPimTimeZone::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 );
+ // owarn << " Start is " << start << "" << oendl;
OPimTimeZone zone( ev.timeZone().isEmpty() ? OPimTimeZone::current() : ev.timeZone() );
QDateTime date = zone.toDateTime( start );
- qWarning(" Start is %s", date.toString().latin1() );
+ owarn << " Start is " << date.toString() << "" << oendl;
ev.setStartDateTime( zone.toDateTime( date, OPimTimeZone::current() ) );
date = zone.toDateTime( end );
ev.setEndDateTime ( zone.toDateTime( date, OPimTimeZone::current() ) );
}
if ( rec && rec->doesRecur() ) {
@@ -511,24 +517,24 @@ 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() ) ) {
- qWarning("already contains assign uid");
+ owarn << "already contains assign uid" << oendl;
ev.setUid( 1 );
}
- qWarning("addind %d %s", ev.uid(), ev.description().latin1() );
+ owarn << "addind " << ev.uid() << " " << ev.description() << "" << oendl;
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) {
-// qWarning(" setting %s", value.latin1() );
+// owarn << " setting " << value << "" << oendl;
switch( id ) {
case FDescription:
e.setDescription( value );
break;
case FLocation:
e.setLocation( value );
@@ -607,13 +613,13 @@ 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() );
- qWarning("adding exception %s", date.toString().latin1() );
+ owarn << "adding exception " << date.toString() << "" << oendl;
recur()->exceptions().append( date );
}
}
break;
case FTimeZone:
if ( value != "None" )