summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/core/opimrecord.cpp
Unidiff
Diffstat (limited to 'libopie2/opiepim/core/opimrecord.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiepim/core/opimrecord.cpp117
1 files changed, 89 insertions, 28 deletions
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 @@
28*/ 28*/
29#include <qarray.h>
30 29
30#include "opimrecord.h"
31
32/* OPIE */
31#include <qpe/categories.h> 33#include <qpe/categories.h>
@@ -33,5 +35,7 @@
33 35
34#include <opie2/opimrecord.h> 36/* QT */
37#include <qarray.h>
35 38
36namespace Opie { 39namespace Opie
40{
37Qtopia::UidGen OPimRecord::m_uidGen( Qtopia::UidGen::Qtopia ); 41Qtopia::UidGen OPimRecord::m_uidGen( Qtopia::UidGen::Qtopia );
@@ -40,3 +44,4 @@ Qtopia::UidGen OPimRecord::m_uidGen( Qtopia::UidGen::Qtopia );
40OPimRecord::OPimRecord( int uid ) 44OPimRecord::OPimRecord( int uid )
41 : Qtopia::Record() { 45 : Qtopia::Record()
46{
42 47
@@ -45,4 +50,8 @@ OPimRecord::OPimRecord( int uid )
45} 50}
46OPimRecord::~OPimRecord() { 51
47} 52
53OPimRecord::~OPimRecord()
54{}
55
56
48OPimRecord::OPimRecord( const OPimRecord& rec ) 57OPimRecord::OPimRecord( const OPimRecord& rec )
@@ -53,3 +62,5 @@ OPimRecord::OPimRecord( const OPimRecord& rec )
53 62
54OPimRecord &OPimRecord::operator=( const OPimRecord& rec) { 63
64OPimRecord &OPimRecord::operator=( const OPimRecord& rec )
65{
55 if ( this == &rec ) return *this; 66 if ( this == &rec ) return *this;
@@ -62,2 +73,4 @@ OPimRecord &OPimRecord::operator=( const OPimRecord& rec) {
62} 73}
74
75
63/* 76/*
@@ -65,3 +78,4 @@ OPimRecord &OPimRecord::operator=( const OPimRecord& rec) {
65 */ 78 */
66QStringList OPimRecord::categoryNames( const QString& appname ) const { 79QStringList OPimRecord::categoryNames( const QString& appname ) const
80{
67 QStringList list; 81 QStringList list;
@@ -71,3 +85,4 @@ QStringList OPimRecord::categoryNames( const QString& appname ) const {
71 85
72 for (uint i = 0; i < cats.count(); i++ ) { 86 for ( uint i = 0; i < cats.count(); i++ )
87 {
73 list << catDB.label( appname, cats[i] ); 88 list << catDB.label( appname, cats[i] );
@@ -77,6 +92,11 @@ QStringList OPimRecord::categoryNames( const QString& appname ) const {
77} 92}
78void OPimRecord::setCategoryNames( const QStringList& ) {
79 93
94
95void OPimRecord::setCategoryNames( const QStringList& )
96{
80} 97}
81void OPimRecord::addCategoryName( const QString& ) { 98
99
100void OPimRecord::addCategoryName( const QString& )
101{
82 Categories catDB; 102 Categories catDB;
@@ -86,5 +106,10 @@ void OPimRecord::addCategoryName( const QString& ) {
86} 106}
87bool OPimRecord::isEmpty()const { 107
108
109bool OPimRecord::isEmpty() const
110{
88 return ( uid() == 0 ); 111 return ( uid() == 0 );
89} 112}
113
114
90/*QString OPimRecord::crossToString()const { 115/*QString OPimRecord::crossToString()const {
@@ -104,3 +129,4 @@ bool OPimRecord::isEmpty()const {
104/* if uid = 1 assign a new one */ 129/* if uid = 1 assign a new one */
105void OPimRecord::setUid( int uid ) { 130void OPimRecord::setUid( int uid )
131{
106 if ( uid == 1) 132 if ( uid == 1)
@@ -110,9 +136,18 @@ void OPimRecord::setUid( int uid ) {
110}; 136};
111Qtopia::UidGen &OPimRecord::uidGen() { 137
138
139Qtopia::UidGen &OPimRecord::uidGen()
140{
112 return m_uidGen; 141 return m_uidGen;
113} 142}
114OPimXRefManager &OPimRecord::xrefmanager() { 143
144
145OPimXRefManager &OPimRecord::xrefmanager()
146{
115 return m_xrefman; 147 return m_xrefman;
116} 148}
117int OPimRecord::rtti(){ 149
150
151int OPimRecord::rtti()
152{
118 return 0; 153 return 0;
@@ -128,3 +163,4 @@ int OPimRecord::rtti(){
128 */ 163 */
129bool OPimRecord::loadFromStream( QDataStream& stream ) { 164bool OPimRecord::loadFromStream( QDataStream& stream )
165{
130 int Int; 166 int Int;
@@ -137,3 +173,4 @@ bool OPimRecord::loadFromStream( QDataStream& stream ) {
137 QArray<int> array(UInt); 173 QArray<int> array(UInt);
138 for (uint i = 0; i < UInt; i++ ) { 174 for ( uint i = 0; i < UInt; i++ )
175 {
139 stream >> array[i]; 176 stream >> array[i];
@@ -147,3 +184,4 @@ bool OPimRecord::loadFromStream( QDataStream& stream ) {
147 stream >> UInt; 184 stream >> UInt;
148 for ( uint i = 0; i < UInt; i++ ) { 185 for ( uint i = 0; i < UInt; i++ )
186 {
149 xref.setPartner( OPimXRef::One, partner( stream ) ); 187 xref.setPartner( OPimXRef::One, partner( stream ) );
@@ -155,3 +193,6 @@ bool OPimRecord::loadFromStream( QDataStream& stream ) {
155} 193}
156bool OPimRecord::saveToStream( QDataStream& stream )const { 194
195
196bool OPimRecord::saveToStream( QDataStream& stream ) const
197{
157 /** UIDs */ 198 /** UIDs */
@@ -162,3 +203,4 @@ bool OPimRecord::saveToStream( QDataStream& stream )const {
162 stream << categories().count(); 203 stream << categories().count();
163 for ( uint i = 0; i < categories().count(); i++ ) { 204 for ( uint i = 0; i < categories().count(); i++ )
205 {
164 stream << categories()[i]; 206 stream << categories()[i];
@@ -172,3 +214,4 @@ bool OPimRecord::saveToStream( QDataStream& stream )const {
172 for ( OPimXRef::ValueList::ConstIterator it = m_xrefman.list().begin(); 214 for ( OPimXRef::ValueList::ConstIterator it = m_xrefman.list().begin();
173 it != m_xrefman.list().end(); ++it ) { 215 it != m_xrefman.list().end(); ++it )
216 {
174 flush( (*it).partner( OPimXRef::One), stream ); 217 flush( (*it).partner( OPimXRef::One), stream );
@@ -178,3 +221,6 @@ bool OPimRecord::saveToStream( QDataStream& stream )const {
178} 221}
179void OPimRecord::flush( const OPimXRefPartner& par, QDataStream& str ) const{ 222
223
224void OPimRecord::flush( const OPimXRefPartner& par, QDataStream& str ) const
225{
180 str << par.service(); 226 str << par.service();
@@ -183,3 +229,6 @@ void OPimRecord::flush( const OPimXRefPartner& par, QDataStream& str ) const{
183} 229}
184OPimXRefPartner OPimRecord::partner( QDataStream& stream ) { 230
231
232OPimXRefPartner OPimRecord::partner( QDataStream& stream )
233{
185 OPimXRefPartner par; 234 OPimXRefPartner par;
@@ -199,12 +248,24 @@ OPimXRefPartner OPimRecord::partner( QDataStream& stream ) {
199} 248}
200void OPimRecord::setLastHitField( int lastHit )const { 249
250
251void OPimRecord::setLastHitField( int lastHit ) const
252{
201 m_lastHit = lastHit; 253 m_lastHit = lastHit;
202} 254}
203int OPimRecord::lastHitField()const{ 255
256
257int OPimRecord::lastHitField() const
258{
204 return m_lastHit; 259 return m_lastHit;
205} 260}
206QMap<QString, QString> OPimRecord::toExtraMap()const { 261
262
263QMap<QString, QString> OPimRecord::toExtraMap() const
264{
207 return customMap; 265 return customMap;
208} 266}
209void OPimRecord::setExtraMap( const QMap<QString, QString>& map) { 267
268
269void OPimRecord::setExtraMap( const QMap<QString, QString>& map )
270{
210 customMap = map; 271 customMap = map;