summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/core/opimxrefmanager.cpp
Unidiff
Diffstat (limited to 'libopie2/opiepim/core/opimxrefmanager.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiepim/core/opimxrefmanager.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/libopie2/opiepim/core/opimxrefmanager.cpp b/libopie2/opiepim/core/opimxrefmanager.cpp
index bf6fed6..e7c6c5a 100644
--- a/libopie2/opiepim/core/opimxrefmanager.cpp
+++ b/libopie2/opiepim/core/opimxrefmanager.cpp
@@ -23,45 +23,54 @@
23 -_. . . )=. = Library General Public License along with 23 -_. . . )=. = Library General Public License along with
24 -- :-=` this library; see the file COPYING.LIB. 24 -- :-=` this library; see the file COPYING.LIB.
25 If not, write to the Free Software Foundation, 25 If not, write to the Free Software Foundation,
26 Inc., 59 Temple Place - Suite 330, 26 Inc., 59 Temple Place - Suite 330,
27 Boston, MA 02111-1307, USA. 27 Boston, MA 02111-1307, USA.
28*/ 28*/
29#include <opie2/opimxrefmanager.h> 29#include "opimxrefmanager.h"
30 30
31namespace Opie { 31namespace Opie {
32 32
33OPimXRefManager::OPimXRefManager() { 33OPimXRefManager::OPimXRefManager() {
34} 34}
35
35OPimXRefManager::OPimXRefManager( const OPimXRefManager& ref) { 36OPimXRefManager::OPimXRefManager( const OPimXRefManager& ref) {
36 m_list = ref.m_list; 37 m_list = ref.m_list;
37} 38}
39
38OPimXRefManager::~OPimXRefManager() { 40OPimXRefManager::~OPimXRefManager() {
39} 41}
42
40OPimXRefManager &OPimXRefManager::operator=( const OPimXRefManager& ref) { 43OPimXRefManager &OPimXRefManager::operator=( const OPimXRefManager& ref) {
41 m_list = ref.m_list; 44 m_list = ref.m_list;
42 return *this; 45 return *this;
43} 46}
47
44bool OPimXRefManager::operator==( const OPimXRefManager& /*ref*/) { 48bool OPimXRefManager::operator==( const OPimXRefManager& /*ref*/) {
45 // if ( m_list == ref.m_list ) return true; 49 // if ( m_list == ref.m_list ) return true;
46 50
47 return false; 51 return false;
48} 52}
53
49void OPimXRefManager::add( const OPimXRef& ref) { 54void OPimXRefManager::add( const OPimXRef& ref) {
50 m_list.append( ref ); 55 m_list.append( ref );
51} 56}
57
52void OPimXRefManager::remove( const OPimXRef& ref) { 58void OPimXRefManager::remove( const OPimXRef& ref) {
53 m_list.remove( ref ); 59 m_list.remove( ref );
54} 60}
61
55void OPimXRefManager::replace( const OPimXRef& ref) { 62void OPimXRefManager::replace( const OPimXRef& ref) {
56 m_list.remove( ref ); 63 m_list.remove( ref );
57 m_list.append( ref ); 64 m_list.append( ref );
58} 65}
66
59void OPimXRefManager::clear() { 67void OPimXRefManager::clear() {
60 m_list.clear(); 68 m_list.clear();
61} 69}
70
62QStringList OPimXRefManager::apps()const { 71QStringList OPimXRefManager::apps()const {
63 OPimXRef::ValueList::ConstIterator it; 72 OPimXRef::ValueList::ConstIterator it;
64 QStringList list; 73 QStringList list;
65 74
66 QString str; 75 QString str;
67 for ( it = m_list.begin(); it != m_list.end(); ++it ) { 76 for ( it = m_list.begin(); it != m_list.end(); ++it ) {
@@ -70,26 +79,29 @@ QStringList OPimXRefManager::apps()const {
70 79
71 str = (*it).partner( OPimXRef::Two ).service(); 80 str = (*it).partner( OPimXRef::Two ).service();
72 if ( !list.contains( str ) ) list << str; 81 if ( !list.contains( str ) ) list << str;
73 } 82 }
74 return list; 83 return list;
75} 84}
85
76OPimXRef::ValueList OPimXRefManager::list()const { 86OPimXRef::ValueList OPimXRefManager::list()const {
77 return m_list; 87 return m_list;
78} 88}
89
79OPimXRef::ValueList OPimXRefManager::list( const QString& appName )const{ 90OPimXRef::ValueList OPimXRefManager::list( const QString& appName )const{
80 OPimXRef::ValueList list; 91 OPimXRef::ValueList list;
81 OPimXRef::ValueList::ConstIterator it; 92 OPimXRef::ValueList::ConstIterator it;
82 93
83 for ( it = m_list.begin(); it != m_list.end(); ++it ) { 94 for ( it = m_list.begin(); it != m_list.end(); ++it ) {
84 if ( (*it).containsString( appName ) ) 95 if ( (*it).containsString( appName ) )
85 list.append( (*it) ); 96 list.append( (*it) );
86 } 97 }
87 98
88 return list; 99 return list;
89} 100}
101
90OPimXRef::ValueList OPimXRefManager::list( int uid )const { 102OPimXRef::ValueList OPimXRefManager::list( int uid )const {
91 OPimXRef::ValueList list; 103 OPimXRef::ValueList list;
92 OPimXRef::ValueList::ConstIterator it; 104 OPimXRef::ValueList::ConstIterator it;
93 105
94 for ( it = m_list.begin(); it != m_list.end(); ++it ) { 106 for ( it = m_list.begin(); it != m_list.end(); ++it ) {
95 if ( (*it).containsUid( uid ) ) 107 if ( (*it).containsUid( uid ) )