summaryrefslogtreecommitdiff
path: root/libopie/pim/opimxrefmanager.cpp
authorzecke <zecke>2002-11-15 15:31:47 (UTC)
committer zecke <zecke>2002-11-15 15:31:47 (UTC)
commit5a6e66edad1070f624d54320278d00372f112213 (patch) (unidiff)
treeab1028759194edace4c79cf90d18dc1362a84aa9 /libopie/pim/opimxrefmanager.cpp
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 (limited to 'libopie/pim/opimxrefmanager.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/pim/opimxrefmanager.cpp69
1 files changed, 69 insertions, 0 deletions
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 @@
1#include "opimxrefmanager.h"
2
3
4OPimXRefManager::OPimXRefManager() {
5}
6OPimXRefManager::OPimXRefManager( const OPimXRefManager& ref) {
7 m_list = ref.m_list;
8}
9OPimXRefManager &OPimXRefManager::operator=( const OPimXRefManager& ref) {
10 m_list = ref.m_list;
11 return *this;
12}
13bool OPimXRefManager::operator==( const OPimXRefManager& /*ref*/) {
14 // if ( m_list == ref.m_list ) return true;
15
16 return false;
17}
18void OPimXRefManager::add( const OPimXRef& ref) {
19 m_list.append( ref );
20}
21void OPimXRefManager::remove( const OPimXRef& ref) {
22 m_list.remove( ref );
23}
24void OPimXRefManager::replace( const OPimXRef& ref) {
25 m_list.remove( ref );
26 m_list.append( ref );
27}
28void OPimXRefManager::clear() {
29 m_list.clear();
30}
31QStringList OPimXRefManager::apps()const {
32 OPimXRef::ValueList::ConstIterator it;
33 QStringList list;
34
35 QString str;
36 for ( it = m_list.begin(); it != m_list.end(); ++it ) {
37 str = (*it).partner( OPimXRef::One ).appName();
38 if ( !list.contains( str ) ) list << str;
39
40 str = (*it).partner( OPimXRef::Two ).appName();
41 if ( !list.contains( str ) ) list << str;
42 }
43 return list;
44}
45OPimXRef::ValueList OPimXRefManager::list()const {
46 return m_list;
47}
48OPimXRef::ValueList OPimXRefManager::list( const QString& appName )const{
49 OPimXRef::ValueList list;
50 OPimXRef::ValueList::ConstIterator it;
51
52 for ( it = m_list.begin(); it != m_list.end(); ++it ) {
53 if ( (*it).containsString( appName ) )
54 list.append( (*it) );
55 }
56
57 return list;
58}
59OPimXRef::ValueList OPimXRefManager::list( int uid )const {
60 OPimXRef::ValueList list;
61 OPimXRef::ValueList::ConstIterator it;
62
63 for ( it = m_list.begin(); it != m_list.end(); ++it ) {
64 if ( (*it).containsUid( uid ) )
65 list.append( (*it) );
66 }
67
68 return list;
69}