Diffstat (limited to 'libopie2/opiepim/core/opimxrefmanager.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie2/opiepim/core/opimxrefmanager.cpp | 14 |
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 | |||
@@ -21,77 +21,89 @@ | |||
21 | : = ...= . :.=- | 21 | : = ...= . :.=- |
22 | -. .:....=;==+<; You should have received a copy of the GNU | 22 | -. .:....=;==+<; You should have received a copy of the GNU |
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 | ||
31 | namespace Opie { | 31 | namespace Opie { |
32 | 32 | ||
33 | OPimXRefManager::OPimXRefManager() { | 33 | OPimXRefManager::OPimXRefManager() { |
34 | } | 34 | } |
35 | |||
35 | OPimXRefManager::OPimXRefManager( const OPimXRefManager& ref) { | 36 | OPimXRefManager::OPimXRefManager( const OPimXRefManager& ref) { |
36 | m_list = ref.m_list; | 37 | m_list = ref.m_list; |
37 | } | 38 | } |
39 | |||
38 | OPimXRefManager::~OPimXRefManager() { | 40 | OPimXRefManager::~OPimXRefManager() { |
39 | } | 41 | } |
42 | |||
40 | OPimXRefManager &OPimXRefManager::operator=( const OPimXRefManager& ref) { | 43 | OPimXRefManager &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 | |||
44 | bool OPimXRefManager::operator==( const OPimXRefManager& /*ref*/) { | 48 | bool 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 | |||
49 | void OPimXRefManager::add( const OPimXRef& ref) { | 54 | void OPimXRefManager::add( const OPimXRef& ref) { |
50 | m_list.append( ref ); | 55 | m_list.append( ref ); |
51 | } | 56 | } |
57 | |||
52 | void OPimXRefManager::remove( const OPimXRef& ref) { | 58 | void OPimXRefManager::remove( const OPimXRef& ref) { |
53 | m_list.remove( ref ); | 59 | m_list.remove( ref ); |
54 | } | 60 | } |
61 | |||
55 | void OPimXRefManager::replace( const OPimXRef& ref) { | 62 | void 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 | |||
59 | void OPimXRefManager::clear() { | 67 | void OPimXRefManager::clear() { |
60 | m_list.clear(); | 68 | m_list.clear(); |
61 | } | 69 | } |
70 | |||
62 | QStringList OPimXRefManager::apps()const { | 71 | QStringList 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 ) { |
68 | str = (*it).partner( OPimXRef::One ).service(); | 77 | str = (*it).partner( OPimXRef::One ).service(); |
69 | if ( !list.contains( str ) ) list << str; | 78 | if ( !list.contains( str ) ) list << str; |
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 | |||
76 | OPimXRef::ValueList OPimXRefManager::list()const { | 86 | OPimXRef::ValueList OPimXRefManager::list()const { |
77 | return m_list; | 87 | return m_list; |
78 | } | 88 | } |
89 | |||
79 | OPimXRef::ValueList OPimXRefManager::list( const QString& appName )const{ | 90 | OPimXRef::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 | |||
90 | OPimXRef::ValueList OPimXRefManager::list( int uid )const { | 102 | OPimXRef::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 ) ) |
96 | list.append( (*it) ); | 108 | list.append( (*it) ); |
97 | } | 109 | } |