summaryrefslogtreecommitdiff
authorzecke <zecke>2002-11-15 15:31:47 (UTC)
committer zecke <zecke>2002-11-15 15:31:47 (UTC)
commit5a6e66edad1070f624d54320278d00372f112213 (patch) (side-by-side diff)
treeab1028759194edace4c79cf90d18dc1362a84aa9
parent05f56fbbbe9ea5546f7503f4852fcab9c5b10a00 (diff)
downloadopie-5a6e66edad1070f624d54320278d00372f112213.zip
opie-5a6e66edad1070f624d54320278d00372f112213.tar.gz
opie-5a6e66edad1070f624d54320278d00372f112213.tar.bz2
Add the implementation for the XRef Manager
Add it to libopie.pro Adjust OPimRecord to use the new manager The backends do not support xref yet
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/libopie.pro6
-rw-r--r--libopie/pim/opimrecord.cpp63
-rw-r--r--libopie/pim/opimrecord.h33
-rw-r--r--libopie/pim/opimxref.cpp47
-rw-r--r--libopie/pim/opimxref.h7
-rw-r--r--libopie/pim/opimxrefmanager.cpp69
-rw-r--r--libopie/pim/opimxrefmanager.h5
-rw-r--r--libopie/pim/opimxrefpartner.cpp43
-rw-r--r--libopie/pim/otodoaccessxml.cpp18
-rw-r--r--libopie2/opiepim/backend/otodoaccessxml.cpp18
-rw-r--r--libopie2/opiepim/core/opimrecord.cpp63
-rw-r--r--libopie2/opiepim/core/opimrecord.h33
-rw-r--r--libopie2/opiepim/core/opimxref.cpp47
-rw-r--r--libopie2/opiepim/core/opimxref.h7
-rw-r--r--libopie2/opiepim/core/opimxrefmanager.cpp69
-rw-r--r--libopie2/opiepim/core/opimxrefmanager.h5
-rw-r--r--libopie2/opiepim/core/opimxrefpartner.cpp43
17 files changed, 374 insertions, 202 deletions
diff --git a/libopie/libopie.pro b/libopie/libopie.pro
index 79d15bb..3e6156e 100644
--- a/libopie/libopie.pro
+++ b/libopie/libopie.pro
@@ -30,2 +30,5 @@ HEADERS = ofontmenu.h \
pim/opimstate.h \
+ pim/opimxrefpartner.h \
+ pim/opimxref.h \
+ pim/opimxrefmanager.h \
orecurrancewidget.h \
@@ -56,2 +59,5 @@ SOURCES = ofontmenu.cc \
pim/opimstate.cpp \
+ pim/opimxrefpartner.cpp \
+ pim/opimxref.cpp \
+ pim/opimxrefmanager.cpp \
orecurrancewidget.cpp \
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) {
Qtopia::Record::operator=( rec );
- m_relations = rec.m_relations;
+ m_xrefman = rec.m_xrefman;
@@ -54,57 +54,3 @@ bool OPimRecord::isEmpty()const {
}
-QStringList OPimRecord::relatedApps()const{
- QStringList list;
- QMap<QString, QArray<int> >::ConstIterator it;
- for ( it = m_relations.begin(); it != m_relations.end(); ++it ) {
- list << it.key();
- }
- return list;
-}
-QArray<int> OPimRecord::relations(const QString& app )const {
- QArray<int> tmp;
- QMap<QString, QArray<int> >::ConstIterator it;
- it = m_relations.find( app);
- if ( it != m_relations.end() )
- tmp = it.data();
- return tmp;
-}
-void OPimRecord::clearRelation( const QString& app ) {
- m_relations.remove( app );
-}
-void OPimRecord::addRelation( const QString& app, int id ) {
-
- QMap<QString, QArray<int> >::Iterator it;
- QArray<int> tmp;
-
- it = m_relations.find( app );
- if ( it == m_relations.end() ) {
- tmp.resize(1 );
- tmp[0] = id;
- }else{
- tmp = it.data();
- tmp.resize( tmp.size() + 1 );
- tmp[tmp.size() - 1] = id;
- }
- m_relations.replace( app, tmp );
-}
-void OPimRecord::setRelations( const QString& app, QArray<int> ids ) {
-
- QMap<QString, QArray<int> >::Iterator it;
- QArray<int> tmp;
-
- it = m_relations.find( app);
- if ( it == m_relations.end() ) {
- tmp = ids;
- }else{
- tmp = it.data();
- int offset = tmp.size()-1;
- tmp.resize( tmp.size() + ids.size() );
- for (uint i = 0; i < ids.size(); i++ ) {
- tmp[offset+i] = ids[i];
- }
-
- }
- m_relations.replace( app, tmp );
-}
-QString OPimRecord::crossToString()const {
+/*QString OPimRecord::crossToString()const {
QString str;
@@ -121,3 +67,3 @@ QString OPimRecord::crossToString()const {
return str;
-}
+ }*/
/* if uid = 1 assign a new one */
@@ -132 +78,4 @@ Qtopia::UidGen &OPimRecord::uidGen() {
}
+OPimXRefManager &OPimRecord::xrefmanager() {
+ return m_xrefman;
+}
diff --git a/libopie/pim/opimrecord.h b/libopie/pim/opimrecord.h
index d9ccad4..1642a5e 100644
--- a/libopie/pim/opimrecord.h
+++ b/libopie/pim/opimrecord.h
@@ -9,2 +9,3 @@
+#include <opie/opimxrefmanager.h>
@@ -88,26 +89,8 @@ public:
/**
- * the related apps names
+ * returns a reference of the
+ * Cross Reference Manager
+ * Partner One is THIS PIM RECORD!
+ * Two is the Partner where we link to
*/
- QStringList relatedApps()const;
-
- /**
- * the realtions between an app
- */
- QArray<int> relations( const QString& app )const;
-
- /**
- * clear the relations for all relations
- * with app
- */
- void clearRelation( const QString& app );
-
- /**
- * add a relation
- */
- void addRelation( const QString& app, int id );
-
- /**
- * set the relations for an app
- */
- void setRelations( const QString&, QArray<int> ids );
+ OPimXRefManager& xrefmanager();
@@ -120,3 +103,3 @@ protected:
Qtopia::UidGen &uidGen();
- QString crossToString()const;
+// QString crossToString()const;
@@ -125,3 +108,3 @@ private:
OPimRecordPrivate *d;
- QMap<QString, QArray<int> > m_relations;
+ OPimXRefManager m_xrefman;
static Qtopia::UidGen m_uidGen;
diff --git a/libopie/pim/opimxref.cpp b/libopie/pim/opimxref.cpp
new file mode 100644
index 0000000..5cae871
--- a/dev/null
+++ b/libopie/pim/opimxref.cpp
@@ -0,0 +1,47 @@
+#include "opimxref.h"
+
+OPimXRef::OPimXRef( const OPimXRefPartner& one, const OPimXRefPartner& two )
+ : m_partners(2)
+{
+ m_partners[0] = one;
+ m_partners[1] = two;
+}
+OPimXRef::OPimXRef()
+ : m_partners(2)
+{
+
+}
+OPimXRef::OPimXRef( const OPimXRef& ref) {
+ *this = ref;
+}
+OPimXRef::~OPimXRef() {
+}
+OPimXRef &OPimXRef::operator=( const OPimXRef& ref) {
+ m_partners = ref.m_partners;
+ m_partners.detach();
+
+ return* this;
+}
+bool OPimXRef::operator==( const OPimXRef& oper ) {
+ if ( m_partners == oper.m_partners ) return true;
+
+ return false;
+}
+OPimXRefPartner OPimXRef::partner( enum Partners par) const{
+ return m_partners[par];
+}
+void OPimXRef::setPartner( enum Partners par, const OPimXRefPartner& part) {
+ m_partners[par] = part;
+}
+bool OPimXRef::containsString( const QString& string ) const{
+ if ( m_partners[One].appName() == string ||
+ m_partners[Two].appName() == string ) return true;
+
+ return false;
+}
+bool OPimXRef::containsUid( int uid ) const{
+ if ( m_partners[One].uid() == uid ||
+ m_partners[Two].uid() == uid ) return true;
+
+ return false;
+}
diff --git a/libopie/pim/opimxref.h b/libopie/pim/opimxref.h
index 72154ac..354739a 100644
--- a/libopie/pim/opimxref.h
+++ b/libopie/pim/opimxref.h
@@ -22,5 +22,5 @@ public:
OPimXRef &operator=( const OPimXRef& );
- bool operator==( const OPimXRef );
+ bool operator==( const OPimXRef& );
- OPimXRefPartner partner( enum Partners );
+ OPimXRefPartner partner( enum Partners )const;
@@ -28,2 +28,5 @@ public:
+ bool containsString( const QString& appName)const;
+ bool containsUid( int uid )const;
+
private:
diff --git a/libopie/pim/opimxrefmanager.cpp b/libopie/pim/opimxrefmanager.cpp
new file mode 100644
index 0000000..d49f5f5
--- a/dev/null
+++ b/libopie/pim/opimxrefmanager.cpp
@@ -0,0 +1,69 @@
+#include "opimxrefmanager.h"
+
+
+OPimXRefManager::OPimXRefManager() {
+}
+OPimXRefManager::OPimXRefManager( const OPimXRefManager& ref) {
+ m_list = ref.m_list;
+}
+OPimXRefManager &OPimXRefManager::operator=( const OPimXRefManager& ref) {
+ m_list = ref.m_list;
+ return *this;
+}
+bool OPimXRefManager::operator==( const OPimXRefManager& /*ref*/) {
+ // if ( m_list == ref.m_list ) return true;
+
+ return false;
+}
+void OPimXRefManager::add( const OPimXRef& ref) {
+ m_list.append( ref );
+}
+void OPimXRefManager::remove( const OPimXRef& ref) {
+ m_list.remove( ref );
+}
+void OPimXRefManager::replace( const OPimXRef& ref) {
+ m_list.remove( ref );
+ m_list.append( ref );
+}
+void OPimXRefManager::clear() {
+ m_list.clear();
+}
+QStringList OPimXRefManager::apps()const {
+ OPimXRef::ValueList::ConstIterator it;
+ QStringList list;
+
+ QString str;
+ for ( it = m_list.begin(); it != m_list.end(); ++it ) {
+ str = (*it).partner( OPimXRef::One ).appName();
+ if ( !list.contains( str ) ) list << str;
+
+ str = (*it).partner( OPimXRef::Two ).appName();
+ if ( !list.contains( str ) ) list << str;
+ }
+ return list;
+}
+OPimXRef::ValueList OPimXRefManager::list()const {
+ return m_list;
+}
+OPimXRef::ValueList OPimXRefManager::list( const QString& appName )const{
+ OPimXRef::ValueList list;
+ OPimXRef::ValueList::ConstIterator it;
+
+ for ( it = m_list.begin(); it != m_list.end(); ++it ) {
+ if ( (*it).containsString( appName ) )
+ list.append( (*it) );
+ }
+
+ return list;
+}
+OPimXRef::ValueList OPimXRefManager::list( int uid )const {
+ OPimXRef::ValueList list;
+ OPimXRef::ValueList::ConstIterator it;
+
+ for ( it = m_list.begin(); it != m_list.end(); ++it ) {
+ if ( (*it).containsUid( uid ) )
+ list.append( (*it) );
+ }
+
+ return list;
+}
diff --git a/libopie/pim/opimxrefmanager.h b/libopie/pim/opimxrefmanager.h
index 147895d..9b003a3 100644
--- a/libopie/pim/opimxrefmanager.h
+++ b/libopie/pim/opimxrefmanager.h
@@ -3,2 +3,4 @@
+#include <qstringlist.h>
+
#include <opie/opimxref.h>
@@ -33,2 +35,5 @@ public:
OPimXRef::ValueList list( int uid )const;
+
+private:
+ OPimXRef::ValueList m_list;
};
diff --git a/libopie/pim/opimxrefpartner.cpp b/libopie/pim/opimxrefpartner.cpp
new file mode 100644
index 0000000..028f4e6
--- a/dev/null
+++ b/libopie/pim/opimxrefpartner.cpp
@@ -0,0 +1,43 @@
+#include "opimxrefpartner.h"
+
+OPimXRefPartner::OPimXRefPartner( const QString& appName,
+ int uid, int field )
+ : m_app(appName), m_uid(uid), m_field( field ) {
+}
+OPimXRefPartner::OPimXRefPartner( const OPimXRefPartner& ref ) {
+ *this = ref;
+}
+OPimXRefPartner::~OPimXRefPartner() {
+}
+OPimXRefPartner &OPimXRefPartner::operator=( const OPimXRefPartner& par ) {
+ m_app = par.m_app;
+ m_uid = par.m_uid;
+ m_field = par.m_field;
+
+ return *this;
+}
+bool OPimXRefPartner::operator==( const OPimXRefPartner& par ) {
+ if ( m_app != par.m_app ) return false;
+ if ( m_uid != par.m_uid ) return false;
+ if ( m_field != par.m_field ) return false;
+
+ return true;
+}
+QString OPimXRefPartner::appName()const {
+ return m_app;
+}
+int OPimXRefPartner::uid()const {
+ return m_uid;
+}
+int OPimXRefPartner::field()const {
+ return m_field;
+}
+void OPimXRefPartner::setAppName( const QString& appName ) {
+ m_app = appName;
+}
+void OPimXRefPartner::setUid( int uid ) {
+ m_uid = uid;
+}
+void OPimXRefPartner::setField( int field ) {
+ m_field = field;
+}
diff --git a/libopie/pim/otodoaccessxml.cpp b/libopie/pim/otodoaccessxml.cpp
index 591e467..c1682c6 100644
--- a/libopie/pim/otodoaccessxml.cpp
+++ b/libopie/pim/otodoaccessxml.cpp
@@ -333,3 +333,3 @@ void OTodoAccessXML::todo( QAsciiDict<int>* dict, OTodo& ev,
if ( pos > -1 )
- ev.addRelation( (*strIt).left(pos), (*strIt).mid(pos+1).toInt() );
+ ; // ev.addRelation( (*strIt).left(pos), (*strIt).mid(pos+1).toInt() );
@@ -384,18 +384,2 @@ QString OTodoAccessXML::toString( const OTodo& ev )const {
// cross refernce
- QStringList list = ev.relatedApps();
- QStringList::Iterator listIt;
- QString refs;
- str += "CrossReference=\"";
- bool added = false;
- for ( listIt = list.begin(); listIt != list.end(); ++listIt ) {
- added = true;
- QArray<int> ints = ev.relations( (*listIt) );
- for ( uint i = 0; i< ints.count(); i++ ) {
- str += (*listIt) + "," + QString::number( i ) + ";";
- }
- }
- if ( added )
- str = str.remove( str.length()-1, 1 );
-
- str += "\" ";
diff --git a/libopie2/opiepim/backend/otodoaccessxml.cpp b/libopie2/opiepim/backend/otodoaccessxml.cpp
index 591e467..c1682c6 100644
--- a/libopie2/opiepim/backend/otodoaccessxml.cpp
+++ b/libopie2/opiepim/backend/otodoaccessxml.cpp
@@ -333,3 +333,3 @@ void OTodoAccessXML::todo( QAsciiDict<int>* dict, OTodo& ev,
if ( pos > -1 )
- ev.addRelation( (*strIt).left(pos), (*strIt).mid(pos+1).toInt() );
+ ; // ev.addRelation( (*strIt).left(pos), (*strIt).mid(pos+1).toInt() );
@@ -384,18 +384,2 @@ QString OTodoAccessXML::toString( const OTodo& ev )const {
// cross refernce
- QStringList list = ev.relatedApps();
- QStringList::Iterator listIt;
- QString refs;
- str += "CrossReference=\"";
- bool added = false;
- for ( listIt = list.begin(); listIt != list.end(); ++listIt ) {
- added = true;
- QArray<int> ints = ev.relations( (*listIt) );
- for ( uint i = 0; i< ints.count(); i++ ) {
- str += (*listIt) + "," + QString::number( i ) + ";";
- }
- }
- if ( added )
- str = str.remove( str.length()-1, 1 );
-
- str += "\" ";
diff --git a/libopie2/opiepim/core/opimrecord.cpp b/libopie2/opiepim/core/opimrecord.cpp
index 21cf131..0e3be9d 100644
--- a/libopie2/opiepim/core/opimrecord.cpp
+++ b/libopie2/opiepim/core/opimrecord.cpp
@@ -23,3 +23,3 @@ OPimRecord &OPimRecord::operator=( const OPimRecord& rec) {
Qtopia::Record::operator=( rec );
- m_relations = rec.m_relations;
+ m_xrefman = rec.m_xrefman;
@@ -54,57 +54,3 @@ bool OPimRecord::isEmpty()const {
}
-QStringList OPimRecord::relatedApps()const{
- QStringList list;
- QMap<QString, QArray<int> >::ConstIterator it;
- for ( it = m_relations.begin(); it != m_relations.end(); ++it ) {
- list << it.key();
- }
- return list;
-}
-QArray<int> OPimRecord::relations(const QString& app )const {
- QArray<int> tmp;
- QMap<QString, QArray<int> >::ConstIterator it;
- it = m_relations.find( app);
- if ( it != m_relations.end() )
- tmp = it.data();
- return tmp;
-}
-void OPimRecord::clearRelation( const QString& app ) {
- m_relations.remove( app );
-}
-void OPimRecord::addRelation( const QString& app, int id ) {
-
- QMap<QString, QArray<int> >::Iterator it;
- QArray<int> tmp;
-
- it = m_relations.find( app );
- if ( it == m_relations.end() ) {
- tmp.resize(1 );
- tmp[0] = id;
- }else{
- tmp = it.data();
- tmp.resize( tmp.size() + 1 );
- tmp[tmp.size() - 1] = id;
- }
- m_relations.replace( app, tmp );
-}
-void OPimRecord::setRelations( const QString& app, QArray<int> ids ) {
-
- QMap<QString, QArray<int> >::Iterator it;
- QArray<int> tmp;
-
- it = m_relations.find( app);
- if ( it == m_relations.end() ) {
- tmp = ids;
- }else{
- tmp = it.data();
- int offset = tmp.size()-1;
- tmp.resize( tmp.size() + ids.size() );
- for (uint i = 0; i < ids.size(); i++ ) {
- tmp[offset+i] = ids[i];
- }
-
- }
- m_relations.replace( app, tmp );
-}
-QString OPimRecord::crossToString()const {
+/*QString OPimRecord::crossToString()const {
QString str;
@@ -121,3 +67,3 @@ QString OPimRecord::crossToString()const {
return str;
-}
+ }*/
/* if uid = 1 assign a new one */
@@ -132 +78,4 @@ Qtopia::UidGen &OPimRecord::uidGen() {
}
+OPimXRefManager &OPimRecord::xrefmanager() {
+ return m_xrefman;
+}
diff --git a/libopie2/opiepim/core/opimrecord.h b/libopie2/opiepim/core/opimrecord.h
index d9ccad4..1642a5e 100644
--- a/libopie2/opiepim/core/opimrecord.h
+++ b/libopie2/opiepim/core/opimrecord.h
@@ -9,2 +9,3 @@
+#include <opie/opimxrefmanager.h>
@@ -88,26 +89,8 @@ public:
/**
- * the related apps names
+ * returns a reference of the
+ * Cross Reference Manager
+ * Partner One is THIS PIM RECORD!
+ * Two is the Partner where we link to
*/
- QStringList relatedApps()const;
-
- /**
- * the realtions between an app
- */
- QArray<int> relations( const QString& app )const;
-
- /**
- * clear the relations for all relations
- * with app
- */
- void clearRelation( const QString& app );
-
- /**
- * add a relation
- */
- void addRelation( const QString& app, int id );
-
- /**
- * set the relations for an app
- */
- void setRelations( const QString&, QArray<int> ids );
+ OPimXRefManager& xrefmanager();
@@ -120,3 +103,3 @@ protected:
Qtopia::UidGen &uidGen();
- QString crossToString()const;
+// QString crossToString()const;
@@ -125,3 +108,3 @@ private:
OPimRecordPrivate *d;
- QMap<QString, QArray<int> > m_relations;
+ OPimXRefManager m_xrefman;
static Qtopia::UidGen m_uidGen;
diff --git a/libopie2/opiepim/core/opimxref.cpp b/libopie2/opiepim/core/opimxref.cpp
new file mode 100644
index 0000000..5cae871
--- a/dev/null
+++ b/libopie2/opiepim/core/opimxref.cpp
@@ -0,0 +1,47 @@
+#include "opimxref.h"
+
+OPimXRef::OPimXRef( const OPimXRefPartner& one, const OPimXRefPartner& two )
+ : m_partners(2)
+{
+ m_partners[0] = one;
+ m_partners[1] = two;
+}
+OPimXRef::OPimXRef()
+ : m_partners(2)
+{
+
+}
+OPimXRef::OPimXRef( const OPimXRef& ref) {
+ *this = ref;
+}
+OPimXRef::~OPimXRef() {
+}
+OPimXRef &OPimXRef::operator=( const OPimXRef& ref) {
+ m_partners = ref.m_partners;
+ m_partners.detach();
+
+ return* this;
+}
+bool OPimXRef::operator==( const OPimXRef& oper ) {
+ if ( m_partners == oper.m_partners ) return true;
+
+ return false;
+}
+OPimXRefPartner OPimXRef::partner( enum Partners par) const{
+ return m_partners[par];
+}
+void OPimXRef::setPartner( enum Partners par, const OPimXRefPartner& part) {
+ m_partners[par] = part;
+}
+bool OPimXRef::containsString( const QString& string ) const{
+ if ( m_partners[One].appName() == string ||
+ m_partners[Two].appName() == string ) return true;
+
+ return false;
+}
+bool OPimXRef::containsUid( int uid ) const{
+ if ( m_partners[One].uid() == uid ||
+ m_partners[Two].uid() == uid ) return true;
+
+ return false;
+}
diff --git a/libopie2/opiepim/core/opimxref.h b/libopie2/opiepim/core/opimxref.h
index 72154ac..354739a 100644
--- a/libopie2/opiepim/core/opimxref.h
+++ b/libopie2/opiepim/core/opimxref.h
@@ -22,5 +22,5 @@ public:
OPimXRef &operator=( const OPimXRef& );
- bool operator==( const OPimXRef );
+ bool operator==( const OPimXRef& );
- OPimXRefPartner partner( enum Partners );
+ OPimXRefPartner partner( enum Partners )const;
@@ -28,2 +28,5 @@ public:
+ bool containsString( const QString& appName)const;
+ bool containsUid( int uid )const;
+
private:
diff --git a/libopie2/opiepim/core/opimxrefmanager.cpp b/libopie2/opiepim/core/opimxrefmanager.cpp
new file mode 100644
index 0000000..d49f5f5
--- a/dev/null
+++ b/libopie2/opiepim/core/opimxrefmanager.cpp
@@ -0,0 +1,69 @@
+#include "opimxrefmanager.h"
+
+
+OPimXRefManager::OPimXRefManager() {
+}
+OPimXRefManager::OPimXRefManager( const OPimXRefManager& ref) {
+ m_list = ref.m_list;
+}
+OPimXRefManager &OPimXRefManager::operator=( const OPimXRefManager& ref) {
+ m_list = ref.m_list;
+ return *this;
+}
+bool OPimXRefManager::operator==( const OPimXRefManager& /*ref*/) {
+ // if ( m_list == ref.m_list ) return true;
+
+ return false;
+}
+void OPimXRefManager::add( const OPimXRef& ref) {
+ m_list.append( ref );
+}
+void OPimXRefManager::remove( const OPimXRef& ref) {
+ m_list.remove( ref );
+}
+void OPimXRefManager::replace( const OPimXRef& ref) {
+ m_list.remove( ref );
+ m_list.append( ref );
+}
+void OPimXRefManager::clear() {
+ m_list.clear();
+}
+QStringList OPimXRefManager::apps()const {
+ OPimXRef::ValueList::ConstIterator it;
+ QStringList list;
+
+ QString str;
+ for ( it = m_list.begin(); it != m_list.end(); ++it ) {
+ str = (*it).partner( OPimXRef::One ).appName();
+ if ( !list.contains( str ) ) list << str;
+
+ str = (*it).partner( OPimXRef::Two ).appName();
+ if ( !list.contains( str ) ) list << str;
+ }
+ return list;
+}
+OPimXRef::ValueList OPimXRefManager::list()const {
+ return m_list;
+}
+OPimXRef::ValueList OPimXRefManager::list( const QString& appName )const{
+ OPimXRef::ValueList list;
+ OPimXRef::ValueList::ConstIterator it;
+
+ for ( it = m_list.begin(); it != m_list.end(); ++it ) {
+ if ( (*it).containsString( appName ) )
+ list.append( (*it) );
+ }
+
+ return list;
+}
+OPimXRef::ValueList OPimXRefManager::list( int uid )const {
+ OPimXRef::ValueList list;
+ OPimXRef::ValueList::ConstIterator it;
+
+ for ( it = m_list.begin(); it != m_list.end(); ++it ) {
+ if ( (*it).containsUid( uid ) )
+ list.append( (*it) );
+ }
+
+ return list;
+}
diff --git a/libopie2/opiepim/core/opimxrefmanager.h b/libopie2/opiepim/core/opimxrefmanager.h
index 147895d..9b003a3 100644
--- a/libopie2/opiepim/core/opimxrefmanager.h
+++ b/libopie2/opiepim/core/opimxrefmanager.h
@@ -3,2 +3,4 @@
+#include <qstringlist.h>
+
#include <opie/opimxref.h>
@@ -33,2 +35,5 @@ public:
OPimXRef::ValueList list( int uid )const;
+
+private:
+ OPimXRef::ValueList m_list;
};
diff --git a/libopie2/opiepim/core/opimxrefpartner.cpp b/libopie2/opiepim/core/opimxrefpartner.cpp
new file mode 100644
index 0000000..028f4e6
--- a/dev/null
+++ b/libopie2/opiepim/core/opimxrefpartner.cpp
@@ -0,0 +1,43 @@
+#include "opimxrefpartner.h"
+
+OPimXRefPartner::OPimXRefPartner( const QString& appName,
+ int uid, int field )
+ : m_app(appName), m_uid(uid), m_field( field ) {
+}
+OPimXRefPartner::OPimXRefPartner( const OPimXRefPartner& ref ) {
+ *this = ref;
+}
+OPimXRefPartner::~OPimXRefPartner() {
+}
+OPimXRefPartner &OPimXRefPartner::operator=( const OPimXRefPartner& par ) {
+ m_app = par.m_app;
+ m_uid = par.m_uid;
+ m_field = par.m_field;
+
+ return *this;
+}
+bool OPimXRefPartner::operator==( const OPimXRefPartner& par ) {
+ if ( m_app != par.m_app ) return false;
+ if ( m_uid != par.m_uid ) return false;
+ if ( m_field != par.m_field ) return false;
+
+ return true;
+}
+QString OPimXRefPartner::appName()const {
+ return m_app;
+}
+int OPimXRefPartner::uid()const {
+ return m_uid;
+}
+int OPimXRefPartner::field()const {
+ return m_field;
+}
+void OPimXRefPartner::setAppName( const QString& appName ) {
+ m_app = appName;
+}
+void OPimXRefPartner::setUid( int uid ) {
+ m_uid = uid;
+}
+void OPimXRefPartner::setField( int field ) {
+ m_field = field;
+}