-rw-r--r-- | libopie/pim/opimrecord.cpp | 63 |
1 files changed, 6 insertions, 57 deletions
diff --git a/libopie/pim/opimrecord.cpp b/libopie/pim/opimrecord.cpp index 21cf131..0e3be9d 100644 --- a/libopie/pim/opimrecord.cpp +++ b/libopie/pim/opimrecord.cpp | |||
@@ -23,3 +23,3 @@ OPimRecord &OPimRecord::operator=( const OPimRecord& rec) { | |||
23 | Qtopia::Record::operator=( rec ); | 23 | Qtopia::Record::operator=( rec ); |
24 | m_relations = rec.m_relations; | 24 | m_xrefman = rec.m_xrefman; |
25 | 25 | ||
@@ -54,57 +54,3 @@ bool OPimRecord::isEmpty()const { | |||
54 | } | 54 | } |
55 | QStringList OPimRecord::relatedApps()const{ | 55 | /*QString OPimRecord::crossToString()const { |
56 | QStringList list; | ||
57 | QMap<QString, QArray<int> >::ConstIterator it; | ||
58 | for ( it = m_relations.begin(); it != m_relations.end(); ++it ) { | ||
59 | list << it.key(); | ||
60 | } | ||
61 | return list; | ||
62 | } | ||
63 | QArray<int> OPimRecord::relations(const QString& app )const { | ||
64 | QArray<int> tmp; | ||
65 | QMap<QString, QArray<int> >::ConstIterator it; | ||
66 | it = m_relations.find( app); | ||
67 | if ( it != m_relations.end() ) | ||
68 | tmp = it.data(); | ||
69 | return tmp; | ||
70 | } | ||
71 | void OPimRecord::clearRelation( const QString& app ) { | ||
72 | m_relations.remove( app ); | ||
73 | } | ||
74 | void OPimRecord::addRelation( const QString& app, int id ) { | ||
75 | |||
76 | QMap<QString, QArray<int> >::Iterator it; | ||
77 | QArray<int> tmp; | ||
78 | |||
79 | it = m_relations.find( app ); | ||
80 | if ( it == m_relations.end() ) { | ||
81 | tmp.resize(1 ); | ||
82 | tmp[0] = id; | ||
83 | }else{ | ||
84 | tmp = it.data(); | ||
85 | tmp.resize( tmp.size() + 1 ); | ||
86 | tmp[tmp.size() - 1] = id; | ||
87 | } | ||
88 | m_relations.replace( app, tmp ); | ||
89 | } | ||
90 | void OPimRecord::setRelations( const QString& app, QArray<int> ids ) { | ||
91 | |||
92 | QMap<QString, QArray<int> >::Iterator it; | ||
93 | QArray<int> tmp; | ||
94 | |||
95 | it = m_relations.find( app); | ||
96 | if ( it == m_relations.end() ) { | ||
97 | tmp = ids; | ||
98 | }else{ | ||
99 | tmp = it.data(); | ||
100 | int offset = tmp.size()-1; | ||
101 | tmp.resize( tmp.size() + ids.size() ); | ||
102 | for (uint i = 0; i < ids.size(); i++ ) { | ||
103 | tmp[offset+i] = ids[i]; | ||
104 | } | ||
105 | |||
106 | } | ||
107 | m_relations.replace( app, tmp ); | ||
108 | } | ||
109 | QString OPimRecord::crossToString()const { | ||
110 | QString str; | 56 | QString str; |
@@ -121,3 +67,3 @@ QString OPimRecord::crossToString()const { | |||
121 | return str; | 67 | return str; |
122 | } | 68 | }*/ |
123 | /* if uid = 1 assign a new one */ | 69 | /* if uid = 1 assign a new one */ |
@@ -132 +78,4 @@ Qtopia::UidGen &OPimRecord::uidGen() { | |||
132 | } | 78 | } |
79 | OPimXRefManager &OPimRecord::xrefmanager() { | ||
80 | return m_xrefman; | ||
81 | } | ||