summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/core
Side-by-side diff
Diffstat (limited to 'libopie2/opiepim/core') (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
6 files changed, 387 insertions, 136 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 ) );
+ };