summaryrefslogtreecommitdiff
authormickeyl <mickeyl>2004-02-23 13:15:42 (UTC)
committer mickeyl <mickeyl>2004-02-23 13:15:42 (UTC)
commitf9f0c26d9ac94586ffc36efa1b582ece3dbc43cf (patch) (side-by-side diff)
tree4044006e676c78370fdeccf960ea4214f13eabd2
parent2d37d653310da0a9d6e2e2e6c9f5bf092e54cbbb (diff)
downloadopie-f9f0c26d9ac94586ffc36efa1b582ece3dbc43cf.zip
opie-f9f0c26d9ac94586ffc36efa1b582ece3dbc43cf.tar.gz
opie-f9f0c26d9ac94586ffc36efa1b582ece3dbc43cf.tar.bz2
cosmetics
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiepim/core/opimnotify.cpp219
-rw-r--r--libopie2/opiepim/core/opimnotify.h21
-rw-r--r--libopie2/opiepim/core/opimnotifymanager.cpp120
-rw-r--r--libopie2/opiepim/core/opimnotifymanager.h18
-rw-r--r--libopie2/opiepim/core/opimrecord.cpp117
-rw-r--r--libopie2/opiepim/core/opimrecord.h28
-rw-r--r--libopie2/opiepim/ocontact.cpp235
-rw-r--r--libopie2/opiepim/ocontact.h11
-rw-r--r--libopie2/opiepim/ocontactfields.cpp40
-rw-r--r--libopie2/opiepim/ocontactfields.h16
-rw-r--r--libopie2/opiepim/oevent.cpp534
-rw-r--r--libopie2/opiepim/oevent.h33
-rw-r--r--libopie2/opiepim/orecordlist.h142
-rw-r--r--libopie2/opiepim/otodo.cpp294
-rw-r--r--libopie2/opiepim/otodo.h27
15 files changed, 1349 insertions, 506 deletions
diff --git a/libopie2/opiepim/core/opimnotify.cpp b/libopie2/opiepim/core/opimnotify.cpp
index c61f9da..43858f0 100644
--- a/libopie2/opiepim/core/opimnotify.cpp
+++ b/libopie2/opiepim/core/opimnotify.cpp
@@ -28,11 +28,15 @@
*/
-#include <qshared.h>
-#include <opie2/opimnotify.h>
+#include "opimnotify.h"
-namespace Opie {
+/* QT */
+#include <qshared.h>
-struct OPimNotify::Data : public QShared {
- Data() : QShared(),dur(-1),parent(0) {
+namespace Opie
+{
+struct OPimNotify::Data : public QShared
+{
+ Data() : QShared(), dur( -1 ), parent( 0 )
+ {
}
@@ -44,3 +48,4 @@ struct OPimNotify::Data : public QShared {
-OPimNotify::OPimNotify( const QDateTime& start, int duration, int parent ) {
+OPimNotify::OPimNotify( const QDateTime& start, int duration, int parent )
+{
data = new Data;
@@ -50,2 +55,4 @@ OPimNotify::OPimNotify( const QDateTime& start, int duration, int parent ) {
}
+
+
OPimNotify::OPimNotify( const OPimNotify& noti)
@@ -55,4 +62,8 @@ OPimNotify::OPimNotify( const OPimNotify& noti)
}
-OPimNotify::~OPimNotify() {
- if ( data->deref() ) {
+
+
+OPimNotify::~OPimNotify()
+{
+ if ( data->deref() )
+ {
delete data;
@@ -62,3 +73,5 @@ OPimNotify::~OPimNotify() {
-OPimNotify &OPimNotify::operator=( const OPimNotify& noti) {
+
+OPimNotify &OPimNotify::operator=( const OPimNotify& noti )
+{
noti.data->ref();
@@ -69,3 +82,6 @@ OPimNotify &OPimNotify::operator=( const OPimNotify& noti) {
}
-bool OPimNotify::operator==( const OPimNotify& noti ) {
+
+
+bool OPimNotify::operator==( const OPimNotify& noti )
+{
if ( data == noti.data ) return true;
@@ -78,18 +94,36 @@ bool OPimNotify::operator==( const OPimNotify& noti ) {
}
-QDateTime OPimNotify::dateTime()const {
+
+
+QDateTime OPimNotify::dateTime() const
+{
return data->start;
}
-QString OPimNotify::service()const {
+
+
+QString OPimNotify::service() const
+{
return data->application;
}
-int OPimNotify::parent()const {
+
+
+int OPimNotify::parent() const
+{
return data->parent;
}
-int OPimNotify::duration()const {
+
+
+int OPimNotify::duration() const
+{
return data->dur;
}
-QDateTime OPimNotify::endTime()const {
+
+
+QDateTime OPimNotify::endTime() const
+{
return QDateTime( data->start.date(), data->start.time().addSecs( data->dur) );
}
-void OPimNotify::setDateTime( const QDateTime& time ) {
+
+
+void OPimNotify::setDateTime( const QDateTime& time )
+{
copyIntern();
@@ -97,3 +131,6 @@ void OPimNotify::setDateTime( const QDateTime& time ) {
}
-void OPimNotify::setDuration( int dur ) {
+
+
+void OPimNotify::setDuration( int dur )
+{
copyIntern();
@@ -101,3 +138,6 @@ void OPimNotify::setDuration( int dur ) {
}
-void OPimNotify::setParent( int uid ) {
+
+
+void OPimNotify::setParent( int uid )
+{
copyIntern();
@@ -105,3 +145,6 @@ void OPimNotify::setParent( int uid ) {
}
-void OPimNotify::setService( const QString& str ) {
+
+
+void OPimNotify::setService( const QString& str )
+{
copyIntern();
@@ -109,4 +152,8 @@ void OPimNotify::setService( const QString& str ) {
}
-void OPimNotify::copyIntern() {
- if ( data->count != 1 ) {
+
+
+void OPimNotify::copyIntern()
+{
+ if ( data->count != 1 )
+ {
data->deref();
@@ -120,4 +167,8 @@ void OPimNotify::copyIntern() {
}
-void OPimNotify::deref() {
- if ( data->deref() ) {
+
+
+void OPimNotify::deref()
+{
+ if ( data->deref() )
+ {
delete data;
@@ -127,5 +178,8 @@ void OPimNotify::deref() {
+
/***********************************************************/
-struct OPimAlarm::Data : public QShared {
- Data() : QShared() {
+struct OPimAlarm::Data : public QShared
+{
+ Data() : QShared()
+ {
sound = 1;
@@ -135,2 +189,4 @@ struct OPimAlarm::Data : public QShared {
};
+
+
OPimAlarm::OPimAlarm( int sound, const QDateTime& start, int duration, int parent )
@@ -141,2 +197,4 @@ OPimAlarm::OPimAlarm( int sound, const QDateTime& start, int duration, int paren
}
+
+
OPimAlarm::OPimAlarm( const OPimAlarm& al)
@@ -146,4 +204,8 @@ OPimAlarm::OPimAlarm( const OPimAlarm& al)
}
-OPimAlarm::~OPimAlarm() {
- if ( data->deref() ) {
+
+
+OPimAlarm::~OPimAlarm()
+{
+ if ( data->deref() )
+ {
delete data;
@@ -152,2 +214,4 @@ OPimAlarm::~OPimAlarm() {
}
+
+
OPimAlarm &OPimAlarm::operator=( const OPimAlarm& al)
@@ -163,3 +227,6 @@ OPimAlarm &OPimAlarm::operator=( const OPimAlarm& al)
}
-bool OPimAlarm::operator==( const OPimAlarm& al) {
+
+
+bool OPimAlarm::operator==( const OPimAlarm& al )
+{
if ( data->sound != al.data->sound ) return false;
@@ -170,12 +237,24 @@ bool OPimAlarm::operator==( const OPimAlarm& al) {
}
-QString OPimAlarm::type()const {
+
+
+QString OPimAlarm::type() const
+{
return QString::fromLatin1("OPimAlarm");
}
-int OPimAlarm::sound()const {
+
+
+int OPimAlarm::sound() const
+{
return data->sound;
}
-QString OPimAlarm::file()const {
+
+
+QString OPimAlarm::file() const
+{
return data->file;
}
-void OPimAlarm::setSound( int snd) {
+
+
+void OPimAlarm::setSound( int snd )
+{
copyIntern();
@@ -183,3 +262,6 @@ void OPimAlarm::setSound( int snd) {
}
-void OPimAlarm::setFile( const QString& sound ) {
+
+
+void OPimAlarm::setFile( const QString& sound )
+{
copyIntern();
@@ -187,4 +269,8 @@ void OPimAlarm::setFile( const QString& sound ) {
}
-void OPimAlarm::deref() {
- if ( data->deref() ) {
+
+
+void OPimAlarm::deref()
+{
+ if ( data->deref() )
+ {
delete data;
@@ -193,4 +279,8 @@ void OPimAlarm::deref() {
}
-void OPimAlarm::copyIntern() {
- if ( data->count != 1 ) {
+
+
+void OPimAlarm::copyIntern()
+{
+ if ( data->count != 1 )
+ {
data->deref();
@@ -202,6 +292,9 @@ void OPimAlarm::copyIntern() {
}
+
+
/************************/
-struct OPimReminder::Data : public QShared {
- Data() : QShared(), record( 0) {
- }
+struct OPimReminder::Data : public QShared
+{
+ Data() : QShared(), record( 0 )
+ {}
int record;
@@ -209,2 +302,4 @@ struct OPimReminder::Data : public QShared {
};
+
+
OPimReminder::OPimReminder( int uid, const QDateTime& start, int dur, int parent )
@@ -215,2 +310,4 @@ OPimReminder::OPimReminder( int uid, const QDateTime& start, int dur, int paren
}
+
+
OPimReminder::OPimReminder( const OPimReminder& rem )
@@ -220,3 +317,6 @@ OPimReminder::OPimReminder( const OPimReminder& rem )
}
-OPimReminder& OPimReminder::operator=( const OPimReminder& rem) {
+
+
+OPimReminder& OPimReminder::operator=( const OPimReminder& rem )
+{
OPimNotify::operator=(rem );
@@ -229,3 +329,6 @@ OPimReminder& OPimReminder::operator=( const OPimReminder& rem) {
}
-bool OPimReminder::operator==( const OPimReminder& rem) {
+
+
+bool OPimReminder::operator==( const OPimReminder& rem )
+{
if ( data->record != rem.data->record ) return false;
@@ -234,9 +337,18 @@ bool OPimReminder::operator==( const OPimReminder& rem) {
}
-QString OPimReminder::type()const {
+
+
+QString OPimReminder::type() const
+{
return QString::fromLatin1("OPimReminder");
}
-int OPimReminder::recordUid()const {
+
+
+int OPimReminder::recordUid() const
+{
return data->record;
}
-void OPimReminder::setRecordUid( int uid ) {
+
+
+void OPimReminder::setRecordUid( int uid )
+{
copyIntern();
@@ -244,4 +356,8 @@ void OPimReminder::setRecordUid( int uid ) {
}
-void OPimReminder::deref() {
- if ( data->deref() ) {
+
+
+void OPimReminder::deref()
+{
+ if ( data->deref() )
+ {
delete data;
@@ -250,4 +366,8 @@ void OPimReminder::deref() {
}
-void OPimReminder::copyIntern() {
- if ( data->count != 1 ) {
+
+
+void OPimReminder::copyIntern()
+{
+ if ( data->count != 1 )
+ {
Data* da = new Data;
@@ -257,2 +377,3 @@ void OPimReminder::copyIntern() {
}
+
}
diff --git a/libopie2/opiepim/core/opimnotify.h b/libopie2/opiepim/core/opimnotify.h
index fed3970..d0e40ca 100644
--- a/libopie2/opiepim/core/opimnotify.h
+++ b/libopie2/opiepim/core/opimnotify.h
@@ -28,5 +28,7 @@
*/
-#ifndef OPIE_PIM_NOTIFY_H
-#define OPIE_PIM_NOTIFY_H
+#ifndef OPIMNOTIFY_H
+#define OPIMNOTIFY_H
+
+/* QT */
#include <qdatetime.h>
@@ -34,4 +36,4 @@
-
-namespace Opie {
+namespace Opie
+{
/**
@@ -49,3 +51,5 @@ namespace Opie {
*/
-class OPimNotify {
+class OPimNotify
+{
+
public:
@@ -102,3 +106,4 @@ private:
*/
-class OPimAlarm : public OPimNotify {
+class OPimAlarm : public OPimNotify
+{
public:
@@ -137,5 +142,5 @@ private:
*/
-class OPimReminder : public OPimNotify {
+class OPimReminder : public OPimNotify
+{
public:
-
/**
diff --git a/libopie2/opiepim/core/opimnotifymanager.cpp b/libopie2/opiepim/core/opimnotifymanager.cpp
index 1771fad..a54d597 100644
--- a/libopie2/opiepim/core/opimnotifymanager.cpp
+++ b/libopie2/opiepim/core/opimnotifymanager.cpp
@@ -28,9 +28,13 @@
*/
-#include <opie2/opimnotifymanager.h>
+#include "opimnotifymanager.h"
+
+/* OPIE */
#include <opie2/oconversion.h>
+/* QT */
#include <qstringlist.h>
-namespace Opie {
+namespace Opie
+{
@@ -39,10 +43,18 @@ OPimNotifyManager::OPimNotifyManager( const Reminders& rem, const Alarms& al)
{}
-OPimNotifyManager::~OPimNotifyManager() {
-}
+
+
+OPimNotifyManager::~OPimNotifyManager()
+{}
+
+
/* use static_cast and type instead of dynamic... */
-void OPimNotifyManager::add( const OPimNotify& noti) {
- if ( noti.type() == QString::fromLatin1("OPimReminder") ) {
+void OPimNotifyManager::add( const OPimNotify& noti )
+{
+ if ( noti.type() == QString::fromLatin1( "OPimReminder" ) )
+ {
const OPimReminder& rem = static_cast<const OPimReminder&>(noti);
m_rem.append( rem );
- }else if ( noti.type() == QString::fromLatin1("OPimAlarm") ) {
+ }
+ else if ( noti.type() == QString::fromLatin1( "OPimAlarm" ) )
+ {
const OPimAlarm& al = static_cast<const OPimAlarm&>(noti);
@@ -51,7 +63,13 @@ void OPimNotifyManager::add( const OPimNotify& noti) {
}
-void OPimNotifyManager::remove( const OPimNotify& noti) {
- if ( noti.type() == QString::fromLatin1("OPimReminder") ) {
+
+
+void OPimNotifyManager::remove( const OPimNotify& noti )
+{
+ if ( noti.type() == QString::fromLatin1( "OPimReminder" ) )
+ {
const OPimReminder& rem = static_cast<const OPimReminder&>(noti);
m_rem.remove( rem );
- }else if ( noti.type() == QString::fromLatin1("OPimAlarm") ) {
+ }
+ else if ( noti.type() == QString::fromLatin1( "OPimAlarm" ) )
+ {
const OPimAlarm& al = static_cast<const OPimAlarm&>(noti);
@@ -60,4 +78,8 @@ void OPimNotifyManager::remove( const OPimNotify& noti) {
}
-void OPimNotifyManager::replace( const OPimNotify& noti) {
- if ( noti.type() == QString::fromLatin1("OPimReminder") ) {
+
+
+void OPimNotifyManager::replace( const OPimNotify& noti )
+{
+ if ( noti.type() == QString::fromLatin1( "OPimReminder" ) )
+ {
const OPimReminder& rem = static_cast<const OPimReminder&>(noti);
@@ -65,3 +87,5 @@ void OPimNotifyManager::replace( const OPimNotify& noti) {
m_rem.append( rem );
- }else if ( noti.type() == QString::fromLatin1("OPimAlarm") ) {
+ }
+ else if ( noti.type() == QString::fromLatin1( "OPimAlarm" ) )
+ {
const OPimAlarm& al = static_cast<const OPimAlarm&>(noti);
@@ -71,9 +95,18 @@ void OPimNotifyManager::replace( const OPimNotify& noti) {
}
-OPimNotifyManager::Reminders OPimNotifyManager::reminders()const {
+
+
+OPimNotifyManager::Reminders OPimNotifyManager::reminders() const
+{
return m_rem;
}
-OPimNotifyManager::Alarms OPimNotifyManager::alarms()const {
+
+
+OPimNotifyManager::Alarms OPimNotifyManager::alarms() const
+{
return m_al;
}
-OPimAlarm OPimNotifyManager::alarmAtDateTime( const QDateTime& when, bool& found ) const {
+
+
+OPimAlarm OPimNotifyManager::alarmAtDateTime( const QDateTime& when, bool& found ) const
+{
Alarms::ConstIterator it;
@@ -81,3 +114,4 @@ OPimAlarm OPimNotifyManager::alarmAtDateTime( const QDateTime& when, bool& found
- for ( it = m_al.begin(); it != m_al.end(); ++it ){
+ for ( it = m_al.begin(); it != m_al.end(); ++it )
+ {
if ( (*it).dateTime() == when )
@@ -93,8 +127,14 @@ OPimAlarm OPimNotifyManager::alarmAtDateTime( const QDateTime& when, bool& found
-void OPimNotifyManager::setAlarms( const Alarms& al) {
+void OPimNotifyManager::setAlarms( const Alarms& al )
+{
m_al = al;
}
-void OPimNotifyManager::setReminders( const Reminders& rem) {
+
+
+void OPimNotifyManager::setReminders( const Reminders& rem )
+{
m_rem = rem;
}
+
+
/* FIXME!!! */
@@ -107,5 +147,7 @@ void OPimNotifyManager::setReminders( const Reminders& rem) {
*/
-void OPimNotifyManager::registerNotify( const OPimNotify& ) {
-
+void OPimNotifyManager::registerNotify( const OPimNotify& )
+{
}
+
+
/* FIXME!!! */
@@ -116,7 +158,9 @@ void OPimNotifyManager::registerNotify( const OPimNotify& ) {
*/
-void OPimNotifyManager::deregister( const OPimNotify& ) {
-
+void OPimNotifyManager::deregister( const OPimNotify& )
+{
}
-bool OPimNotifyManager::isEmpty()const {
+
+bool OPimNotifyManager::isEmpty() const
+{
qWarning("is Empty called on OPimNotifyManager %d %d", m_rem.count(), m_al.count() );
@@ -126,3 +170,4 @@ bool OPimNotifyManager::isEmpty()const {
-// Taken from otodoaccessxml..
+
+// Taken from otodoaccessxml.. code duplication bad. any alternative?
QString OPimNotifyManager::alarmsToString() const
@@ -132,8 +177,11 @@ QString OPimNotifyManager::alarmsToString() const
OPimNotifyManager::Alarms alarms = m_al;
- if ( !alarms.isEmpty() ) {
+ if ( !alarms.isEmpty() )
+ {
QStringList als;
OPimNotifyManager::Alarms::Iterator it = alarms.begin();
- for ( ; it != alarms.end(); ++it ) {
+ for ( ; it != alarms.end(); ++it )
+ {
/* only if time is valid */
- if ( (*it).dateTime().isValid() ) {
+ if ( ( *it ).dateTime().isValid() )
+ {
als << OConversion::dateTimeToString( (*it).dateTime() )
@@ -151,2 +199,4 @@ QString OPimNotifyManager::alarmsToString() const
}
+
+
QString OPimNotifyManager::remindersToString() const
@@ -156,6 +206,8 @@ QString OPimNotifyManager::remindersToString() const
OPimNotifyManager::Reminders reminders = m_rem;
- if (!reminders.isEmpty() ) {
+ if ( !reminders.isEmpty() )
+ {
OPimNotifyManager::Reminders::Iterator it = reminders.begin();
QStringList records;
- for ( ; it != reminders.end(); ++it ) {
+ for ( ; it != reminders.end(); ++it )
+ {
records << QString::number( (*it).recordUid() );
@@ -168,2 +220,3 @@ QString OPimNotifyManager::remindersToString() const
+
void OPimNotifyManager::alarmsFromString( const QString& str )
@@ -171,3 +224,4 @@ void OPimNotifyManager::alarmsFromString( const QString& str )
QStringList als = QStringList::split(";", str );
- for (QStringList::Iterator it = als.begin(); it != als.end(); ++it ) {
+ for ( QStringList::Iterator it = als.begin(); it != als.end(); ++it )
+ {
QStringList alarm = QStringList::split(":", (*it), TRUE ); // allow empty
@@ -182,2 +236,3 @@ void OPimNotifyManager::alarmsFromString( const QString& str )
+
void OPimNotifyManager::remindersFromString( const QString& str )
@@ -186,3 +241,4 @@ void OPimNotifyManager::remindersFromString( const QString& str )
QStringList rems = QStringList::split(";", str );
- for (QStringList::Iterator it = rems.begin(); it != rems.end(); ++it ) {
+ for ( QStringList::Iterator it = rems.begin(); it != rems.end(); ++it )
+ {
OPimReminder rem( (*it).toInt() );
diff --git a/libopie2/opiepim/core/opimnotifymanager.h b/libopie2/opiepim/core/opimnotifymanager.h
index 0272e5d..9241ea2 100644
--- a/libopie2/opiepim/core/opimnotifymanager.h
+++ b/libopie2/opiepim/core/opimnotifymanager.h
@@ -28,10 +28,13 @@
*/
-#ifndef OPIE_PIM_NOTIFY_MANAGER_H
-#define OPIE_PIM_NOTIFY_MANAGER_H
-
-#include <qvaluelist.h>
+#ifndef OPIMNOTIFYMANAGER_H
+#define OPIMNOTIFYMANAGER_H
+/* OPIE */
#include <opie2/opimnotify.h>
-namespace Opie {
+/* QT */
+#include <qvaluelist.h>
+
+namespace Opie
+{
/**
@@ -39,3 +42,4 @@ namespace Opie {
*/
-class OPimNotifyManager {
+class OPimNotifyManager
+{
public:
@@ -108,4 +112,2 @@ public:
-
-
private:
diff --git a/libopie2/opiepim/core/opimrecord.cpp b/libopie2/opiepim/core/opimrecord.cpp
index 72bb372..c603f44 100644
--- a/libopie2/opiepim/core/opimrecord.cpp
+++ b/libopie2/opiepim/core/opimrecord.cpp
@@ -28,4 +28,6 @@
*/
-#include <qarray.h>
+#include "opimrecord.h"
+
+/* OPIE */
#include <qpe/categories.h>
@@ -33,5 +35,7 @@
-#include <opie2/opimrecord.h>
+/* QT */
+#include <qarray.h>
-namespace Opie {
+namespace Opie
+{
Qtopia::UidGen OPimRecord::m_uidGen( Qtopia::UidGen::Qtopia );
@@ -40,3 +44,4 @@ Qtopia::UidGen OPimRecord::m_uidGen( Qtopia::UidGen::Qtopia );
OPimRecord::OPimRecord( int uid )
- : Qtopia::Record() {
+ : Qtopia::Record()
+{
@@ -45,4 +50,8 @@ OPimRecord::OPimRecord( int uid )
}
-OPimRecord::~OPimRecord() {
-}
+
+
+OPimRecord::~OPimRecord()
+{}
+
+
OPimRecord::OPimRecord( const OPimRecord& rec )
@@ -53,3 +62,5 @@ OPimRecord::OPimRecord( const OPimRecord& rec )
-OPimRecord &OPimRecord::operator=( const OPimRecord& rec) {
+
+OPimRecord &OPimRecord::operator=( const OPimRecord& rec )
+{
if ( this == &rec ) return *this;
@@ -62,2 +73,4 @@ OPimRecord &OPimRecord::operator=( const OPimRecord& rec) {
}
+
+
/*
@@ -65,3 +78,4 @@ OPimRecord &OPimRecord::operator=( const OPimRecord& rec) {
*/
-QStringList OPimRecord::categoryNames( const QString& appname ) const {
+QStringList OPimRecord::categoryNames( const QString& appname ) const
+{
QStringList list;
@@ -71,3 +85,4 @@ QStringList OPimRecord::categoryNames( const QString& appname ) const {
- for (uint i = 0; i < cats.count(); i++ ) {
+ for ( uint i = 0; i < cats.count(); i++ )
+ {
list << catDB.label( appname, cats[i] );
@@ -77,6 +92,11 @@ QStringList OPimRecord::categoryNames( const QString& appname ) const {
}
-void OPimRecord::setCategoryNames( const QStringList& ) {
+
+void OPimRecord::setCategoryNames( const QStringList& )
+{
}
-void OPimRecord::addCategoryName( const QString& ) {
+
+
+void OPimRecord::addCategoryName( const QString& )
+{
Categories catDB;
@@ -86,5 +106,10 @@ void OPimRecord::addCategoryName( const QString& ) {
}
-bool OPimRecord::isEmpty()const {
+
+
+bool OPimRecord::isEmpty() const
+{
return ( uid() == 0 );
}
+
+
/*QString OPimRecord::crossToString()const {
@@ -104,3 +129,4 @@ bool OPimRecord::isEmpty()const {
/* if uid = 1 assign a new one */
-void OPimRecord::setUid( int uid ) {
+void OPimRecord::setUid( int uid )
+{
if ( uid == 1)
@@ -110,9 +136,18 @@ void OPimRecord::setUid( int uid ) {
};
-Qtopia::UidGen &OPimRecord::uidGen() {
+
+
+Qtopia::UidGen &OPimRecord::uidGen()
+{
return m_uidGen;
}
-OPimXRefManager &OPimRecord::xrefmanager() {
+
+
+OPimXRefManager &OPimRecord::xrefmanager()
+{
return m_xrefman;
}
-int OPimRecord::rtti(){
+
+
+int OPimRecord::rtti()
+{
return 0;
@@ -128,3 +163,4 @@ int OPimRecord::rtti(){
*/
-bool OPimRecord::loadFromStream( QDataStream& stream ) {
+bool OPimRecord::loadFromStream( QDataStream& stream )
+{
int Int;
@@ -137,3 +173,4 @@ bool OPimRecord::loadFromStream( QDataStream& stream ) {
QArray<int> array(UInt);
- for (uint i = 0; i < UInt; i++ ) {
+ for ( uint i = 0; i < UInt; i++ )
+ {
stream >> array[i];
@@ -147,3 +184,4 @@ bool OPimRecord::loadFromStream( QDataStream& stream ) {
stream >> UInt;
- for ( uint i = 0; i < UInt; i++ ) {
+ for ( uint i = 0; i < UInt; i++ )
+ {
xref.setPartner( OPimXRef::One, partner( stream ) );
@@ -155,3 +193,6 @@ bool OPimRecord::loadFromStream( QDataStream& stream ) {
}
-bool OPimRecord::saveToStream( QDataStream& stream )const {
+
+
+bool OPimRecord::saveToStream( QDataStream& stream ) const
+{
/** UIDs */
@@ -162,3 +203,4 @@ bool OPimRecord::saveToStream( QDataStream& stream )const {
stream << categories().count();
- for ( uint i = 0; i < categories().count(); i++ ) {
+ for ( uint i = 0; i < categories().count(); i++ )
+ {
stream << categories()[i];
@@ -172,3 +214,4 @@ bool OPimRecord::saveToStream( QDataStream& stream )const {
for ( OPimXRef::ValueList::ConstIterator it = m_xrefman.list().begin();
- it != m_xrefman.list().end(); ++it ) {
+ it != m_xrefman.list().end(); ++it )
+ {
flush( (*it).partner( OPimXRef::One), stream );
@@ -178,3 +221,6 @@ bool OPimRecord::saveToStream( QDataStream& stream )const {
}
-void OPimRecord::flush( const OPimXRefPartner& par, QDataStream& str ) const{
+
+
+void OPimRecord::flush( const OPimXRefPartner& par, QDataStream& str ) const
+{
str << par.service();
@@ -183,3 +229,6 @@ void OPimRecord::flush( const OPimXRefPartner& par, QDataStream& str ) const{
}
-OPimXRefPartner OPimRecord::partner( QDataStream& stream ) {
+
+
+OPimXRefPartner OPimRecord::partner( QDataStream& stream )
+{
OPimXRefPartner par;
@@ -199,12 +248,24 @@ OPimXRefPartner OPimRecord::partner( QDataStream& stream ) {
}
-void OPimRecord::setLastHitField( int lastHit )const {
+
+
+void OPimRecord::setLastHitField( int lastHit ) const
+{
m_lastHit = lastHit;
}
-int OPimRecord::lastHitField()const{
+
+
+int OPimRecord::lastHitField() const
+{
return m_lastHit;
}
-QMap<QString, QString> OPimRecord::toExtraMap()const {
+
+
+QMap<QString, QString> OPimRecord::toExtraMap() const
+{
return customMap;
}
-void OPimRecord::setExtraMap( const QMap<QString, QString>& map) {
+
+
+void OPimRecord::setExtraMap( const QMap<QString, QString>& map )
+{
customMap = map;
diff --git a/libopie2/opiepim/core/opimrecord.h b/libopie2/opiepim/core/opimrecord.h
index 63a3a98..4981a41 100644
--- a/libopie2/opiepim/core/opimrecord.h
+++ b/libopie2/opiepim/core/opimrecord.h
@@ -28,10 +28,8 @@
*/
-#ifndef OPIE_PIM_RECORD_H
-#define OPIE_PIM_RECORD_H
-#include <qdatastream.h>
-#include <qmap.h>
-#include <qstring.h>
-#include <qstringlist.h>
+#ifndef OPIMRECORD_H
+#define OPIMRECORD_H
+/* OPIE */
+#include <opie2/opimxrefmanager.h>
/*
@@ -43,5 +41,10 @@
-#include <opie2/opimxrefmanager.h>
+/* QT */
+#include <qdatastream.h>
+#include <qmap.h>
+#include <qstring.h>
+#include <qstringlist.h>
-namespace Opie {
+namespace Opie
+{
/**
@@ -51,3 +54,4 @@ namespace Opie {
*/
-class OPimRecord : public Qtopia::Record {
+class OPimRecord : public Qtopia::Record
+{
public:
@@ -112,4 +116,6 @@ public:
virtual bool match( const QString &regexp ) const
- {setLastHitField( -1 );
- return Qtopia::Record::match(QRegExp(regexp));};
+ {
+ setLastHitField( -1 );
+ return Qtopia::Record::match( QRegExp( regexp ) );
+ };
diff --git a/libopie2/opiepim/ocontact.cpp b/libopie2/opiepim/ocontact.cpp
index f1a22a7..fa5313f 100644
--- a/libopie2/opiepim/ocontact.cpp
+++ b/libopie2/opiepim/ocontact.cpp
@@ -2,3 +2,3 @@
This file is part of the Opie Project
- Copyright (C) The Main Author <main-author@whereever.org>
+ Copyright (C) Stefan Eilers <eilers.stefan@epost.de>
=. Copyright (C) The Opie Team <opie-devel@handhelds.org>
@@ -29,27 +29,9 @@
-/**********************************************************************
-** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
-** Copyright (C) 2002-2003 by Stefan Eilers (eilers.stefan@epost.de)
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
#define QTOPIA_INTERNAL_CONTACT_MRE
-#include <opie2/ocontact.h>
+#include "ocontact.h"
+
+/* OPIE */
#include <opie2/opimresolver.h>
#include <opie2/oconversion.h>
-
#include <qpe/stringutil.h>
@@ -58,2 +40,3 @@
+/* QT */
#include <qobject.h>
@@ -64,2 +47,3 @@
+/* STD */
#include <stdio.h>
@@ -78,3 +62,4 @@
-namespace Opie {
+namespace Opie
+{
/*!
@@ -82,6 +67,4 @@ namespace Opie {
*/
-OContact::OContact()
- : OPimRecord(), mMap(), d( 0 )
-{
-}
+OContact::OContact():OPimRecord(), mMap(), d( 0 )
+{}
@@ -92,4 +75,3 @@ OContact::OContact()
*/
-OContact::OContact( const QMap<int, QString> &fromMap ) :
- OPimRecord(), mMap( fromMap ), d( 0 )
+OContact::OContact( const QMap<int, QString> &fromMap ):OPimRecord(), mMap( fromMap ), d( 0 )
{
@@ -101,6 +83,8 @@ OContact::OContact( const QMap<int, QString> &fromMap ) :
- if ( uidStr.isEmpty() || (uidStr.toInt() == 0) ){
+ if ( uidStr.isEmpty() || ( uidStr.toInt() == 0 ) )
+ {
qWarning( "Invalid UID found. Generate new one.." );
setUid( uidGen().generate() );
- }else
+ }
+ else
setUid( uidStr.toInt() );
@@ -115,4 +99,3 @@ OContact::OContact( const QMap<int, QString> &fromMap ) :
OContact::~OContact()
-{
-}
+{}
@@ -483,3 +466,4 @@ QString OContact::toRichText() const
comp = company();
- if ( !(value = department()).isEmpty() ) {
+ if ( !( value = department() ).isEmpty() )
+ {
text += Qtopia::escapeString(value);
@@ -487,3 +471,4 @@ QString OContact::toRichText() const
text += ", " + Qtopia::escapeString(comp);
- }else if ( comp )
+ }
+ else if ( comp )
text += "<br>" + Qtopia::escapeString(comp);
@@ -493,3 +478,4 @@ QString OContact::toRichText() const
QString defEmail = defaultEmail();
- if ( !defEmail.isEmpty() ){
+ if ( !defEmail.isEmpty() )
+ {
text += "<b><img src=\"addressbook/email\"> " + QObject::tr("Default Email: ") + "</b>"
@@ -501,3 +487,4 @@ QString OContact::toRichText() const
if ( !businessStreet().isEmpty() || !businessCity().isEmpty() ||
- !businessZip().isEmpty() || !businessCountry().isEmpty() ) {
+ !businessZip().isEmpty() || !businessCountry().isEmpty() )
+ {
text += QObject::tr( "<br><b>Work Address:</b>" );
@@ -506,3 +493,4 @@ QString OContact::toRichText() const
- if ( !(value = businessStreet()).isEmpty() ){
+ if ( !( value = businessStreet() ).isEmpty() )
+ {
text += "<br>" + Qtopia::escapeString(value);
@@ -511,6 +499,9 @@ QString OContact::toRichText() const
- switch( addressformat ){
- case Zip_City_State:{ // Zip_Code City, State
+ switch ( addressformat )
+ {
+ case Zip_City_State:
+ { // Zip_Code City, State
state = businessState();
- if ( !(value = businessZip()).isEmpty() ){
+ if ( !( value = businessZip() ).isEmpty() )
+ {
text += "<br>" + Qtopia::escapeString(value) + " ";
@@ -519,3 +510,4 @@ QString OContact::toRichText() const
}
- if ( !(value = businessCity()).isEmpty() ) {
+ if ( !( value = businessCity() ).isEmpty() )
+ {
marker = true;
@@ -526,3 +518,5 @@ QString OContact::toRichText() const
text += ", " + Qtopia::escapeString(state);
- } else if ( !state.isEmpty() ){
+ }
+ else if ( !state.isEmpty() )
+ {
text += "<br>" + Qtopia::escapeString(state);
@@ -532,5 +526,7 @@ QString OContact::toRichText() const
}
- case City_State_Zip:{ // City, State Zip_Code
+ case City_State_Zip:
+ { // City, State Zip_Code
state = businessState();
- if ( !(value = businessCity()).isEmpty() ) {
+ if ( !( value = businessCity() ).isEmpty() )
+ {
marker = true;
@@ -539,3 +535,5 @@ QString OContact::toRichText() const
text += ", " + Qtopia::escapeString(state);
- } else if ( !state.isEmpty() ){
+ }
+ else if ( !state.isEmpty() )
+ {
text += "<br>" + Qtopia::escapeString(state);
@@ -543,3 +541,4 @@ QString OContact::toRichText() const
}
- if ( !(value = businessZip()).isEmpty() ){
+ if ( !( value = businessZip() ).isEmpty() )
+ {
text += " " + Qtopia::escapeString(value);
@@ -551,3 +550,4 @@ QString OContact::toRichText() const
- if ( !(value = businessCountry()).isEmpty() ){
+ if ( !( value = businessCountry() ).isEmpty() )
+ {
text += "<br>" + Qtopia::escapeString(value);
@@ -558,3 +558,4 @@ QString OContact::toRichText() const
str = office();
- if ( !str.isEmpty() ){
+ if ( !str.isEmpty() )
+ {
text += "<br><b>" + QObject::tr("Office: ") + "</b>"
@@ -564,3 +565,4 @@ QString OContact::toRichText() const
str = businessWebpage();
- if ( !str.isEmpty() ){
+ if ( !str.isEmpty() )
+ {
text += "<br><b><img src=\"addressbook/webpagework\"> " + QObject::tr("Business Web Page: ") + "</b>"
@@ -570,3 +572,4 @@ QString OContact::toRichText() const
str = businessPhone();
- if ( !str.isEmpty() ){
+ if ( !str.isEmpty() )
+ {
text += "<br><b><img src=\"addressbook/phonework\"> " + QObject::tr("Business Phone: ") + "</b>"
@@ -576,3 +579,4 @@ QString OContact::toRichText() const
str = businessFax();
- if ( !str.isEmpty() ){
+ if ( !str.isEmpty() )
+ {
text += "<br><b><img src=\"addressbook/faxwork\"> " + QObject::tr("Business Fax: ") + "</b>"
@@ -582,3 +586,4 @@ QString OContact::toRichText() const
str = businessMobile();
- if ( !str.isEmpty() ){
+ if ( !str.isEmpty() )
+ {
text += "<br><b><img src=\"addressbook/mobilework\"> " + QObject::tr("Business Mobile: ") + "</b>"
@@ -588,3 +593,4 @@ QString OContact::toRichText() const
str = businessPager();
- if ( !str.isEmpty() ){
+ if ( !str.isEmpty() )
+ {
text += "<br><b>" + QObject::tr("Business Pager: ") + "</b>"
@@ -598,3 +604,4 @@ QString OContact::toRichText() const
if ( !homeStreet().isEmpty() || !homeCity().isEmpty() ||
- !homeZip().isEmpty() || !homeCountry().isEmpty() ) {
+ !homeZip().isEmpty() || !homeCountry().isEmpty() )
+ {
text += QObject::tr( "<br><b>Home Address:</b>" );
@@ -603,3 +610,4 @@ QString OContact::toRichText() const
- if ( !(value = homeStreet()).isEmpty() ){
+ if ( !( value = homeStreet() ).isEmpty() )
+ {
text += "<br>" + Qtopia::escapeString(value);
@@ -608,6 +616,9 @@ QString OContact::toRichText() const
- switch( addressformat ){
- case Zip_City_State:{ // Zip_Code City, State
+ switch ( addressformat )
+ {
+ case Zip_City_State:
+ { // Zip_Code City, State
state = homeState();
- if ( !(value = homeZip()).isEmpty() ){
+ if ( !( value = homeZip() ).isEmpty() )
+ {
text += "<br>" + Qtopia::escapeString(value) + " ";
@@ -615,3 +626,4 @@ QString OContact::toRichText() const
}
- if ( !(value = homeCity()).isEmpty() ) {
+ if ( !( value = homeCity() ).isEmpty() )
+ {
marker = true;
@@ -622,3 +634,5 @@ QString OContact::toRichText() const
text += ", " + Qtopia::escapeString(state);
- } else if (!state.isEmpty()) {
+ }
+ else if ( !state.isEmpty() )
+ {
text += "<br>" + Qtopia::escapeString(state);
@@ -628,5 +642,7 @@ QString OContact::toRichText() const
}
- case City_State_Zip:{ // City, State Zip_Code
+ case City_State_Zip:
+ { // City, State Zip_Code
state = homeState();
- if ( !(value = homeCity()).isEmpty() ) {
+ if ( !( value = homeCity() ).isEmpty() )
+ {
marker = true;
@@ -635,3 +651,5 @@ QString OContact::toRichText() const
text += ", " + Qtopia::escapeString(state);
- } else if ( !state.isEmpty() ){
+ }
+ else if ( !state.isEmpty() )
+ {
text += "<br>" + Qtopia::escapeString(state);
@@ -639,3 +657,4 @@ QString OContact::toRichText() const
}
- if ( !(value = homeZip()).isEmpty() ){
+ if ( !( value = homeZip() ).isEmpty() )
+ {
text += " " + Qtopia::escapeString(value);
@@ -647,3 +666,4 @@ QString OContact::toRichText() const
- if ( !(value = homeCountry()).isEmpty() ){
+ if ( !( value = homeCountry() ).isEmpty() )
+ {
text += "<br>" + Qtopia::escapeString(value);
@@ -654,3 +674,4 @@ QString OContact::toRichText() const
str = homeWebpage();
- if ( !str.isEmpty() ){
+ if ( !str.isEmpty() )
+ {
text += "<br><b><img src=\"addressbook/webpagehome\"> " + QObject::tr("Home Web Page: ") + "</b>"
@@ -660,3 +681,4 @@ QString OContact::toRichText() const
str = homePhone();
- if ( !str.isEmpty() ){
+ if ( !str.isEmpty() )
+ {
text += "<br><b><img src=\"addressbook/phonehome\"> " + QObject::tr("Home Phone: ") + "</b>"
@@ -666,3 +688,4 @@ QString OContact::toRichText() const
str = homeFax();
- if ( !str.isEmpty() ){
+ if ( !str.isEmpty() )
+ {
text += "<br><b><img src=\"addressbook/faxhome\"> " + QObject::tr("Home Fax: ") + "</b>"
@@ -672,3 +695,4 @@ QString OContact::toRichText() const
str = homeMobile();
- if ( !str.isEmpty() ){
+ if ( !str.isEmpty() )
+ {
text += "<br><b><img src=\"addressbook/mobilehome\"> " + QObject::tr("Home Mobile: ") + "</b>"
@@ -699,3 +723,4 @@ QString OContact::toRichText() const
str = gender();
- if ( !str.isEmpty() && str.toInt() != 0 ) {
+ if ( !str.isEmpty() && str.toInt() != 0 )
+ {
text += "<br>";
@@ -711,3 +736,4 @@ QString OContact::toRichText() const
+ Qtopia::escapeString(str);
- if ( birthday().isValid() ){
+ if ( birthday().isValid() )
+ {
str = TimeString::numberDateString( birthday() );
@@ -716,3 +742,4 @@ QString OContact::toRichText() const
}
- if ( anniversary().isValid() ){
+ if ( anniversary().isValid() )
+ {
str = TimeString::numberDateString( anniversary() );
@@ -732,3 +759,4 @@ QString OContact::toRichText() const
// categories
- if ( categoryNames("Contacts").count() ){
+ if ( categoryNames( "Contacts" ).count() )
+ {
text += "<br><b>" + QObject::tr( "Category:") + "</b> ";
@@ -738,3 +766,4 @@ QString OContact::toRichText() const
// notes last
- if ( !(value = notes()).isEmpty() ) {
+ if ( !( value = notes() ).isEmpty() )
+ {
text += "<br><hr><b>" + QObject::tr( "Notes:") + "</b> ";
@@ -839,3 +868,4 @@ QString OContact::fullName() const
QString name = title;
- if ( !firstName.isEmpty() ) {
+ if ( !firstName.isEmpty() )
+ {
if ( !name.isEmpty() )
@@ -844,3 +874,4 @@ QString OContact::fullName() const
}
- if ( !middleName.isEmpty() ) {
+ if ( !middleName.isEmpty() )
+ {
if ( !name.isEmpty() )
@@ -849,3 +880,4 @@ QString OContact::fullName() const
}
- if ( !lastName.isEmpty() ) {
+ if ( !lastName.isEmpty() )
+ {
if ( !name.isEmpty() )
@@ -854,3 +886,4 @@ QString OContact::fullName() const
}
- if ( !suffix.isEmpty() ) {
+ if ( !suffix.isEmpty() )
+ {
if ( !name.isEmpty() )
@@ -902,3 +935,4 @@ QStringList OContact::emailList() const
QStringList r;
- if ( !emailStr.isEmpty() ) {
+ if ( !emailStr.isEmpty() )
+ {
qDebug(" emailstr ");
@@ -948,6 +982,8 @@ void OContact::save( QString &buf ) const
for ( QMap<int, QString>::ConstIterator it = mMap.begin();
- it != mMap.end(); ++it ) {
+ it != mMap.end(); ++it )
+ {
const QString &value = it.data();
int key = it.key();
- if ( !value.isEmpty() ) {
+ if ( !value.isEmpty() )
+ {
if ( key == Qtopia::AddressCategory || key == Qtopia::AddressUid)
@@ -1063,4 +1099,6 @@ bool OContact::match( const QRegExp &r ) const
QMap<int, QString>::ConstIterator it;
- for ( it = mMap.begin(); it != mMap.end(); ++it ) {
- if ( (*it).find( r ) > -1 ) {
+ for ( it = mMap.begin(); it != mMap.end(); ++it )
+ {
+ if ( ( *it ).find( r ) > -1 )
+ {
setLastHitField( it.key() );
@@ -1078,2 +1116,4 @@ QString OContact::toShortText() const
}
+
+
QString OContact::type() const
@@ -1084,3 +1124,2 @@ QString OContact::type() const
-
class QString OContact::recordField( int pos ) const
@@ -1101,3 +1140,4 @@ void OContact::setBirthday( const QDate &v )
{
- if ( v.isNull() ){
+ if ( v.isNull() )
+ {
qWarning( "Remove Birthday");
@@ -1119,3 +1159,4 @@ void OContact::setAnniversary( const QDate &v )
{
- if ( v.isNull() ){
+ if ( v.isNull() )
+ {
qWarning( "Remove Anniversary");
@@ -1129,2 +1170,3 @@ void OContact::setAnniversary( const QDate &v )
+
/*! \fn QDate OContact::birthday() const
@@ -1165,3 +1207,4 @@ void OContact::insertEmail( const QString &v )
// if no default, set it as the default email and don't insert
- if ( def.isEmpty() ) {
+ if ( def.isEmpty() )
+ {
setDefaultEmail( e ); // will insert into the list for us
@@ -1180,2 +1223,3 @@ void OContact::insertEmail( const QString &v )
+
void OContact::removeEmail( const QString &v )
@@ -1199,3 +1243,4 @@ void OContact::removeEmail( const QString &v )
// if default, then replace the default email with the first one
- if ( def == e ) {
+ if ( def == e )
+ {
//qDebug("removeEmail is default; setting new default");
@@ -1207,2 +1252,4 @@ void OContact::removeEmail( const QString &v )
}
+
+
void OContact::clearEmails()
@@ -1212,2 +1259,4 @@ void OContact::clearEmails()
}
+
+
void OContact::setDefaultEmail( const QString &v )
@@ -1224,2 +1273,3 @@ void OContact::setDefaultEmail( const QString &v )
+
void OContact::insertEmails( const QStringList &v )
@@ -1229,5 +1279,10 @@ void OContact::insertEmails( const QStringList &v )
}
-int OContact::rtti() {
+
+
+int OContact::rtti()
+{
return OPimResolver::AddressBook;
}
+
+
void OContact::setUid( int i )
diff --git a/libopie2/opiepim/ocontact.h b/libopie2/opiepim/ocontact.h
index 34888dc..445fd7d 100644
--- a/libopie2/opiepim/ocontact.h
+++ b/libopie2/opiepim/ocontact.h
@@ -28,5 +28,7 @@
*/
-#ifndef __OCONTACT_H__
-#define __OCONTACT_H__
+#ifndef OCONTACT_H
+#define OCONTACT_H
+
+/* OPIE */
#include <opie2/opimrecord.h>
@@ -34,2 +36,3 @@
+/* QT */
#include <qdatetime.h>
@@ -43,3 +46,4 @@ QPC_TEMPLATEEXTERN template class QPC_EXPORT QMap<int, QString>;
-namespace Opie {
+namespace Opie
+{
class OContactPrivate;
@@ -56,2 +60,3 @@ class QPC_EXPORT OContact : public OPimRecord
friend class DataSet;
+
public:
diff --git a/libopie2/opiepim/ocontactfields.cpp b/libopie2/opiepim/ocontactfields.cpp
index deaa1e5..bec00f7 100644
--- a/libopie2/opiepim/ocontactfields.cpp
+++ b/libopie2/opiepim/ocontactfields.cpp
@@ -2,3 +2,3 @@
This file is part of the Opie Project
- Copyright (C) The Main Author <main-author@whereever.org>
+ Copyright (C) Stefan Eilers <eilers.stefan@epost.de>
=. Copyright (C) The Opie Team <opie-devel@handhelds.org>
@@ -29,13 +29,16 @@
-#include <opie2/ocontactfields.h>
+#include "ocontactfields.h"
-#include <qstringlist.h>
+/* OPIE */
+#include <opie2/ocontact.h>
+#include <qpe/recordfields.h> // We should use our own enum in the future ..
+#include <qpe/config.h>
+
+/* QT */
#include <qobject.h>
+#include <qstringlist.h>
-// We should use our own enum in the future ..
-#include <qpe/recordfields.h>
-#include <qpe/config.h>
-#include <opie2/ocontact.h>
-namespace Opie {
+namespace Opie
+{
/*!
@@ -425,3 +428,4 @@ OContactFields::OContactFields():
-OContactFields::~OContactFields(){
+OContactFields::~OContactFields()
+{
@@ -429,3 +433,4 @@ OContactFields::~OContactFields(){
// to reuse it for the future..
- if ( changedFieldOrder ){
+ if ( changedFieldOrder )
+ {
Config cfg ( "AddressBook" );
@@ -438,3 +443,4 @@ OContactFields::~OContactFields(){
-void OContactFields::saveToRecord( OContact &cnt ){
+void OContactFields::saveToRecord( OContact &cnt )
+{
@@ -450,3 +456,4 @@ void OContactFields::saveToRecord( OContact &cnt ){
-void OContactFields::loadFromRecord( const OContact &cnt ){
+void OContactFields::loadFromRecord( const OContact &cnt )
+{
qDebug("ocontactfields loadFromRecord");
@@ -461,3 +468,4 @@ void OContactFields::loadFromRecord( const OContact &cnt ){
- if (fieldOrder.isEmpty()){
+ if ( fieldOrder.isEmpty() )
+ {
fieldOrder = globalFieldOrder;
@@ -469,3 +477,4 @@ void OContactFields::loadFromRecord( const OContact &cnt ){
-void OContactFields::setFieldOrder( int num, int index ){
+void OContactFields::setFieldOrder( int num, int index )
+{
qDebug("qcontactfields setfieldorder pos %i -> %i",num,index);
@@ -482,3 +491,4 @@ void OContactFields::setFieldOrder( int num, int index ){
-int OContactFields::getFieldOrder( int num, int defIndex ){
+int OContactFields::getFieldOrder( int num, int defIndex )
+{
qDebug("ocontactfields getFieldOrder");
diff --git a/libopie2/opiepim/ocontactfields.h b/libopie2/opiepim/ocontactfields.h
index 993ce3b..9e89532 100644
--- a/libopie2/opiepim/ocontactfields.h
+++ b/libopie2/opiepim/ocontactfields.h
@@ -28,4 +28,5 @@
*/
-#ifndef OPIE_CONTACTS_FIELDS
-#define OPIE_CONTACTS_FIELDS
+
+#ifndef OCONTACTFIELDS_H
+#define OCONTACTFIELDS_H
@@ -33,5 +34,8 @@ class QStringList;
+/* OPIE */
+#include <opie2/ocontact.h>
+
+/* QT */
#include <qmap.h>
#include <qstring.h>
-#include <opie2/ocontact.h>
@@ -40,4 +44,6 @@ class QStringList;
-namespace Opie {
-class OContactFields{
+namespace Opie
+{
+class OContactFields
+{
diff --git a/libopie2/opiepim/oevent.cpp b/libopie2/opiepim/oevent.cpp
index de5e30b..d9cee2b 100644
--- a/libopie2/opiepim/oevent.cpp
+++ b/libopie2/opiepim/oevent.cpp
@@ -2,3 +2,3 @@
This file is part of the Opie Project
- Copyright (C) Stefan Eilers (Eilers.Stefan@epost.de)
+ Copyright (C) Stefan Eilers <Eilers.Stefan@epost.de>
=. Copyright (C) The Opie Team <opie-devel@handhelds.org>
@@ -28,9 +28,6 @@
*/
-#include <qshared.h>
-#include <qarray.h>
-#include <qpe/palmtopuidgen.h>
-#include <qpe/categories.h>
-#include <qpe/stringutil.h>
+#include "oevent.h"
+/* OPIE */
#include <opie2/orecur.h>
@@ -38,8 +35,15 @@
#include <opie2/opimnotifymanager.h>
+#include <qpe/categories.h>
+#include <qpe/palmtopuidgen.h>
+#include <qpe/stringutil.h>
-#include <opie2/oevent.h>
+/* QT */
+#include <qshared.h>
+#include <qarray.h>
-namespace Opie {
+namespace Opie
+{
-int OCalendarHelper::week( const QDate& date) {
+int OCalendarHelper::week( const QDate& date )
+{
// Calculates the week this date is in within that
@@ -55,3 +59,6 @@ int OCalendarHelper::week( const QDate& date) {
}
-int OCalendarHelper::ocurrence( const QDate& date) {
+
+
+int OCalendarHelper::ocurrence( const QDate& date )
+{
// calculates the number of occurrances of this day of the
@@ -60,6 +67,10 @@ int OCalendarHelper::ocurrence( const QDate& date) {
}
-int OCalendarHelper::dayOfWeek( char day ) {
+
+
+int OCalendarHelper::dayOfWeek( char day )
+{
int dayOfWeek = 1;
char i = ORecur::MON;
- while ( !( i & day ) && i <= ORecur::SUN ) {
+ while ( !( i & day ) && i <= ORecur::SUN )
+ {
i <<= 1;
@@ -69,3 +80,6 @@ int OCalendarHelper::dayOfWeek( char day ) {
}
-int OCalendarHelper::monthDiff( const QDate& first, const QDate& second ) {
+
+
+int OCalendarHelper::monthDiff( const QDate& first, const QDate& second )
+{
return ( second.year() - first.year() ) * 12 +
@@ -74,4 +88,7 @@ int OCalendarHelper::monthDiff( const QDate& first, const QDate& second ) {
-struct OEvent::Data : public QShared {
- Data() : QShared() {
+
+struct OEvent::Data : public QShared
+{
+ Data() : QShared()
+ {
child = 0;
@@ -82,3 +99,4 @@ struct OEvent::Data : public QShared {
}
- ~Data() {
+ ~Data()
+ {
delete manager;
@@ -100,6 +118,10 @@ struct OEvent::Data : public QShared {
+
OEvent::OEvent( int uid )
- : OPimRecord( uid ) {
+ : OPimRecord( uid )
+{
data = new Data;
}
+
+
OEvent::OEvent( const OEvent& ev)
@@ -110,2 +132,3 @@ OEvent::OEvent( const OEvent& ev)
+
OEvent::OEvent( const QMap<int, QString> map )
@@ -118,4 +141,7 @@ OEvent::OEvent( const QMap<int, QString> map )
-OEvent::~OEvent() {
- if ( data->deref() ) {
+
+OEvent::~OEvent()
+{
+ if ( data->deref() )
+ {
delete data;
@@ -124,3 +150,6 @@ OEvent::~OEvent() {
}
-OEvent& OEvent::operator=( const OEvent& ev) {
+
+
+OEvent& OEvent::operator=( const OEvent& ev )
+{
if ( this == &ev ) return *this;
@@ -135,6 +164,12 @@ OEvent& OEvent::operator=( const OEvent& ev) {
}
-QString OEvent::description()const {
+
+
+QString OEvent::description() const
+{
return data->description;
}
-void OEvent::setDescription( const QString& description ) {
+
+
+void OEvent::setDescription( const QString& description )
+{
changeOrModify();
@@ -142,3 +177,6 @@ void OEvent::setDescription( const QString& description ) {
}
-void OEvent::setLocation( const QString& loc ) {
+
+
+void OEvent::setLocation( const QString& loc )
+{
changeOrModify();
@@ -146,6 +184,12 @@ void OEvent::setLocation( const QString& loc ) {
}
-QString OEvent::location()const {
+
+
+QString OEvent::location() const
+{
return data->location;
}
-OPimNotifyManager &OEvent::notifiers()const {
+
+
+OPimNotifyManager &OEvent::notifiers() const
+{
// I hope we can skip the changeOrModify here
@@ -158,3 +202,6 @@ OPimNotifyManager &OEvent::notifiers()const {
}
-bool OEvent::hasNotifiers()const {
+
+
+bool OEvent::hasNotifiers() const
+{
if (!data->manager )
@@ -167,3 +214,6 @@ bool OEvent::hasNotifiers()const {
}
-ORecur OEvent::recurrence()const {
+
+
+ORecur OEvent::recurrence() const
+{
if (!data->recur)
@@ -173,3 +223,6 @@ ORecur OEvent::recurrence()const {
}
-void OEvent::setRecurrence( const ORecur& rec) {
+
+
+void OEvent::setRecurrence( const ORecur& rec )
+{
changeOrModify();
@@ -180,3 +233,6 @@ void OEvent::setRecurrence( const ORecur& rec) {
}
-bool OEvent::hasRecurrence()const {
+
+
+bool OEvent::hasRecurrence() const
+{
if (!data->recur ) return false;
@@ -184,6 +240,12 @@ bool OEvent::hasRecurrence()const {
}
-QString OEvent::note()const {
+
+
+QString OEvent::note() const
+{
return data->note;
}
-void OEvent::setNote( const QString& note ) {
+
+
+void OEvent::setNote( const QString& note )
+{
changeOrModify();
@@ -191,6 +253,12 @@ void OEvent::setNote( const QString& note ) {
}
-QDateTime OEvent::createdDateTime()const {
+
+
+QDateTime OEvent::createdDateTime() const
+{
return data->created;
}
-void OEvent::setCreatedDateTime( const QDateTime& time ) {
+
+
+void OEvent::setCreatedDateTime( const QDateTime& time )
+{
changeOrModify();
@@ -198,3 +266,6 @@ void OEvent::setCreatedDateTime( const QDateTime& time ) {
}
-QDateTime OEvent::startDateTime()const {
+
+
+QDateTime OEvent::startDateTime() const
+{
if ( data->isAllDay )
@@ -203,3 +274,6 @@ QDateTime OEvent::startDateTime()const {
}
-QDateTime OEvent::startDateTimeInZone()const {
+
+
+QDateTime OEvent::startDateTimeInZone() const
+{
/* if no timezone, or all day event or if the current and this timeZone match... */
@@ -210,3 +284,6 @@ QDateTime OEvent::startDateTimeInZone()const {
}
-void OEvent::setStartDateTime( const QDateTime& dt ) {
+
+
+void OEvent::setStartDateTime( const QDateTime& dt )
+{
changeOrModify();
@@ -214,3 +291,6 @@ void OEvent::setStartDateTime( const QDateTime& dt ) {
}
-QDateTime OEvent::endDateTime()const {
+
+
+QDateTime OEvent::endDateTime() const
+{
/*
@@ -223,3 +303,6 @@ QDateTime OEvent::endDateTime()const {
}
-QDateTime OEvent::endDateTimeInZone()const {
+
+
+QDateTime OEvent::endDateTimeInZone() const
+{
/* if no timezone, or all day event or if the current and this timeZone match... */
@@ -230,3 +313,6 @@ QDateTime OEvent::endDateTimeInZone()const {
}
-void OEvent::setEndDateTime( const QDateTime& dt ) {
+
+
+void OEvent::setEndDateTime( const QDateTime& dt )
+{
changeOrModify();
@@ -234,9 +320,18 @@ void OEvent::setEndDateTime( const QDateTime& dt ) {
}
-bool OEvent::isMultipleDay()const {
+
+
+bool OEvent::isMultipleDay() const
+{
return data->end.date().day() - data->start.date().day();
}
-bool OEvent::isAllDay()const {
+
+
+bool OEvent::isAllDay() const
+{
return data->isAllDay;
}
-void OEvent::setAllDay( bool allDay ) {
+
+
+void OEvent::setAllDay( bool allDay )
+{
changeOrModify();
@@ -245,3 +340,6 @@ void OEvent::setAllDay( bool allDay ) {
}
-void OEvent::setTimeZone( const QString& tz ) {
+
+
+void OEvent::setTimeZone( const QString& tz )
+{
changeOrModify();
@@ -249,3 +347,6 @@ void OEvent::setTimeZone( const QString& tz ) {
}
-QString OEvent::timeZone()const {
+
+
+QString OEvent::timeZone() const
+{
if (data->isAllDay ) return QString::fromLatin1("UTC");
@@ -253,4 +354,8 @@ QString OEvent::timeZone()const {
}
-bool OEvent::match( const QRegExp& re )const {
- if ( re.match( data->description ) != -1 ){
+
+
+bool OEvent::match( const QRegExp& re ) const
+{
+ if ( re.match( data->description ) != -1 )
+ {
setLastHitField( Qtopia::DatebookDescription );
@@ -258,3 +363,4 @@ bool OEvent::match( const QRegExp& re )const {
}
- if ( re.match( data->note ) != -1 ){
+ if ( re.match( data->note ) != -1 )
+ {
setLastHitField( Qtopia::Note );
@@ -262,3 +368,4 @@ bool OEvent::match( const QRegExp& re )const {
}
- if ( re.match( data->location ) != -1 ){
+ if ( re.match( data->location ) != -1 )
+ {
setLastHitField( Qtopia::Location );
@@ -266,3 +373,4 @@ bool OEvent::match( const QRegExp& re )const {
}
- if ( re.match( data->start.toString() ) != -1 ){
+ if ( re.match( data->start.toString() ) != -1 )
+ {
setLastHitField( Qtopia::StartDateTime );
@@ -270,3 +378,4 @@ bool OEvent::match( const QRegExp& re )const {
}
- if ( re.match( data->end.toString() ) != -1 ){
+ if ( re.match( data->end.toString() ) != -1 )
+ {
setLastHitField( Qtopia::EndDateTime );
@@ -276,3 +385,6 @@ bool OEvent::match( const QRegExp& re )const {
}
-QString OEvent::toRichText()const {
+
+
+QString OEvent::toRichText() const
+{
QString text, value;
@@ -281,3 +393,4 @@ QString OEvent::toRichText()const {
text += "<b><h3><img src=\"datebook/DateBook\">";
- if ( !description().isEmpty() ) {
+ if ( !description().isEmpty() )
+ {
text += Qtopia::escapeString(description() ).replace(QRegExp( "[\n]"), "" );
@@ -287,3 +400,4 @@ QString OEvent::toRichText()const {
// location
- if ( !(value = location()).isEmpty() ) {
+ if ( !( value = location() ).isEmpty() )
+ {
text += "<b>" + QObject::tr( "Location:" ) + "</b> ";
@@ -293,3 +407,4 @@ QString OEvent::toRichText()const {
// all day event
- if ( isAllDay() ) {
+ if ( isAllDay() )
+ {
text += "<b><i>" + QObject::tr( "This is an all day event" ) + "</i></b><br>";
@@ -297,3 +412,4 @@ QString OEvent::toRichText()const {
// multiple day event
- else if ( isMultipleDay () ) {
+ else if ( isMultipleDay () )
+ {
text += "<b><i>" + QObject::tr( "This is a multiple day event" ) + "</i></b><br>";
@@ -301,5 +417,7 @@ QString OEvent::toRichText()const {
// start & end times
- else {
+ else
+ {
// start time
- if ( startDateTime().isValid() ) {
+ if ( startDateTime().isValid() )
+ {
text += "<b>" + QObject::tr( "Start:") + "</b> ";
@@ -310,3 +428,4 @@ QString OEvent::toRichText()const {
// end time
- if ( endDateTime().isValid() ) {
+ if ( endDateTime().isValid() )
+ {
text += "<b>" + QObject::tr( "End:") + "</b> ";
@@ -318,3 +437,4 @@ QString OEvent::toRichText()const {
// categories
- if ( categoryNames("Calendar").count() ){
+ if ( categoryNames( "Calendar" ).count() )
+ {
text += "<b>" + QObject::tr( "Category:") + "</b> ";
@@ -325,3 +445,4 @@ QString OEvent::toRichText()const {
//notes
- if ( !note().isEmpty() ) {
+ if ( !note().isEmpty() )
+ {
text += "<b>" + QObject::tr( "Note:") + "</b><br>";
@@ -333,3 +454,6 @@ QString OEvent::toRichText()const {
}
-QString OEvent::toShortText()const {
+
+
+QString OEvent::toShortText() const
+{
QString text;
@@ -348,19 +472,38 @@ QString OEvent::toShortText()const {
}
-QString OEvent::type()const {
+
+
+QString OEvent::type() const
+{
return QString::fromLatin1("OEvent");
}
-QString OEvent::recordField( int /*id */ )const {
+
+
+QString OEvent::recordField( int /*id */ ) const
+{
return QString::null;
}
-int OEvent::rtti() {
+
+
+int OEvent::rtti()
+{
return OPimResolver::DateBook;
}
-bool OEvent::loadFromStream( QDataStream& ) {
+
+
+bool OEvent::loadFromStream( QDataStream& )
+{
return true;
}
-bool OEvent::saveToStream( QDataStream& )const {
+
+
+bool OEvent::saveToStream( QDataStream& ) const
+{
return true;
}
-void OEvent::changeOrModify() {
- if ( data->count != 1 ) {
+
+
+void OEvent::changeOrModify()
+{
+ if ( data->count != 1 )
+ {
data->deref();
@@ -384,3 +527,4 @@ void OEvent::changeOrModify() {
- if ( data->child ) {
+ if ( data->child )
+ {
d2->child = new QArray<int>( *data->child );
@@ -392,4 +536,8 @@ void OEvent::changeOrModify() {
}
-void OEvent::deref() {
- if ( data->deref() ) {
+
+
+void OEvent::deref()
+{
+ if ( data->deref() )
+ {
delete data;
@@ -403,3 +551,4 @@ void OEvent::deref() {
// Encoding should happen at one place, only ! (eilers)
-QMap<int, QString> OEvent::toMap()const {
+QMap<int, QString> OEvent::toMap() const
+{
QMap<int, QString> retMap;
@@ -422,6 +571,8 @@ QMap<int, QString> OEvent::toMap()const {
retMap.insert( OEvent::FRecParent, QString::number( parent() ) );
- if( children().count() ){
+ if ( children().count() )
+ {
QArray<int> childr = children();
QString buf;
- for ( uint i = 0; i < childr.count(); i++ ) {
+ for ( uint i = 0; i < childr.count(); i++ )
+ {
if ( i != 0 ) buf += " ";
@@ -433,3 +584,4 @@ QMap<int, QString> OEvent::toMap()const {
// Add recurrence stuff
- if( hasRecurrence() ){
+ if ( hasRecurrence() )
+ {
ORecur recur = recurrence();
@@ -444,3 +596,5 @@ QMap<int, QString> OEvent::toMap()const {
retMap.insert( OEvent::FRExceptions, recFields[ORecur::Exceptions] );
- } else {
+ }
+ else
+ {
ORecur recur = recurrence();
@@ -453,2 +607,3 @@ QMap<int, QString> OEvent::toMap()const {
+
void OEvent::fromMap( const QMap<int, QString>& map )
@@ -474,3 +629,4 @@ void OEvent::fromMap( const QMap<int, QString>& map )
int sound = ( ( map[OEvent::FSound] == "loud" ) ? OPimAlarm::Loud : OPimAlarm::Silent );
- if ( ( alarmTime != -1 ) ){
+ if ( ( alarmTime != -1 ) )
+ {
QDateTime dt = startDateTime().addSecs( -1*alarmTime*60 );
@@ -479,3 +635,4 @@ void OEvent::fromMap( const QMap<int, QString>& map )
}
- if ( !map[OEvent::FTimeZone].isEmpty() && ( map[OEvent::FTimeZone] != "None" ) ){
+ if ( !map[ OEvent::FTimeZone ].isEmpty() && ( map[ OEvent::FTimeZone ] != "None" ) )
+ {
setTimeZone( map[OEvent::FTimeZone] );
@@ -487,3 +644,4 @@ void OEvent::fromMap( const QMap<int, QString>& map )
/* AllDay is always in UTC */
- if ( isAllDay() ) {
+ if ( isAllDay() )
+ {
OTimeZone utc = OTimeZone::utc();
@@ -492,3 +650,5 @@ void OEvent::fromMap( const QMap<int, QString>& map )
setTimeZone( "UTC"); // make sure it is really utc
- }else {
+ }
+ else
+ {
/* to current date time */
@@ -507,5 +667,7 @@ void OEvent::fromMap( const QMap<int, QString>& map )
- if ( !map[OEvent::FRecChildren].isEmpty() ){
+ if ( !map[ OEvent::FRecChildren ].isEmpty() )
+ {
QStringList list = QStringList::split(' ', map[OEvent::FRecChildren] );
- for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) {
+ for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it )
+ {
addChild( (*it).toInt() );
@@ -515,3 +677,4 @@ void OEvent::fromMap( const QMap<int, QString>& map )
// Fill recurrence stuff and put it directly into the ORecur-Object using fromMap..
- if( !map[OEvent::FRType].isEmpty() ){
+ if ( !map[ OEvent::FRType ].isEmpty() )
+ {
QMap<int, QString> recFields;
@@ -532,6 +695,10 @@ void OEvent::fromMap( const QMap<int, QString>& map )
-int OEvent::parent()const {
+int OEvent::parent() const
+{
return data->parent;
}
-void OEvent::setParent( int uid ) {
+
+
+void OEvent::setParent( int uid )
+{
changeOrModify();
@@ -539,3 +706,6 @@ void OEvent::setParent( int uid ) {
}
-QArray<int> OEvent::children() const{
+
+
+QArray<int> OEvent::children() const
+{
if (!data->child) return QArray<int>();
@@ -544,3 +714,6 @@ QArray<int> OEvent::children() const{
}
-void OEvent::setChildren( const QArray<int>& arr ) {
+
+
+void OEvent::setChildren( const QArray<int>& arr )
+{
changeOrModify();
@@ -551,8 +724,14 @@ void OEvent::setChildren( const QArray<int>& arr ) {
}
-void OEvent::addChild( int uid ) {
+
+
+void OEvent::addChild( int uid )
+{
changeOrModify();
- if (!data->child ) {
+ if ( !data->child )
+ {
data->child = new QArray<int>(1);
(*data->child)[0] = uid;
- }else{
+ }
+ else
+ {
int count = data->child->count();
@@ -562,3 +741,6 @@ void OEvent::addChild( int uid ) {
}
-void OEvent::removeChild( int uid ) {
+
+
+void OEvent::removeChild( int uid )
+{
if (!data->child || !data->child->contains( uid ) ) return;
@@ -568,4 +750,6 @@ void OEvent::removeChild( int uid ) {
uint count = data->child->count();
- for ( uint i = 0; i < count; i++ ) {
- if ( (*data->child)[i] != uid ) {
+ for ( uint i = 0; i < count; i++ )
+ {
+ if ( ( *data->child ) [ i ] != uid )
+ {
newAr[j] = (*data->child)[i];
@@ -576,5 +760,8 @@ void OEvent::removeChild( int uid ) {
}
-struct OEffectiveEvent::Data : public QShared {
- Data() : QShared() {
- }
+
+
+struct OEffectiveEvent::Data : public QShared
+{
+ Data() : QShared()
+ {}
OEvent event;
@@ -586,3 +773,5 @@ struct OEffectiveEvent::Data : public QShared {
-OEffectiveEvent::OEffectiveEvent() {
+
+OEffectiveEvent::OEffectiveEvent()
+{
data = new Data;
@@ -592,4 +781,7 @@ OEffectiveEvent::OEffectiveEvent() {
}
+
+
OEffectiveEvent::OEffectiveEvent( const OEvent& ev, const QDate& startDate,
- Position pos ) {
+ Position pos )
+{
data = new Data;
@@ -609,3 +801,6 @@ OEffectiveEvent::OEffectiveEvent( const OEvent& ev, const QDate& startDate,
}
-OEffectiveEvent::OEffectiveEvent( const OEffectiveEvent& ev) {
+
+
+OEffectiveEvent::OEffectiveEvent( const OEffectiveEvent& ev )
+{
data = ev.data;
@@ -613,4 +808,8 @@ OEffectiveEvent::OEffectiveEvent( const OEffectiveEvent& ev) {
}
-OEffectiveEvent::~OEffectiveEvent() {
- if ( data->deref() ) {
+
+
+OEffectiveEvent::~OEffectiveEvent()
+{
+ if ( data->deref() )
+ {
delete data;
@@ -619,3 +818,6 @@ OEffectiveEvent::~OEffectiveEvent() {
}
-OEffectiveEvent& OEffectiveEvent::operator=( const OEffectiveEvent& ev ) {
+
+
+OEffectiveEvent& OEffectiveEvent::operator=( const OEffectiveEvent& ev )
+{
if ( *this == ev ) return *this;
@@ -629,3 +831,5 @@ OEffectiveEvent& OEffectiveEvent::operator=( const OEffectiveEvent& ev ) {
-void OEffectiveEvent::setStartTime( const QTime& ti) {
+
+void OEffectiveEvent::setStartTime( const QTime& ti )
+{
changeOrModify();
@@ -633,3 +837,6 @@ void OEffectiveEvent::setStartTime( const QTime& ti) {
}
-void OEffectiveEvent::setEndTime( const QTime& en) {
+
+
+void OEffectiveEvent::setEndTime( const QTime& en )
+{
changeOrModify();
@@ -637,3 +844,6 @@ void OEffectiveEvent::setEndTime( const QTime& en) {
}
-void OEffectiveEvent::setEvent( const OEvent& ev) {
+
+
+void OEffectiveEvent::setEvent( const OEvent& ev )
+{
changeOrModify();
@@ -641,3 +851,6 @@ void OEffectiveEvent::setEvent( const OEvent& ev) {
}
-void OEffectiveEvent::setDate( const QDate& da) {
+
+
+void OEffectiveEvent::setDate( const QDate& da )
+{
changeOrModify();
@@ -645,5 +858,9 @@ void OEffectiveEvent::setDate( const QDate& da) {
}
+
+
void OEffectiveEvent::setEffectiveDates( const QDate& from,
- const QDate& to ) {
- if (!from.isValid() ) {
+ const QDate& to )
+{
+ if ( !from.isValid() )
+ {
data->dates = false;
@@ -655,24 +872,48 @@ void OEffectiveEvent::setEffectiveDates( const QDate& from,
}
-QString OEffectiveEvent::description()const {
+
+
+QString OEffectiveEvent::description() const
+{
return data->event.description();
}
-QString OEffectiveEvent::location()const {
+
+
+QString OEffectiveEvent::location() const
+{
return data->event.location();
}
-QString OEffectiveEvent::note()const {
+
+
+QString OEffectiveEvent::note() const
+{
return data->event.note();
}
-OEvent OEffectiveEvent::event()const {
+
+
+OEvent OEffectiveEvent::event() const
+{
return data->event;
}
-QTime OEffectiveEvent::startTime()const {
+
+
+QTime OEffectiveEvent::startTime() const
+{
return data->start;
}
-QTime OEffectiveEvent::endTime()const {
+
+
+QTime OEffectiveEvent::endTime() const
+{
return data->end;
}
-QDate OEffectiveEvent::date()const {
+
+
+QDate OEffectiveEvent::date() const
+{
return data->date;
}
-int OEffectiveEvent::length()const {
+
+
+int OEffectiveEvent::length() const
+{
return (data->end.hour() * 60 - data->start.hour() * 60)
@@ -680,3 +921,6 @@ int OEffectiveEvent::length()const {
}
-int OEffectiveEvent::size()const {
+
+
+int OEffectiveEvent::size() const
+{
return ( data->end.hour() - data->start.hour() ) * 3600
@@ -685,3 +929,6 @@ int OEffectiveEvent::size()const {
}
-QDate OEffectiveEvent::startDate()const {
+
+
+QDate OEffectiveEvent::startDate() const
+{
if ( data->dates )
@@ -693,3 +940,6 @@ QDate OEffectiveEvent::startDate()const {
}
-QDate OEffectiveEvent::endDate()const {
+
+
+QDate OEffectiveEvent::endDate() const
+{
if ( data->dates )
@@ -701,4 +951,8 @@ QDate OEffectiveEvent::endDate()const {
}
-void OEffectiveEvent::deref() {
- if ( data->deref() ) {
+
+
+void OEffectiveEvent::deref()
+{
+ if ( data->deref() )
+ {
delete data;
@@ -707,4 +961,8 @@ void OEffectiveEvent::deref() {
}
-void OEffectiveEvent::changeOrModify() {
- if ( data->count != 1 ) {
+
+
+void OEffectiveEvent::changeOrModify()
+{
+ if ( data->count != 1 )
+ {
data->deref();
@@ -721,3 +979,6 @@ void OEffectiveEvent::changeOrModify() {
}
-bool OEffectiveEvent::operator<( const OEffectiveEvent &e ) const{
+
+
+bool OEffectiveEvent::operator<( const OEffectiveEvent &e ) const
+{
if ( data->date < e.date() )
@@ -729,6 +990,12 @@ bool OEffectiveEvent::operator<( const OEffectiveEvent &e ) const{
}
-bool OEffectiveEvent::operator<=( const OEffectiveEvent &e ) const{
+
+
+bool OEffectiveEvent::operator<=( const OEffectiveEvent &e ) const
+{
return (data->date <= e.date() );
}
-bool OEffectiveEvent::operator==( const OEffectiveEvent &e ) const {
+
+
+bool OEffectiveEvent::operator==( const OEffectiveEvent &e ) const
+{
return ( date() == e.date()
@@ -738,9 +1005,18 @@ bool OEffectiveEvent::operator==( const OEffectiveEvent &e ) const {
}
-bool OEffectiveEvent::operator!=( const OEffectiveEvent &e ) const {
+
+
+bool OEffectiveEvent::operator!=( const OEffectiveEvent &e ) const
+{
return !(*this == e );
}
-bool OEffectiveEvent::operator>( const OEffectiveEvent &e ) const {
+
+
+bool OEffectiveEvent::operator>( const OEffectiveEvent &e ) const
+{
return !(*this <= e );
}
-bool OEffectiveEvent::operator>= ( const OEffectiveEvent &e ) const {
+
+
+bool OEffectiveEvent::operator>= ( const OEffectiveEvent &e ) const
+{
return !(*this < e);
diff --git a/libopie2/opiepim/oevent.h b/libopie2/opiepim/oevent.h
index 9502efa..dc5e4d6 100644
--- a/libopie2/opiepim/oevent.h
+++ b/libopie2/opiepim/oevent.h
@@ -2,3 +2,3 @@
This file is part of the Opie Project
- Copyright (C) Stefan Eilers (Eilers.Stefan@epost.de)
+ Copyright (C) Stefan Eilers <Eilers.Stefan@epost.de>
=. Copyright (C) The Opie Team <opie-devel@handhelds.org>
@@ -30,9 +30,8 @@
-#ifndef OPIE_PIM_EVENT_H
-#define OPIE_PIM_EVENT_H
-
-#include <qstring.h>
-#include <qdatetime.h>
-#include <qvaluelist.h>
+#ifndef OEVENT_H
+#define OEVENT_H
+/* OPIE */
+#include <opie2/otimezone.h>
+#include <opie2/opimrecord.h>
#include <qpe/recordfields.h>
@@ -40,7 +39,11 @@
-#include <opie2/otimezone.h>
-#include <opie2/opimrecord.h>
+/* QT */
+#include <qstring.h>
+#include <qdatetime.h>
+#include <qvaluelist.h>
-namespace Opie {
-struct OCalendarHelper {
+namespace Opie
+{
+struct OCalendarHelper
+{
/** calculate the week number of the date */
@@ -67,3 +70,4 @@ class ORecur;
*/
-class OEvent : public OPimRecord {
+class OEvent : public OPimRecord
+{
public:
@@ -193,2 +197,3 @@ public:
*/
+
private:
@@ -206,3 +211,5 @@ private:
*/
-class OEffectiveEvent {
+class OEffectiveEvent
+{
+
public:
diff --git a/libopie2/opiepim/orecordlist.h b/libopie2/opiepim/orecordlist.h
index 8f0011b..1742dcc 100644
--- a/libopie2/opiepim/orecordlist.h
+++ b/libopie2/opiepim/orecordlist.h
@@ -29,7 +29,6 @@
-#ifndef OPIE_RECORD_LIST_H
-#define OPIE_RECORD_LIST_H
-
-#include <qarray.h>
+#ifndef ORECORDLIST_H
+#define ORECORDLIST_H
+/* OPIE */
#include <opie2/otemplatebase.h>
@@ -37,3 +36,7 @@
-namespace Opie {
+/* QT */
+#include <qarray.h>
+
+namespace Opie
+{
@@ -49,4 +52,6 @@ template <class T> class ORecordList;
template <class T = OPimRecord>
-class ORecordListIterator {
+class ORecordListIterator
+{
friend class ORecordList<T>;
+
public:
@@ -107,2 +112,3 @@ private:
+
class ORecordListPrivate;
@@ -113,3 +119,4 @@ class ORecordListPrivate;
template <class T = OPimRecord >
-class ORecordList {
+class ORecordList
+{
public:
@@ -121,4 +128,4 @@ public:
*/
- ORecordList () {
- }
+ ORecordList ()
+ {}
ORecordList( const QArray<int>& ids,
@@ -160,5 +167,7 @@ private:
+
/* ok now implement it */
template <class T>
-ORecordListIterator<T>::ORecordListIterator() {
+ORecordListIterator<T>::ORecordListIterator()
+{
m_current = 0;
@@ -170,4 +179,7 @@ ORecordListIterator<T>::ORecordListIterator() {
}
+
+
template <class T>
-ORecordListIterator<T>::~ORecordListIterator() {
+ORecordListIterator<T>::~ORecordListIterator()
+{
/* nothing to delete */
@@ -175,4 +187,6 @@ ORecordListIterator<T>::~ORecordListIterator() {
+
template <class T>
-ORecordListIterator<T>::ORecordListIterator( const ORecordListIterator<T>& it) {
+ORecordListIterator<T>::ORecordListIterator( const ORecordListIterator<T>& it )
+{
// qWarning("ORecordListIterator copy c'tor");
@@ -186,4 +200,6 @@ ORecordListIterator<T>::ORecordListIterator( const ORecordListIterator<T>& it) {
+
template <class T>
-ORecordListIterator<T> &ORecordListIterator<T>::operator=( const ORecordListIterator<T>& it) {
+ORecordListIterator<T> &ORecordListIterator<T>::operator=( const ORecordListIterator<T>& it )
+{
m_uids = it.m_uids;
@@ -197,4 +213,6 @@ ORecordListIterator<T> &ORecordListIterator<T>::operator=( const ORecordListIter
+
template <class T>
-T ORecordListIterator<T>::operator*() {
+T ORecordListIterator<T>::operator*()
+{
//qWarning("operator* %d %d", m_current, m_uids[m_current] );
@@ -210,9 +228,13 @@ T ORecordListIterator<T>::operator*() {
+
template <class T>
-ORecordListIterator<T> &ORecordListIterator<T>::operator++() {
+ORecordListIterator<T> &ORecordListIterator<T>::operator++()
+{
m_direction = true;
- if (m_current < m_uids.count() ) {
+ if ( m_current < m_uids.count() )
+ {
m_end = false;
++m_current;
- }else
+ }
+ else
m_end = true;
@@ -221,9 +243,14 @@ ORecordListIterator<T> &ORecordListIterator<T>::operator++() {
}
+
+
template <class T>
-ORecordListIterator<T> &ORecordListIterator<T>::operator--() {
+ORecordListIterator<T> &ORecordListIterator<T>::operator--()
+{
m_direction = false;
- if ( m_current > 0 ) {
+ if ( m_current > 0 )
+ {
--m_current;
m_end = false;
- } else
+ }
+ else
m_end = true;
@@ -233,4 +260,6 @@ ORecordListIterator<T> &ORecordListIterator<T>::operator--() {
+
template <class T>
-bool ORecordListIterator<T>::operator==( const ORecordListIterator<T>& it ) {
+bool ORecordListIterator<T>::operator==( const ORecordListIterator<T>& it )
+{
@@ -245,6 +274,11 @@ bool ORecordListIterator<T>::operator==( const ORecordListIterator<T>& it ) {
}
+
+
template <class T>
-bool ORecordListIterator<T>::operator!=( const ORecordListIterator<T>& it ) {
+bool ORecordListIterator<T>::operator!=( const ORecordListIterator<T>& it )
+{
return !(*this == it );
}
+
+
template <class T>
@@ -259,9 +293,16 @@ ORecordListIterator<T>::ORecordListIterator( const QArray<int> uids,
}
+
+
template <class T>
-uint ORecordListIterator<T>::current()const {
+uint ORecordListIterator<T>::current() const
+{
return m_current;
}
+
+
template <class T>
-void ORecordListIterator<T>::setCurrent( uint cur ) {
- if( cur < m_uids.count() ) {
+void ORecordListIterator<T>::setCurrent( uint cur )
+{
+ if ( cur < m_uids.count() )
+ {
m_end = false;
@@ -271,5 +312,8 @@ void ORecordListIterator<T>::setCurrent( uint cur ) {
template <class T>
-uint ORecordListIterator<T>::count()const {
+uint ORecordListIterator<T>::count() const
+{
return m_uids.count();
}
+
+
template <class T>
@@ -278,10 +322,15 @@ ORecordList<T>::ORecordList( const QArray<int>& ids,
: m_ids( ids ), m_acc( acc )
-{
-}
+{}
+
+
template <class T>
-ORecordList<T>::~ORecordList() {
+ORecordList<T>::~ORecordList()
+{
/* nothing to do here */
}
+
+
template <class T>
-typename ORecordList<T>::Iterator ORecordList<T>::begin() {
+typename ORecordList<T>::Iterator ORecordList<T>::begin()
+{
Iterator it( m_ids, m_acc );
@@ -289,4 +338,7 @@ typename ORecordList<T>::Iterator ORecordList<T>::begin() {
}
+
+
template <class T>
-typename ORecordList<T>::Iterator ORecordList<T>::end() {
+typename ORecordList<T>::Iterator ORecordList<T>::end()
+{
Iterator it( m_ids, m_acc );
@@ -297,8 +349,14 @@ typename ORecordList<T>::Iterator ORecordList<T>::end() {
}
+
+
template <class T>
-uint ORecordList<T>::count()const {
+uint ORecordList<T>::count() const
+{
return m_ids.count();
}
+
+
template <class T>
-T ORecordList<T>::operator[]( uint i ) {
+T ORecordList<T>::operator[] ( uint i )
+{
if ( i >= m_ids.count() )
@@ -308,4 +366,7 @@ T ORecordList<T>::operator[]( uint i ) {
}
+
+
template <class T>
-int ORecordList<T>::uidAt( uint i ) {
+int ORecordList<T>::uidAt( uint i )
+{
return m_ids[i];
@@ -313,4 +374,6 @@ int ORecordList<T>::uidAt( uint i ) {
+
template <class T>
-bool ORecordList<T>::remove( int uid ) {
+bool ORecordList<T>::remove( int uid )
+{
QArray<int> copy( m_ids.count() );
@@ -319,7 +382,10 @@ bool ORecordList<T>::remove( int uid ) {
- for (uint i = 0; i < m_ids.count(); i++){
- if ( m_ids[i] != uid ){
+ for ( uint i = 0; i < m_ids.count(); i++ )
+ {
+ if ( m_ids[ i ] != uid )
+ {
copy[counter++] = m_ids[i];
- }else
+ }
+ else
ret_val = true;
diff --git a/libopie2/opiepim/otodo.cpp b/libopie2/opiepim/otodo.cpp
index 3eb0026..f534067 100644
--- a/libopie2/opiepim/otodo.cpp
+++ b/libopie2/opiepim/otodo.cpp
@@ -28,7 +28,11 @@
*/
-#include <qobject.h>
-#include <qshared.h>
-
+#include "otodo.h"
+/* OPIE */
+#include <opie2/opimstate.h>
+#include <opie2/orecur.h>
+#include <opie2/opimmaintainer.h>
+#include <opie2/opimnotifymanager.h>
+#include <opie2/opimresolver.h>
#include <qpe/palmtopuidgen.h>
@@ -40,15 +44,13 @@
+/* QT */
+#include <qobject.h>
+#include <qshared.h>
-#include <opie2/opimstate.h>
-#include <opie2/orecur.h>
-#include <opie2/opimmaintainer.h>
-#include <opie2/opimnotifymanager.h>
-#include <opie2/opimresolver.h>
-
-#include <opie2/otodo.h>
-
-namespace Opie {
+namespace Opie
+{
-struct OTodo::OTodoData : public QShared {
- OTodoData() : QShared() {
+struct OTodo::OTodoData : public QShared
+{
+ OTodoData() : QShared()
+ {
recur = 0;
@@ -58,3 +60,4 @@ struct OTodo::OTodoData : public QShared {
};
- ~OTodoData() {
+ ~OTodoData()
+ {
delete recur;
@@ -80,2 +83,3 @@ struct OTodo::OTodoData : public QShared {
+
OTodo::OTodo(const OTodo &event )
@@ -86,6 +90,10 @@ OTodo::OTodo(const OTodo &event )
}
-OTodo::~OTodo() {
+
+
+OTodo::~OTodo()
+{
// qWarning("~OTodo " );
- if ( data->deref() ) {
+ if ( data->deref() )
+ {
// qWarning("OTodo::dereffing");
@@ -95,2 +103,4 @@ OTodo::~OTodo() {
}
+
+
OTodo::OTodo(bool completed, int priority,
@@ -116,2 +126,4 @@ OTodo::OTodo(bool completed, int priority,
}
+
+
OTodo::OTodo(bool completed, int priority,
@@ -137,14 +149,23 @@ OTodo::OTodo(bool completed, int priority,
}
+
+
bool OTodo::match( const QRegExp &regExp )const
{
- if( QString::number( data->priority ).find( regExp ) != -1 ){
+ if ( QString::number( data->priority ).find( regExp ) != -1 )
+ {
setLastHitField( Priority );
return true;
- }else if( data->hasDate && data->date.toString().find( regExp) != -1 ){
+ }
+ else if ( data->hasDate && data->date.toString().find( regExp ) != -1 )
+ {
setLastHitField( HasDate );
return true;
- }else if(data->desc.find( regExp ) != -1 ){
+ }
+ else if ( data->desc.find( regExp ) != -1 )
+ {
setLastHitField( Description );
return true;
- }else if(data->sum.find( regExp ) != -1 ) {
+ }
+ else if ( data->sum.find( regExp ) != -1 )
+ {
setLastHitField( Summary );
@@ -154,2 +175,4 @@ bool OTodo::match( const QRegExp &regExp )const
}
+
+
bool OTodo::isCompleted() const
@@ -158,2 +181,4 @@ bool OTodo::isCompleted() const
}
+
+
bool OTodo::hasDueDate() const
@@ -162,8 +187,16 @@ bool OTodo::hasDueDate() const
}
-bool OTodo::hasStartDate()const {
+
+
+bool OTodo::hasStartDate() const
+{
return data->start.isValid();
}
-bool OTodo::hasCompletedDate()const {
+
+
+bool OTodo::hasCompletedDate() const
+{
return data->completed.isValid();
}
+
+
int OTodo::priority()const
@@ -172,2 +205,4 @@ int OTodo::priority()const
}
+
+
QString OTodo::summary() const
@@ -176,2 +211,4 @@ QString OTodo::summary() const
}
+
+
ushort OTodo::progress() const
@@ -180,2 +217,4 @@ ushort OTodo::progress() const
}
+
+
QDate OTodo::dueDate()const
@@ -184,8 +223,16 @@ QDate OTodo::dueDate()const
}
-QDate OTodo::startDate()const {
+
+
+QDate OTodo::startDate() const
+{
return data->start;
}
-QDate OTodo::completedDate()const {
+
+
+QDate OTodo::completedDate() const
+{
return data->completed;
}
+
+
QString OTodo::description()const
@@ -194,3 +241,6 @@ QString OTodo::description()const
}
-bool OTodo::hasState() const{
+
+
+bool OTodo::hasState() const
+{
if (!data->state ) return false;
@@ -198,4 +248,8 @@ bool OTodo::hasState() const{
}
-OPimState OTodo::state()const {
- if (!data->state ) {
+
+
+OPimState OTodo::state() const
+{
+ if ( !data->state )
+ {
OPimState state;
@@ -206,3 +260,6 @@ OPimState OTodo::state()const {
}
-bool OTodo::hasRecurrence()const {
+
+
+bool OTodo::hasRecurrence() const
+{
if (!data->recur) return false;
@@ -210,3 +267,6 @@ bool OTodo::hasRecurrence()const {
}
-ORecur OTodo::recurrence()const {
+
+
+ORecur OTodo::recurrence() const
+{
if (!data->recur) return ORecur();
@@ -215,3 +275,6 @@ ORecur OTodo::recurrence()const {
}
-bool OTodo::hasMaintainer()const {
+
+
+bool OTodo::hasMaintainer() const
+{
if (!data->maintainer) return false;
@@ -220,3 +283,6 @@ bool OTodo::hasMaintainer()const {
}
-OPimMaintainer OTodo::maintainer()const {
+
+
+OPimMaintainer OTodo::maintainer() const
+{
if (!data->maintainer) return OPimMaintainer();
@@ -225,2 +291,4 @@ OPimMaintainer OTodo::maintainer()const {
}
+
+
void OTodo::setCompleted( bool completed )
@@ -230,2 +298,4 @@ void OTodo::setCompleted( bool completed )
}
+
+
void OTodo::setHasDueDate( bool hasDate )
@@ -235,2 +305,4 @@ void OTodo::setHasDueDate( bool hasDate )
}
+
+
void OTodo::setDescription(const QString &desc )
@@ -241,2 +313,4 @@ void OTodo::setDescription(const QString &desc )
}
+
+
void OTodo::setSummary( const QString& sum )
@@ -246,2 +320,4 @@ void OTodo::setSummary( const QString& sum )
}
+
+
void OTodo::setPriority(int prio )
@@ -251,2 +327,4 @@ void OTodo::setPriority(int prio )
}
+
+
void OTodo::setDueDate( const QDate& date )
@@ -256,3 +334,6 @@ void OTodo::setDueDate( const QDate& date )
}
-void OTodo::setStartDate( const QDate& date ) {
+
+
+void OTodo::setStartDate( const QDate& date )
+{
changeOrModify();
@@ -260,3 +341,6 @@ void OTodo::setStartDate( const QDate& date ) {
}
-void OTodo::setCompletedDate( const QDate& date ) {
+
+
+void OTodo::setCompletedDate( const QDate& date )
+{
changeOrModify();
@@ -264,3 +348,6 @@ void OTodo::setCompletedDate( const QDate& date ) {
}
-void OTodo::setState( const OPimState& state ) {
+
+
+void OTodo::setState( const OPimState& state )
+{
changeOrModify();
@@ -271,3 +358,6 @@ void OTodo::setState( const OPimState& state ) {
}
-void OTodo::setRecurrence( const ORecur& rec) {
+
+
+void OTodo::setRecurrence( const ORecur& rec )
+{
changeOrModify();
@@ -278,3 +368,6 @@ void OTodo::setRecurrence( const ORecur& rec) {
}
-void OTodo::setMaintainer( const OPimMaintainer& pim ) {
+
+
+void OTodo::setMaintainer( const OPimMaintainer& pim )
+{
changeOrModify();
@@ -286,2 +379,4 @@ void OTodo::setMaintainer( const OPimMaintainer& pim ) {
}
+
+
bool OTodo::isOverdue( )
@@ -292,2 +387,4 @@ bool OTodo::isOverdue( )
}
+
+
void OTodo::setProgress(ushort progress )
@@ -297,5 +394,10 @@ void OTodo::setProgress(ushort progress )
}
-QString OTodo::toShortText() const {
+
+
+QString OTodo::toShortText() const
+{
return summary();
}
+
+
/*!
@@ -310,3 +412,4 @@ QString OTodo::toRichText() const
text += "<b><h3><img src=\"todo/TodoList\"> ";
- if ( !summary().isEmpty() ) {
+ if ( !summary().isEmpty() )
+ {
text += Qtopia::escapeString(summary() ).replace(QRegExp( "[\n]"), "" );
@@ -316,3 +419,4 @@ QString OTodo::toRichText() const
// description
- if( !description().isEmpty() ){
+ if ( !description().isEmpty() )
+ {
text += "<b>" + QObject::tr( "Description:" ) + "</b><br>";
@@ -346,3 +450,4 @@ QString OTodo::toRichText() const
// due date
- if (hasDueDate() ){
+ if ( hasDueDate() )
+ {
QDate dd = dueDate();
@@ -368,3 +473,6 @@ QString OTodo::toRichText() const
}
-bool OTodo::hasNotifiers()const {
+
+
+bool OTodo::hasNotifiers() const
+{
if (!data->notifiers) return false;
@@ -372,3 +480,6 @@ bool OTodo::hasNotifiers()const {
}
-OPimNotifyManager& OTodo::notifiers() {
+
+
+OPimNotifyManager& OTodo::notifiers()
+{
if (!data->notifiers )
@@ -377,3 +488,6 @@ OPimNotifyManager& OTodo::notifiers() {
}
-const OPimNotifyManager& OTodo::notifiers()const{
+
+
+const OPimNotifyManager& OTodo::notifiers() const
+{
if (!data->notifiers )
@@ -384,9 +498,15 @@ const OPimNotifyManager& OTodo::notifiers()const{
-bool OTodo::operator<( const OTodo &toDoEvent )const{
+
+bool OTodo::operator<( const OTodo &toDoEvent ) const
+{
if( !hasDueDate() && !toDoEvent.hasDueDate() ) return true;
if( !hasDueDate() && toDoEvent.hasDueDate() ) return false;
- if( hasDueDate() && toDoEvent.hasDueDate() ){
- if( dueDate() == toDoEvent.dueDate() ){ // let's the priority decide
+ if ( hasDueDate() && toDoEvent.hasDueDate() )
+ {
+ if ( dueDate() == toDoEvent.dueDate() )
+ { // let's the priority decide
return priority() < toDoEvent.priority();
- }else{
+ }
+ else
+ {
return dueDate() < toDoEvent.dueDate();
@@ -396,2 +516,4 @@ bool OTodo::operator<( const OTodo &toDoEvent )const{
}
+
+
bool OTodo::operator<=(const OTodo &toDoEvent )const
@@ -400,6 +522,10 @@ bool OTodo::operator<=(const OTodo &toDoEvent )const
if( !hasDueDate() && toDoEvent.hasDueDate() ) return true;
- if( hasDueDate() && toDoEvent.hasDueDate() ){
- if( dueDate() == toDoEvent.dueDate() ){ // let's the priority decide
+ if ( hasDueDate() && toDoEvent.hasDueDate() )
+ {
+ if ( dueDate() == toDoEvent.dueDate() )
+ { // let's the priority decide
return priority() <= toDoEvent.priority();
- }else{
+ }
+ else
+ {
return dueDate() <= toDoEvent.dueDate();
@@ -409,2 +535,4 @@ bool OTodo::operator<=(const OTodo &toDoEvent )const
}
+
+
bool OTodo::operator>(const OTodo &toDoEvent )const
@@ -413,6 +541,10 @@ bool OTodo::operator>(const OTodo &toDoEvent )const
if( !hasDueDate() && toDoEvent.hasDueDate() ) return false;
- if( hasDueDate() && toDoEvent.hasDueDate() ){
- if( dueDate() == toDoEvent.dueDate() ){ // let's the priority decide
+ if ( hasDueDate() && toDoEvent.hasDueDate() )
+ {
+ if ( dueDate() == toDoEvent.dueDate() )
+ { // let's the priority decide
return priority() > toDoEvent.priority();
- }else{
+ }
+ else
+ {
return dueDate() > toDoEvent.dueDate();
@@ -422,2 +554,4 @@ bool OTodo::operator>(const OTodo &toDoEvent )const
}
+
+
bool OTodo::operator>=(const OTodo &toDoEvent )const
@@ -426,6 +560,10 @@ bool OTodo::operator>=(const OTodo &toDoEvent )const
if( !hasDueDate() && toDoEvent.hasDueDate() ) return false;
- if( hasDueDate() && toDoEvent.hasDueDate() ){
- if( dueDate() == toDoEvent.dueDate() ){ // let's the priority decide
+ if ( hasDueDate() && toDoEvent.hasDueDate() )
+ {
+ if ( dueDate() == toDoEvent.dueDate() )
+ { // let's the priority decide
return priority() > toDoEvent.priority();
- }else{
+ }
+ else
+ {
return dueDate() > toDoEvent.dueDate();
@@ -435,2 +573,4 @@ bool OTodo::operator>=(const OTodo &toDoEvent )const
}
+
+
bool OTodo::operator==(const OTodo &toDoEvent )const
@@ -449,6 +589,10 @@ bool OTodo::operator==(const OTodo &toDoEvent )const
}
-void OTodo::deref() {
+
+
+void OTodo::deref()
+{
// qWarning("deref in ToDoEvent");
- if ( data->deref() ) {
+ if ( data->deref() )
+ {
// qWarning("deleting");
@@ -458,2 +602,4 @@ void OTodo::deref() {
}
+
+
OTodo &OTodo::operator=(const OTodo &item )
@@ -471,3 +617,5 @@ OTodo &OTodo::operator=(const OTodo &item )
-QMap<int, QString> OTodo::toMap() const {
+
+QMap<int, QString> OTodo::toMap() const
+{
QMap<int, QString> map;
@@ -494,2 +642,3 @@ QMap<int, QString> OTodo::toMap() const {
+
/**
@@ -499,4 +648,6 @@ QMap<int, QString> OTodo::toMap() const {
*/
-void OTodo::changeOrModify() {
- if ( data->count != 1 ) {
+void OTodo::changeOrModify()
+{
+ if ( data->count != 1 )
+ {
qWarning("changeOrModify");
@@ -508,2 +659,4 @@ void OTodo::changeOrModify() {
}
+
+
// WATCHOUT
@@ -513,3 +666,4 @@ void OTodo::changeOrModify() {
*/
-void OTodo::copy( OTodoData* src, OTodoData* dest ) {
+void OTodo::copy( OTodoData* src, OTodoData* dest )
+{
dest->date = src->date;
@@ -538,6 +692,12 @@ void OTodo::copy( OTodoData* src, OTodoData* dest ) {
}
-QString OTodo::type() const {
+
+
+QString OTodo::type() const
+{
return QString::fromLatin1("OTodo");
}
-QString OTodo::recordField(int /*id*/ )const {
+
+
+QString OTodo::recordField( int /*id*/ ) const
+{
return QString::null;
@@ -545,3 +705,5 @@ QString OTodo::recordField(int /*id*/ )const {
-int OTodo::rtti(){
+
+int OTodo::rtti()
+{
return OPimResolver::TodoList;
diff --git a/libopie2/opiepim/otodo.h b/libopie2/opiepim/otodo.h
index 61add04..04dd269 100644
--- a/libopie2/opiepim/otodo.h
+++ b/libopie2/opiepim/otodo.h
@@ -28,6 +28,12 @@
*/
-#ifndef OPIE_TODO_EVENT_H
-#define OPIE_TODO_EVENT_H
+#ifndef OTODOEVENT_H
+#define OTODOEVENT_H
+/* OPIE */
+#include <opie2/opimrecord.h>
+#include <qpe/recordfields.h>
+#include <qpe/palmtopuidgen.h>
+
+/* QT */
#include <qarray.h>
@@ -39,9 +45,4 @@
-#include <qpe/recordfields.h>
-#include <qpe/palmtopuidgen.h>
-
-#include <opie2/opimrecord.h>
-
-
-namespace Opie {
+namespace Opie
+{
@@ -51,3 +52,4 @@ class OPimMaintainer;
class OPimNotifyManager;
-class OTodo : public OPimRecord {
+class OTodo : public OPimRecord
+{
public:
@@ -308,3 +310,6 @@ public:
};
-inline bool OTodo::operator!=(const OTodo &toDoEvent )const {
+
+
+inline bool OTodo::operator!=( const OTodo &toDoEvent ) const
+{
return !(*this == toDoEvent);