author | alwin <alwin> | 2004-02-20 02:06:52 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-02-20 02:06:52 (UTC) |
commit | 55f4d502486e01927356908223622e435c975f7e (patch) (unidiff) | |
tree | 824b5c1e8992564677c4f39473bc108a32a2cf2a /libopie2/opiepim/core/opimxrefmanager.cpp | |
parent | 060b4fc7a3fd5c1b5f745167fe084f7486719b7e (diff) | |
download | opie-55f4d502486e01927356908223622e435c975f7e.zip opie-55f4d502486e01927356908223622e435c975f7e.tar.gz opie-55f4d502486e01927356908223622e435c975f7e.tar.bz2 |
moved the opie pim stuff to libopie2 - pim. Tried to resort them, may be someone should take a look for a better file order. but now all applications can start using libopiepim2 instead of libopie1-pim-stuff.
Diffstat (limited to 'libopie2/opiepim/core/opimxrefmanager.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiepim/core/opimxrefmanager.cpp | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/libopie2/opiepim/core/opimxrefmanager.cpp b/libopie2/opiepim/core/opimxrefmanager.cpp index 58bfd24..bf6fed6 100644 --- a/libopie2/opiepim/core/opimxrefmanager.cpp +++ b/libopie2/opiepim/core/opimxrefmanager.cpp | |||
@@ -1,71 +1,102 @@ | |||
1 | #include "opimxrefmanager.h" | 1 | /* |
2 | This file is part of the Opie Project | ||
3 | Copyright (C) The Main Author <main-author@whereever.org> | ||
4 | =. Copyright (C) The Opie Team <opie-devel@handhelds.org> | ||
5 | .=l. | ||
6 | .>+-= | ||
7 | _;:, .> :=|. This program is free software; you can | ||
8 | .> <`_, > . <= redistribute it and/or modify it under | ||
9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | ||
10 | .="- .-=="i, .._ License as published by the Free Software | ||
11 | - . .-<_> .<> Foundation; either version 2 of the License, | ||
12 | ._= =} : or (at your option) any later version. | ||
13 | .%`+i> _;_. | ||
14 | .i_,=:_. -<s. This program is distributed in the hope that | ||
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
16 | : .. .:, . . . without even the implied warranty of | ||
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | ||
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | ||
19 | ..}^=.= = ; Library General Public License for more | ||
20 | ++= -. .` .: details. | ||
21 | : = ...= . :.=- | ||
22 | -. .:....=;==+<; You should have received a copy of the GNU | ||
23 | -_. . . )=. = Library General Public License along with | ||
24 | -- :-=` this library; see the file COPYING.LIB. | ||
25 | If not, write to the Free Software Foundation, | ||
26 | Inc., 59 Temple Place - Suite 330, | ||
27 | Boston, MA 02111-1307, USA. | ||
28 | */ | ||
29 | #include <opie2/opimxrefmanager.h> | ||
2 | 30 | ||
31 | namespace Opie { | ||
3 | 32 | ||
4 | OPimXRefManager::OPimXRefManager() { | 33 | OPimXRefManager::OPimXRefManager() { |
5 | } | 34 | } |
6 | OPimXRefManager::OPimXRefManager( const OPimXRefManager& ref) { | 35 | OPimXRefManager::OPimXRefManager( const OPimXRefManager& ref) { |
7 | m_list = ref.m_list; | 36 | m_list = ref.m_list; |
8 | } | 37 | } |
9 | OPimXRefManager::~OPimXRefManager() { | 38 | OPimXRefManager::~OPimXRefManager() { |
10 | } | 39 | } |
11 | OPimXRefManager &OPimXRefManager::operator=( const OPimXRefManager& ref) { | 40 | OPimXRefManager &OPimXRefManager::operator=( const OPimXRefManager& ref) { |
12 | m_list = ref.m_list; | 41 | m_list = ref.m_list; |
13 | return *this; | 42 | return *this; |
14 | } | 43 | } |
15 | bool OPimXRefManager::operator==( const OPimXRefManager& /*ref*/) { | 44 | bool OPimXRefManager::operator==( const OPimXRefManager& /*ref*/) { |
16 | // if ( m_list == ref.m_list ) return true; | 45 | // if ( m_list == ref.m_list ) return true; |
17 | 46 | ||
18 | return false; | 47 | return false; |
19 | } | 48 | } |
20 | void OPimXRefManager::add( const OPimXRef& ref) { | 49 | void OPimXRefManager::add( const OPimXRef& ref) { |
21 | m_list.append( ref ); | 50 | m_list.append( ref ); |
22 | } | 51 | } |
23 | void OPimXRefManager::remove( const OPimXRef& ref) { | 52 | void OPimXRefManager::remove( const OPimXRef& ref) { |
24 | m_list.remove( ref ); | 53 | m_list.remove( ref ); |
25 | } | 54 | } |
26 | void OPimXRefManager::replace( const OPimXRef& ref) { | 55 | void OPimXRefManager::replace( const OPimXRef& ref) { |
27 | m_list.remove( ref ); | 56 | m_list.remove( ref ); |
28 | m_list.append( ref ); | 57 | m_list.append( ref ); |
29 | } | 58 | } |
30 | void OPimXRefManager::clear() { | 59 | void OPimXRefManager::clear() { |
31 | m_list.clear(); | 60 | m_list.clear(); |
32 | } | 61 | } |
33 | QStringList OPimXRefManager::apps()const { | 62 | QStringList OPimXRefManager::apps()const { |
34 | OPimXRef::ValueList::ConstIterator it; | 63 | OPimXRef::ValueList::ConstIterator it; |
35 | QStringList list; | 64 | QStringList list; |
36 | 65 | ||
37 | QString str; | 66 | QString str; |
38 | for ( it = m_list.begin(); it != m_list.end(); ++it ) { | 67 | for ( it = m_list.begin(); it != m_list.end(); ++it ) { |
39 | str = (*it).partner( OPimXRef::One ).service(); | 68 | str = (*it).partner( OPimXRef::One ).service(); |
40 | if ( !list.contains( str ) ) list << str; | 69 | if ( !list.contains( str ) ) list << str; |
41 | 70 | ||
42 | str = (*it).partner( OPimXRef::Two ).service(); | 71 | str = (*it).partner( OPimXRef::Two ).service(); |
43 | if ( !list.contains( str ) ) list << str; | 72 | if ( !list.contains( str ) ) list << str; |
44 | } | 73 | } |
45 | return list; | 74 | return list; |
46 | } | 75 | } |
47 | OPimXRef::ValueList OPimXRefManager::list()const { | 76 | OPimXRef::ValueList OPimXRefManager::list()const { |
48 | return m_list; | 77 | return m_list; |
49 | } | 78 | } |
50 | OPimXRef::ValueList OPimXRefManager::list( const QString& appName )const{ | 79 | OPimXRef::ValueList OPimXRefManager::list( const QString& appName )const{ |
51 | OPimXRef::ValueList list; | 80 | OPimXRef::ValueList list; |
52 | OPimXRef::ValueList::ConstIterator it; | 81 | OPimXRef::ValueList::ConstIterator it; |
53 | 82 | ||
54 | for ( it = m_list.begin(); it != m_list.end(); ++it ) { | 83 | for ( it = m_list.begin(); it != m_list.end(); ++it ) { |
55 | if ( (*it).containsString( appName ) ) | 84 | if ( (*it).containsString( appName ) ) |
56 | list.append( (*it) ); | 85 | list.append( (*it) ); |
57 | } | 86 | } |
58 | 87 | ||
59 | return list; | 88 | return list; |
60 | } | 89 | } |
61 | OPimXRef::ValueList OPimXRefManager::list( int uid )const { | 90 | OPimXRef::ValueList OPimXRefManager::list( int uid )const { |
62 | OPimXRef::ValueList list; | 91 | OPimXRef::ValueList list; |
63 | OPimXRef::ValueList::ConstIterator it; | 92 | OPimXRef::ValueList::ConstIterator it; |
64 | 93 | ||
65 | for ( it = m_list.begin(); it != m_list.end(); ++it ) { | 94 | for ( it = m_list.begin(); it != m_list.end(); ++it ) { |
66 | if ( (*it).containsUid( uid ) ) | 95 | if ( (*it).containsUid( uid ) ) |
67 | list.append( (*it) ); | 96 | list.append( (*it) ); |
68 | } | 97 | } |
69 | 98 | ||
70 | return list; | 99 | return list; |
71 | } | 100 | } |
101 | |||
102 | } | ||