summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/pim/opimrecord.cpp2
-rw-r--r--libopie2/opiepim/core/opimrecord.cpp2
2 files changed, 4 insertions, 0 deletions
diff --git a/libopie/pim/opimrecord.cpp b/libopie/pim/opimrecord.cpp
index 9510357..0c9734d 100644
--- a/libopie/pim/opimrecord.cpp
+++ b/libopie/pim/opimrecord.cpp
@@ -1,73 +1,75 @@
1#include <qarray.h> 1#include <qarray.h>
2 2
3#include <qpe/categories.h> 3#include <qpe/categories.h>
4#include <qpe/categoryselect.h> 4#include <qpe/categoryselect.h>
5 5
6#include "opimrecord.h" 6#include "opimrecord.h"
7 7
8Qtopia::UidGen OPimRecord::m_uidGen( Qtopia::UidGen::Qtopia ); 8Qtopia::UidGen OPimRecord::m_uidGen( Qtopia::UidGen::Qtopia );
9 9
10 10
11OPimRecord::OPimRecord( int uid ) 11OPimRecord::OPimRecord( int uid )
12 : Qtopia::Record() { 12 : Qtopia::Record() {
13 13
14 m_lastHit = -1; 14 m_lastHit = -1;
15 setUid( uid ); 15 setUid( uid );
16} 16}
17OPimRecord::~OPimRecord() { 17OPimRecord::~OPimRecord() {
18} 18}
19OPimRecord::OPimRecord( const OPimRecord& rec ) 19OPimRecord::OPimRecord( const OPimRecord& rec )
20 : Qtopia::Record( rec ) 20 : Qtopia::Record( rec )
21{ 21{
22 (*this) = rec; 22 (*this) = rec;
23} 23}
24 24
25OPimRecord &OPimRecord::operator=( const OPimRecord& rec) { 25OPimRecord &OPimRecord::operator=( const OPimRecord& rec) {
26 if ( this == &rec ) return *this;
27
26 Qtopia::Record::operator=( rec ); 28 Qtopia::Record::operator=( rec );
27 m_xrefman = rec.m_xrefman; 29 m_xrefman = rec.m_xrefman;
28 m_lastHit = rec.m_lastHit; 30 m_lastHit = rec.m_lastHit;
29 31
30 return *this; 32 return *this;
31} 33}
32/* 34/*
33 * category names 35 * category names
34 */ 36 */
35QStringList OPimRecord::categoryNames( const QString& appname ) const { 37QStringList OPimRecord::categoryNames( const QString& appname ) const {
36 QStringList list; 38 QStringList list;
37 QArray<int> cats = categories(); 39 QArray<int> cats = categories();
38 Categories catDB; 40 Categories catDB;
39 catDB.load( categoryFileName() ); 41 catDB.load( categoryFileName() );
40 42
41 for (uint i = 0; i < cats.count(); i++ ) { 43 for (uint i = 0; i < cats.count(); i++ ) {
42 list << catDB.label( appname, cats[i] ); 44 list << catDB.label( appname, cats[i] );
43 } 45 }
44 46
45 return list; 47 return list;
46} 48}
47void OPimRecord::setCategoryNames( const QStringList& ) { 49void OPimRecord::setCategoryNames( const QStringList& ) {
48 50
49} 51}
50void OPimRecord::addCategoryName( const QString& ) { 52void OPimRecord::addCategoryName( const QString& ) {
51 Categories catDB; 53 Categories catDB;
52 catDB.load( categoryFileName() ); 54 catDB.load( categoryFileName() );
53 55
54 56
55} 57}
56bool OPimRecord::isEmpty()const { 58bool OPimRecord::isEmpty()const {
57 return ( uid() == 0 ); 59 return ( uid() == 0 );
58} 60}
59/*QString OPimRecord::crossToString()const { 61/*QString OPimRecord::crossToString()const {
60 QString str; 62 QString str;
61 QMap<QString, QArray<int> >::ConstIterator it; 63 QMap<QString, QArray<int> >::ConstIterator it;
62 for (it = m_relations.begin(); it != m_relations.end(); ++it ) { 64 for (it = m_relations.begin(); it != m_relations.end(); ++it ) {
63 QArray<int> id = it.data(); 65 QArray<int> id = it.data();
64 for ( uint i = 0; i < id.size(); ++i ) { 66 for ( uint i = 0; i < id.size(); ++i ) {
65 str += it.key() + "," + QString::number( i ) + ";"; 67 str += it.key() + "," + QString::number( i ) + ";";
66 } 68 }
67 } 69 }
68 str = str.remove( str.length()-1, 1); // strip the ; 70 str = str.remove( str.length()-1, 1); // strip the ;
69 //qWarning("IDS " + str ); 71 //qWarning("IDS " + str );
70 72
71 return str; 73 return str;
72 }*/ 74 }*/
73/* if uid = 1 assign a new one */ 75/* if uid = 1 assign a new one */
diff --git a/libopie2/opiepim/core/opimrecord.cpp b/libopie2/opiepim/core/opimrecord.cpp
index 9510357..0c9734d 100644
--- a/libopie2/opiepim/core/opimrecord.cpp
+++ b/libopie2/opiepim/core/opimrecord.cpp
@@ -1,73 +1,75 @@
1#include <qarray.h> 1#include <qarray.h>
2 2
3#include <qpe/categories.h> 3#include <qpe/categories.h>
4#include <qpe/categoryselect.h> 4#include <qpe/categoryselect.h>
5 5
6#include "opimrecord.h" 6#include "opimrecord.h"
7 7
8Qtopia::UidGen OPimRecord::m_uidGen( Qtopia::UidGen::Qtopia ); 8Qtopia::UidGen OPimRecord::m_uidGen( Qtopia::UidGen::Qtopia );
9 9
10 10
11OPimRecord::OPimRecord( int uid ) 11OPimRecord::OPimRecord( int uid )
12 : Qtopia::Record() { 12 : Qtopia::Record() {
13 13
14 m_lastHit = -1; 14 m_lastHit = -1;
15 setUid( uid ); 15 setUid( uid );
16} 16}
17OPimRecord::~OPimRecord() { 17OPimRecord::~OPimRecord() {
18} 18}
19OPimRecord::OPimRecord( const OPimRecord& rec ) 19OPimRecord::OPimRecord( const OPimRecord& rec )
20 : Qtopia::Record( rec ) 20 : Qtopia::Record( rec )
21{ 21{
22 (*this) = rec; 22 (*this) = rec;
23} 23}
24 24
25OPimRecord &OPimRecord::operator=( const OPimRecord& rec) { 25OPimRecord &OPimRecord::operator=( const OPimRecord& rec) {
26 if ( this == &rec ) return *this;
27
26 Qtopia::Record::operator=( rec ); 28 Qtopia::Record::operator=( rec );
27 m_xrefman = rec.m_xrefman; 29 m_xrefman = rec.m_xrefman;
28 m_lastHit = rec.m_lastHit; 30 m_lastHit = rec.m_lastHit;
29 31
30 return *this; 32 return *this;
31} 33}
32/* 34/*
33 * category names 35 * category names
34 */ 36 */
35QStringList OPimRecord::categoryNames( const QString& appname ) const { 37QStringList OPimRecord::categoryNames( const QString& appname ) const {
36 QStringList list; 38 QStringList list;
37 QArray<int> cats = categories(); 39 QArray<int> cats = categories();
38 Categories catDB; 40 Categories catDB;
39 catDB.load( categoryFileName() ); 41 catDB.load( categoryFileName() );
40 42
41 for (uint i = 0; i < cats.count(); i++ ) { 43 for (uint i = 0; i < cats.count(); i++ ) {
42 list << catDB.label( appname, cats[i] ); 44 list << catDB.label( appname, cats[i] );
43 } 45 }
44 46
45 return list; 47 return list;
46} 48}
47void OPimRecord::setCategoryNames( const QStringList& ) { 49void OPimRecord::setCategoryNames( const QStringList& ) {
48 50
49} 51}
50void OPimRecord::addCategoryName( const QString& ) { 52void OPimRecord::addCategoryName( const QString& ) {
51 Categories catDB; 53 Categories catDB;
52 catDB.load( categoryFileName() ); 54 catDB.load( categoryFileName() );
53 55
54 56
55} 57}
56bool OPimRecord::isEmpty()const { 58bool OPimRecord::isEmpty()const {
57 return ( uid() == 0 ); 59 return ( uid() == 0 );
58} 60}
59/*QString OPimRecord::crossToString()const { 61/*QString OPimRecord::crossToString()const {
60 QString str; 62 QString str;
61 QMap<QString, QArray<int> >::ConstIterator it; 63 QMap<QString, QArray<int> >::ConstIterator it;
62 for (it = m_relations.begin(); it != m_relations.end(); ++it ) { 64 for (it = m_relations.begin(); it != m_relations.end(); ++it ) {
63 QArray<int> id = it.data(); 65 QArray<int> id = it.data();
64 for ( uint i = 0; i < id.size(); ++i ) { 66 for ( uint i = 0; i < id.size(); ++i ) {
65 str += it.key() + "," + QString::number( i ) + ";"; 67 str += it.key() + "," + QString::number( i ) + ";";
66 } 68 }
67 } 69 }
68 str = str.remove( str.length()-1, 1); // strip the ; 70 str = str.remove( str.length()-1, 1); // strip the ;
69 //qWarning("IDS " + str ); 71 //qWarning("IDS " + str );
70 72
71 return str; 73 return str;
72 }*/ 74 }*/
73/* if uid = 1 assign a new one */ 75/* if uid = 1 assign a new one */