-rw-r--r-- | libopie/pim/opimrecord.cpp | 16 | ||||
-rw-r--r-- | libopie2/opiepim/core/opimrecord.cpp | 16 |
2 files changed, 32 insertions, 0 deletions
diff --git a/libopie/pim/opimrecord.cpp b/libopie/pim/opimrecord.cpp index e510f4e..88b6fde 100644 --- a/libopie/pim/opimrecord.cpp +++ b/libopie/pim/opimrecord.cpp | |||
@@ -1,54 +1,70 @@ | |||
1 | #include <qpe/categories.h> | ||
2 | #include <qpe/categoryselect.h> | ||
3 | |||
1 | #include "opimrecord.h" | 4 | #include "opimrecord.h" |
2 | 5 | ||
3 | OPimRecord::OPimRecord( int uid ) | 6 | OPimRecord::OPimRecord( int uid ) |
4 | : Qtopia::Record() { | 7 | : Qtopia::Record() { |
5 | 8 | ||
6 | setUid( uid ); | 9 | setUid( uid ); |
7 | } | 10 | } |
8 | OPimRecord::~OPimRecord() { | 11 | OPimRecord::~OPimRecord() { |
9 | } | 12 | } |
10 | OPimRecord::OPimRecord( const OPimRecord& rec ) | 13 | OPimRecord::OPimRecord( const OPimRecord& rec ) |
11 | : Qtopia::Record( rec ) | 14 | : Qtopia::Record( rec ) |
12 | { | 15 | { |
13 | (*this) = rec; | 16 | (*this) = rec; |
14 | } | 17 | } |
15 | 18 | ||
16 | OPimRecord &OPimRecord::operator=( const OPimRecord& rec) { | 19 | OPimRecord &OPimRecord::operator=( const OPimRecord& rec) { |
17 | Qtopia::Record::operator=( rec ); | 20 | Qtopia::Record::operator=( rec ); |
18 | m_relations = rec.m_relations; | 21 | m_relations = rec.m_relations; |
19 | 22 | ||
20 | return *this; | 23 | return *this; |
21 | } | 24 | } |
25 | /* | ||
26 | * category names | ||
27 | */ | ||
22 | QStringList OPimRecord::categoryNames()const { | 28 | QStringList OPimRecord::categoryNames()const { |
23 | QStringList list; | 29 | QStringList list; |
30 | QArray<int> cats = categories(); | ||
31 | Categories catDB; | ||
32 | catDB.load( categoryFileName() ); | ||
33 | |||
34 | for (uint i = 0; i < cats.count(); i++ ) { | ||
35 | list << catDB.label("Todo List", cats[i] ); | ||
36 | } | ||
24 | 37 | ||
25 | return list; | 38 | return list; |
26 | } | 39 | } |
27 | void OPimRecord::setCategoryNames( const QStringList& ) { | 40 | void OPimRecord::setCategoryNames( const QStringList& ) { |
28 | 41 | ||
29 | } | 42 | } |
30 | void OPimRecord::addCategoryName( const QString& ) { | 43 | void OPimRecord::addCategoryName( const QString& ) { |
44 | Categories catDB; | ||
45 | catDB.load( categoryFileName() ); | ||
46 | |||
31 | 47 | ||
32 | } | 48 | } |
33 | bool OPimRecord::isEmpty()const { | 49 | bool OPimRecord::isEmpty()const { |
34 | return ( uid() == 0 ); | 50 | return ( uid() == 0 ); |
35 | } | 51 | } |
36 | QStringList OPimRecord::relatedApps()const{ | 52 | QStringList OPimRecord::relatedApps()const{ |
37 | QStringList list; | 53 | QStringList list; |
38 | QMap<QString, QArray<int> >::ConstIterator it; | 54 | QMap<QString, QArray<int> >::ConstIterator it; |
39 | for ( it = m_relations.begin(); it != m_relations.end(); ++it ) { | 55 | for ( it = m_relations.begin(); it != m_relations.end(); ++it ) { |
40 | list << it.key(); | 56 | list << it.key(); |
41 | } | 57 | } |
42 | return list; | 58 | return list; |
43 | } | 59 | } |
44 | QArray<int> OPimRecord::relations(const QString& app )const { | 60 | QArray<int> OPimRecord::relations(const QString& app )const { |
45 | QArray<int> tmp; | 61 | QArray<int> tmp; |
46 | QMap<QString, QArray<int> >::ConstIterator it; | 62 | QMap<QString, QArray<int> >::ConstIterator it; |
47 | it = m_relations.find( app); | 63 | it = m_relations.find( app); |
48 | if ( it != m_relations.end() ) | 64 | if ( it != m_relations.end() ) |
49 | tmp = it.data(); | 65 | tmp = it.data(); |
50 | return tmp; | 66 | return tmp; |
51 | } | 67 | } |
52 | void OPimRecord::clearRelation( const QString& app ) { | 68 | void OPimRecord::clearRelation( const QString& app ) { |
53 | m_relations.remove( app ); | 69 | m_relations.remove( app ); |
54 | } | 70 | } |
diff --git a/libopie2/opiepim/core/opimrecord.cpp b/libopie2/opiepim/core/opimrecord.cpp index e510f4e..88b6fde 100644 --- a/libopie2/opiepim/core/opimrecord.cpp +++ b/libopie2/opiepim/core/opimrecord.cpp | |||
@@ -1,54 +1,70 @@ | |||
1 | #include <qpe/categories.h> | ||
2 | #include <qpe/categoryselect.h> | ||
3 | |||
1 | #include "opimrecord.h" | 4 | #include "opimrecord.h" |
2 | 5 | ||
3 | OPimRecord::OPimRecord( int uid ) | 6 | OPimRecord::OPimRecord( int uid ) |
4 | : Qtopia::Record() { | 7 | : Qtopia::Record() { |
5 | 8 | ||
6 | setUid( uid ); | 9 | setUid( uid ); |
7 | } | 10 | } |
8 | OPimRecord::~OPimRecord() { | 11 | OPimRecord::~OPimRecord() { |
9 | } | 12 | } |
10 | OPimRecord::OPimRecord( const OPimRecord& rec ) | 13 | OPimRecord::OPimRecord( const OPimRecord& rec ) |
11 | : Qtopia::Record( rec ) | 14 | : Qtopia::Record( rec ) |
12 | { | 15 | { |
13 | (*this) = rec; | 16 | (*this) = rec; |
14 | } | 17 | } |
15 | 18 | ||
16 | OPimRecord &OPimRecord::operator=( const OPimRecord& rec) { | 19 | OPimRecord &OPimRecord::operator=( const OPimRecord& rec) { |
17 | Qtopia::Record::operator=( rec ); | 20 | Qtopia::Record::operator=( rec ); |
18 | m_relations = rec.m_relations; | 21 | m_relations = rec.m_relations; |
19 | 22 | ||
20 | return *this; | 23 | return *this; |
21 | } | 24 | } |
25 | /* | ||
26 | * category names | ||
27 | */ | ||
22 | QStringList OPimRecord::categoryNames()const { | 28 | QStringList OPimRecord::categoryNames()const { |
23 | QStringList list; | 29 | QStringList list; |
30 | QArray<int> cats = categories(); | ||
31 | Categories catDB; | ||
32 | catDB.load( categoryFileName() ); | ||
33 | |||
34 | for (uint i = 0; i < cats.count(); i++ ) { | ||
35 | list << catDB.label("Todo List", cats[i] ); | ||
36 | } | ||
24 | 37 | ||
25 | return list; | 38 | return list; |
26 | } | 39 | } |
27 | void OPimRecord::setCategoryNames( const QStringList& ) { | 40 | void OPimRecord::setCategoryNames( const QStringList& ) { |
28 | 41 | ||
29 | } | 42 | } |
30 | void OPimRecord::addCategoryName( const QString& ) { | 43 | void OPimRecord::addCategoryName( const QString& ) { |
44 | Categories catDB; | ||
45 | catDB.load( categoryFileName() ); | ||
46 | |||
31 | 47 | ||
32 | } | 48 | } |
33 | bool OPimRecord::isEmpty()const { | 49 | bool OPimRecord::isEmpty()const { |
34 | return ( uid() == 0 ); | 50 | return ( uid() == 0 ); |
35 | } | 51 | } |
36 | QStringList OPimRecord::relatedApps()const{ | 52 | QStringList OPimRecord::relatedApps()const{ |
37 | QStringList list; | 53 | QStringList list; |
38 | QMap<QString, QArray<int> >::ConstIterator it; | 54 | QMap<QString, QArray<int> >::ConstIterator it; |
39 | for ( it = m_relations.begin(); it != m_relations.end(); ++it ) { | 55 | for ( it = m_relations.begin(); it != m_relations.end(); ++it ) { |
40 | list << it.key(); | 56 | list << it.key(); |
41 | } | 57 | } |
42 | return list; | 58 | return list; |
43 | } | 59 | } |
44 | QArray<int> OPimRecord::relations(const QString& app )const { | 60 | QArray<int> OPimRecord::relations(const QString& app )const { |
45 | QArray<int> tmp; | 61 | QArray<int> tmp; |
46 | QMap<QString, QArray<int> >::ConstIterator it; | 62 | QMap<QString, QArray<int> >::ConstIterator it; |
47 | it = m_relations.find( app); | 63 | it = m_relations.find( app); |
48 | if ( it != m_relations.end() ) | 64 | if ( it != m_relations.end() ) |
49 | tmp = it.data(); | 65 | tmp = it.data(); |
50 | return tmp; | 66 | return tmp; |
51 | } | 67 | } |
52 | void OPimRecord::clearRelation( const QString& app ) { | 68 | void OPimRecord::clearRelation( const QString& app ) { |
53 | m_relations.remove( app ); | 69 | m_relations.remove( app ); |
54 | } | 70 | } |