summaryrefslogtreecommitdiff
path: root/noncore/unsupported/libopie/pim/opimxrefmanager.cpp
authormickeyl <mickeyl>2004-11-16 19:14:18 (UTC)
committer mickeyl <mickeyl>2004-11-16 19:14:18 (UTC)
commitea3945a9bd8f9830f70b1efa133f9df13b19362f (patch) (unidiff)
treef2ea22cc50e9aa8aa73ee7dea148f41c563c9666 /noncore/unsupported/libopie/pim/opimxrefmanager.cpp
parent1c6f490e8541626f68422e0a3a7c7281d7f5b7d3 (diff)
downloadopie-ea3945a9bd8f9830f70b1efa133f9df13b19362f.zip
opie-ea3945a9bd8f9830f70b1efa133f9df13b19362f.tar.gz
opie-ea3945a9bd8f9830f70b1efa133f9df13b19362f.tar.bz2
libopie1 goes into unsupported
Diffstat (limited to 'noncore/unsupported/libopie/pim/opimxrefmanager.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/unsupported/libopie/pim/opimxrefmanager.cpp71
1 files changed, 71 insertions, 0 deletions
diff --git a/noncore/unsupported/libopie/pim/opimxrefmanager.cpp b/noncore/unsupported/libopie/pim/opimxrefmanager.cpp
new file mode 100644
index 0000000..58bfd24
--- a/dev/null
+++ b/noncore/unsupported/libopie/pim/opimxrefmanager.cpp
@@ -0,0 +1,71 @@
1#include "opimxrefmanager.h"
2
3
4OPimXRefManager::OPimXRefManager() {
5}
6OPimXRefManager::OPimXRefManager( const OPimXRefManager& ref) {
7 m_list = ref.m_list;
8}
9OPimXRefManager::~OPimXRefManager() {
10}
11OPimXRefManager &OPimXRefManager::operator=( const OPimXRefManager& ref) {
12 m_list = ref.m_list;
13 return *this;
14}
15bool OPimXRefManager::operator==( const OPimXRefManager& /*ref*/) {
16 // if ( m_list == ref.m_list ) return true;
17
18 return false;
19}
20void OPimXRefManager::add( const OPimXRef& ref) {
21 m_list.append( ref );
22}
23void OPimXRefManager::remove( const OPimXRef& ref) {
24 m_list.remove( ref );
25}
26void OPimXRefManager::replace( const OPimXRef& ref) {
27 m_list.remove( ref );
28 m_list.append( ref );
29}
30void OPimXRefManager::clear() {
31 m_list.clear();
32}
33QStringList OPimXRefManager::apps()const {
34 OPimXRef::ValueList::ConstIterator it;
35 QStringList list;
36
37 QString str;
38 for ( it = m_list.begin(); it != m_list.end(); ++it ) {
39 str = (*it).partner( OPimXRef::One ).service();
40 if ( !list.contains( str ) ) list << str;
41
42 str = (*it).partner( OPimXRef::Two ).service();
43 if ( !list.contains( str ) ) list << str;
44 }
45 return list;
46}
47OPimXRef::ValueList OPimXRefManager::list()const {
48 return m_list;
49}
50OPimXRef::ValueList OPimXRefManager::list( const QString& appName )const{
51 OPimXRef::ValueList list;
52 OPimXRef::ValueList::ConstIterator it;
53
54 for ( it = m_list.begin(); it != m_list.end(); ++it ) {
55 if ( (*it).containsString( appName ) )
56 list.append( (*it) );
57 }
58
59 return list;
60}
61OPimXRef::ValueList OPimXRefManager::list( int uid )const {
62 OPimXRef::ValueList list;
63 OPimXRef::ValueList::ConstIterator it;
64
65 for ( it = m_list.begin(); it != m_list.end(); ++it ) {
66 if ( (*it).containsUid( uid ) )
67 list.append( (*it) );
68 }
69
70 return list;
71}