summaryrefslogtreecommitdiffabout
path: root/kabc/distributionlist.cpp
authorMichael Krelin <hacker@klever.net>2007-07-04 11:23:42 (UTC)
committer Michael Krelin <hacker@klever.net>2007-07-04 11:23:42 (UTC)
commita08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (unidiff)
tree8ee90d686081c52e7c69b5ce946e9b1a7d690001 /kabc/distributionlist.cpp
parent11edc920afe4f274c0964436633aa632c8288a40 (diff)
downloadkdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.zip
kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.gz
kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.bz2
initial public commit of qt4 portp1
Diffstat (limited to 'kabc/distributionlist.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/distributionlist.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/kabc/distributionlist.cpp b/kabc/distributionlist.cpp
index d34ba0b..cf5afa6 100644
--- a/kabc/distributionlist.cpp
+++ b/kabc/distributionlist.cpp
@@ -14,24 +14,26 @@
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21#include <ksimpleconfig.h> 21#include <ksimpleconfig.h>
22#include <kstandarddirs.h> 22#include <kstandarddirs.h>
23#include <kdebug.h> 23#include <kdebug.h>
24 24
25#include "distributionlist.h" 25#include "distributionlist.h"
26//Added by qt3to4:
27#include <Q3ValueList>
26 28
27using namespace KABC; 29using namespace KABC;
28 30
29DistributionList::DistributionList( DistributionListManager *manager, 31DistributionList::DistributionList( DistributionListManager *manager,
30 const QString &name ) : 32 const QString &name ) :
31 mManager( manager ), mName( name ) 33 mManager( manager ), mName( name )
32{ 34{
33 mManager->insert( this ); 35 mManager->insert( this );
34} 36}
35 37
36DistributionList::~DistributionList() 38DistributionList::~DistributionList()
37{ 39{
@@ -45,45 +47,45 @@ void DistributionList::setName( const QString &name )
45 47
46QString DistributionList::name() const 48QString DistributionList::name() const
47{ 49{
48 return mName; 50 return mName;
49} 51}
50 52
51void DistributionList::insertEntry( const Addressee &a, const QString &email ) 53void DistributionList::insertEntry( const Addressee &a, const QString &email )
52{ 54{
53 QString em = email; 55 QString em = email;
54 if (em.isNull() ) 56 if (em.isNull() )
55 em = a.preferredEmail(); 57 em = a.preferredEmail();
56 Entry e( a, em ); 58 Entry e( a, em );
57 QValueList<Entry>::Iterator it; 59 Q3ValueList<Entry>::Iterator it;
58 for( it = mEntries.begin(); it != mEntries.end(); ++it ) { 60 for( it = mEntries.begin(); it != mEntries.end(); ++it ) {
59 if ( (*it).addressee.uid() == a.uid() ) { 61 if ( (*it).addressee.uid() == a.uid() ) {
60 /** 62 /**
61 We have to check if both email addresses contains no data, 63 We have to check if both email addresses contains no data,
62 a simple 'email1 == email2' wont work here 64 a simple 'email1 == email2' wont work here
63 */ 65 */
64 if ( ( (*it).email.isNull() && em.isEmpty() ) || 66 if ( ( (*it).email.isNull() && em.isEmpty() ) ||
65 ( (*it).email.isEmpty() && em.isNull() ) || 67 ( (*it).email.isEmpty() && em.isNull() ) ||
66 ( (*it).email == em ) ) { 68 ( (*it).email == em ) ) {
67 //*it = e; 69 //*it = e;
68 return; 70 return;
69 } 71 }
70 } 72 }
71 } 73 }
72 mEntries.append( e ); 74 mEntries.append( e );
73} 75}
74 76
75void DistributionList::removeEntry( const Addressee &a, const QString &email ) 77void DistributionList::removeEntry( const Addressee &a, const QString &email )
76{ 78{
77 QValueList<Entry>::Iterator it; 79 Q3ValueList<Entry>::Iterator it;
78 for( it = mEntries.begin(); it != mEntries.end(); ++it ) { 80 for( it = mEntries.begin(); it != mEntries.end(); ++it ) {
79 if ( (*it).addressee.uid() == a.uid() && (*it).email == email ) { 81 if ( (*it).addressee.uid() == a.uid() && (*it).email == email ) {
80 mEntries.remove( it ); 82 mEntries.remove( it );
81 return; 83 return;
82 } 84 }
83 } 85 }
84} 86}
85 87
86QStringList DistributionList::emails() const 88QStringList DistributionList::emails() const
87{ 89{
88 QStringList emails; 90 QStringList emails;
89 91