summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/core/opimxref.cpp
Unidiff
Diffstat (limited to 'libopie2/opiepim/core/opimxref.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiepim/core/opimxref.cpp34
1 files changed, 33 insertions, 1 deletions
diff --git a/libopie2/opiepim/core/opimxref.cpp b/libopie2/opiepim/core/opimxref.cpp
index 8eefbd8..85d3345 100644
--- a/libopie2/opiepim/core/opimxref.cpp
+++ b/libopie2/opiepim/core/opimxref.cpp
@@ -1,47 +1,79 @@
1#include "opimxref.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/opimxref.h>
30
31namespace Opie {
2 32
3OPimXRef::OPimXRef( const OPimXRefPartner& one, const OPimXRefPartner& two ) 33OPimXRef::OPimXRef( const OPimXRefPartner& one, const OPimXRefPartner& two )
4 : m_partners(2) 34 : m_partners(2)
5{ 35{
6 m_partners[0] = one; 36 m_partners[0] = one;
7 m_partners[1] = two; 37 m_partners[1] = two;
8} 38}
9OPimXRef::OPimXRef() 39OPimXRef::OPimXRef()
10 : m_partners(2) 40 : m_partners(2)
11{ 41{
12 42
13} 43}
14OPimXRef::OPimXRef( const OPimXRef& ref) { 44OPimXRef::OPimXRef( const OPimXRef& ref) {
15 *this = ref; 45 *this = ref;
16} 46}
17OPimXRef::~OPimXRef() { 47OPimXRef::~OPimXRef() {
18} 48}
19OPimXRef &OPimXRef::operator=( const OPimXRef& ref) { 49OPimXRef &OPimXRef::operator=( const OPimXRef& ref) {
20 m_partners = ref.m_partners; 50 m_partners = ref.m_partners;
21 m_partners.detach(); 51 m_partners.detach();
22 52
23 return* this; 53 return* this;
24} 54}
25bool OPimXRef::operator==( const OPimXRef& oper ) { 55bool OPimXRef::operator==( const OPimXRef& oper ) {
26 if ( m_partners == oper.m_partners ) return true; 56 if ( m_partners == oper.m_partners ) return true;
27 57
28 return false; 58 return false;
29} 59}
30OPimXRefPartner OPimXRef::partner( enum Partners par) const{ 60OPimXRefPartner OPimXRef::partner( enum Partners par) const{
31 return m_partners[par]; 61 return m_partners[par];
32} 62}
33void OPimXRef::setPartner( enum Partners par, const OPimXRefPartner& part) { 63void OPimXRef::setPartner( enum Partners par, const OPimXRefPartner& part) {
34 m_partners[par] = part; 64 m_partners[par] = part;
35} 65}
36bool OPimXRef::containsString( const QString& string ) const{ 66bool OPimXRef::containsString( const QString& string ) const{
37 if ( m_partners[One].service() == string || 67 if ( m_partners[One].service() == string ||
38 m_partners[Two].service() == string ) return true; 68 m_partners[Two].service() == string ) return true;
39 69
40 return false; 70 return false;
41} 71}
42bool OPimXRef::containsUid( int uid ) const{ 72bool OPimXRef::containsUid( int uid ) const{
43 if ( m_partners[One].uid() == uid || 73 if ( m_partners[One].uid() == uid ||
44 m_partners[Two].uid() == uid ) return true; 74 m_partners[Two].uid() == uid ) return true;
45 75
46 return false; 76 return false;
47} 77}
78
79}