author | zecke <zecke> | 2002-09-20 17:28:20 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-09-20 17:28:20 (UTC) |
commit | 55dd11ddae09bfc4907399c473f0387c135fdae6 (patch) (unidiff) | |
tree | 69d52e2f0e1030bbdcbf518f0a334ff4861500fa /libopie2/opiepim/core | |
parent | 40df2487c53a5ab484d33d619f5b6ed449c0b485 (diff) | |
download | opie-55dd11ddae09bfc4907399c473f0387c135fdae6.zip opie-55dd11ddae09bfc4907399c473f0387c135fdae6.tar.gz opie-55dd11ddae09bfc4907399c473f0387c135fdae6.tar.bz2 |
OTodo know is the first implementation of OPimRecord
-rw-r--r-- | libopie2/opiepim/core/opimrecord.cpp | 26 | ||||
-rw-r--r-- | libopie2/opiepim/core/opimrecord.h | 4 |
2 files changed, 23 insertions, 7 deletions
diff --git a/libopie2/opiepim/core/opimrecord.cpp b/libopie2/opiepim/core/opimrecord.cpp index 95de1df..d8f73c7 100644 --- a/libopie2/opiepim/core/opimrecord.cpp +++ b/libopie2/opiepim/core/opimrecord.cpp | |||
@@ -2,22 +2,24 @@ | |||
2 | 2 | ||
3 | OPimRecord::OPimRecord( int uid ) | 3 | OPimRecord::OPimRecord( int uid ) |
4 | : Qtopia::Record() { | 4 | : Qtopia::Record() { |
5 | |||
5 | setUid( uid ); | 6 | setUid( uid ); |
7 | /* assign a new UID */ | ||
6 | if ( uid == 1 ) | 8 | if ( uid == 1 ) |
7 | assignUid(); | 9 | assignUid(); |
8 | } | 10 | } |
9 | OPimRecord::~OPimRecord() { | 11 | OPimRecord::~OPimRecord() { |
10 | } | 12 | } |
11 | OPimRecord::OPimRecord( OPimRecord& rec ) | 13 | OPimRecord::OPimRecord( const OPimRecord& rec ) |
12 | : Qtopia::Record( rec ) | 14 | : Qtopia::Record( rec ) |
13 | { | 15 | { |
14 | (*this) = rec; | 16 | (*this) = rec; |
15 | } | 17 | } |
16 | 18 | ||
17 | OPimRecord &OPimRecord::operator=( const OPimRecord& rec) { | 19 | OPimRecord &OPimRecord::operator=( const OPimRecord& rec) { |
18 | /* how do I call the parent copy operator ? */ | 20 | Qtopia::Record::operator=( rec ); |
19 | setUid( rec.uid() ); | 21 | m_relations = rec.m_relations; |
20 | setCategories( rec.categories() ); | 22 | |
21 | return *this; | 23 | return *this; |
22 | } | 24 | } |
23 | QStringList OPimRecord::categoryNames()const { | 25 | QStringList OPimRecord::categoryNames()const { |
@@ -25,7 +27,7 @@ QStringList OPimRecord::categoryNames()const { | |||
25 | 27 | ||
26 | return list; | 28 | return list; |
27 | } | 29 | } |
28 | void OPimRecord::setCategoryName( const QStringList& ) { | 30 | void OPimRecord::setCategoryNames( const QStringList& ) { |
29 | 31 | ||
30 | } | 32 | } |
31 | void OPimRecord::addCategoryName( const QString& ) { | 33 | void OPimRecord::addCategoryName( const QString& ) { |
@@ -88,3 +90,17 @@ void OPimRecord::setRelations( const QString& app, QArray<int> ids ) { | |||
88 | } | 90 | } |
89 | m_relations.replace( app, tmp ); | 91 | m_relations.replace( app, tmp ); |
90 | } | 92 | } |
93 | QString OPimRecord::crossToString()const { | ||
94 | QString str; | ||
95 | QMap<QString, QArray<int> >::ConstIterator it; | ||
96 | for (it = m_relations.begin(); it != m_relations.end(); ++it ) { | ||
97 | QArray<int> id = it.data(); | ||
98 | for ( uint i = 0; i < id.size(); ++i ) { | ||
99 | str += it.key() + "," + QString::number( i ) + ";"; | ||
100 | } | ||
101 | } | ||
102 | str = str.remove( str.length()-1, 1); // strip the ; | ||
103 | //qWarning("IDS " + str ); | ||
104 | |||
105 | return str; | ||
106 | } | ||
diff --git a/libopie2/opiepim/core/opimrecord.h b/libopie2/opiepim/core/opimrecord.h index a0e0413..18112d4 100644 --- a/libopie2/opiepim/core/opimrecord.h +++ b/libopie2/opiepim/core/opimrecord.h | |||
@@ -19,7 +19,7 @@ public: | |||
19 | /** | 19 | /** |
20 | * copy c'tor | 20 | * copy c'tor |
21 | */ | 21 | */ |
22 | OPimRecord( OPimRecord& rec ); | 22 | OPimRecord( const OPimRecord& rec ); |
23 | 23 | ||
24 | /** | 24 | /** |
25 | * copy operator | 25 | * copy operator |
@@ -34,7 +34,7 @@ public: | |||
34 | /** | 34 | /** |
35 | * set category names they will be resolved | 35 | * set category names they will be resolved |
36 | */ | 36 | */ |
37 | void setCategoryName( const QStringList& ); | 37 | void setCategoryNames( const QStringList& ); |
38 | 38 | ||
39 | /** | 39 | /** |
40 | * addCategoryName adds a name | 40 | * addCategoryName adds a name |