summaryrefslogtreecommitdiffabout
path: root/kaddressbook/kaddressbookview.cpp
authorulf69 <ulf69>2004-08-10 22:45:28 (UTC)
committer ulf69 <ulf69>2004-08-10 22:45:28 (UTC)
commitdc81e96e29f619c6eb32c3ed18ff45b789c8504e (patch) (unidiff)
treed38533c6630ec6246abbb6c726ae3da0605021a7 /kaddressbook/kaddressbookview.cpp
parent9542b37886f0f70049696c2b65382b1d68caeff0 (diff)
downloadkdepimpi-dc81e96e29f619c6eb32c3ed18ff45b789c8504e.zip
kdepimpi-dc81e96e29f619c6eb32c3ed18ff45b789c8504e.tar.gz
kdepimpi-dc81e96e29f619c6eb32c3ed18ff45b789c8504e.tar.bz2
enabled the collecting of emailadresses for the purpouse of sending emails
Diffstat (limited to 'kaddressbook/kaddressbookview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kaddressbookview.cpp58
1 files changed, 26 insertions, 32 deletions
diff --git a/kaddressbook/kaddressbookview.cpp b/kaddressbook/kaddressbookview.cpp
index a44fd82..da28870 100644
--- a/kaddressbook/kaddressbookview.cpp
+++ b/kaddressbook/kaddressbookview.cpp
@@ -1,26 +1,26 @@
1/* 1/*
2 This file is part of KAddressBook. 2 This file is part of KAddressBook.
3 Copyright (c) 2002 Mike Pilone <mpilone@slac.com> 3 Copyright (c) 2002 Mike Pilone <mpilone@slac.com>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#ifndef KAB_EMBEDDED 24#ifndef KAB_EMBEDDED
25#include <qapplication.h> 25#include <qapplication.h>
26 26
@@ -32,8 +32,9 @@
32 32
33#endif //KAB_EMBEDDED 33#endif //KAB_EMBEDDED
34#include <qlayout.h> 34#include <qlayout.h>
35 35
36#include <kabc/distributionlistdialog.h>
36#include <kabc/addressbook.h> 37#include <kabc/addressbook.h>
37#include <kdebug.h> 38#include <kdebug.h>
38 39
39#include "kaddressbookview.h" 40#include "kaddressbookview.h"
@@ -68,43 +69,36 @@ void KAddressBookView::writeConfig( KConfig* )
68} 69}
69 70
70QString KAddressBookView::selectedEmails() 71QString KAddressBookView::selectedEmails()
71{ 72{
72#ifndef KAB_EMBEDDED
73
74 bool first = true; 73 bool first = true;
75 QString emailAddrs; 74 QString emailAddrs;
76 QStringList uidList = selectedUids(); 75 QStringList uidList = selectedUids();
77 KABC::Addressee addr; 76 KABC::Addressee addr;
78 QString email; 77 QString email;
79 78
80 QStringList::Iterator it; 79 QStringList::Iterator it;
81 for ( it = uidList.begin(); it != uidList.end(); ++it ) { 80 for ( it = uidList.begin(); it != uidList.end(); ++it ) {
82 addr = mAddressBook->findByUid( *it ); 81 addr = mAddressBook->findByUid( *it );
83 82
84 if ( !addr.isEmpty() ) { 83 if ( !addr.isEmpty() ) {
85 QString m = QString::null; 84 QString m = QString::null;
86 85
87 if ( addr.emails().count() > 1 ) 86 if ( addr.emails().count() > 1 )
88 m = KABC::EmailSelector::getEmail( addr.emails(), addr.preferredEmail(), this ); 87 m = KABC::EmailSelector::getEmail( addr.emails(), addr.preferredEmail(), this );
89 88
90 email = addr.fullEmail( m ); 89 email = addr.fullEmail( m );
91 90
92 if ( !first ) 91 if ( !first )
93 emailAddrs += ", "; 92 emailAddrs += ", ";
94 else 93 else
95 first = false; 94 first = false;
96 95
97 emailAddrs += email; 96 emailAddrs += email;
98 } 97 }
99 } 98 }
100 99
101 return emailAddrs; 100 return emailAddrs;
102#else //KAB_EMBEDDED
103qDebug("KAddressBookView::selectedEmails() update method");
104return 0;
105#endif //KAB_EMBEDDED
106
107} 101}
108 102
109KABC::Addressee::List KAddressBookView::addressees() 103KABC::Addressee::List KAddressBookView::addressees()
110{ 104{
@@ -122,9 +116,9 @@ KABC::Addressee::List KAddressBookView::addressees()
122void KAddressBookView::initGUI() 116void KAddressBookView::initGUI()
123{ 117{
124 // Create the layout 118 // Create the layout
125 QVBoxLayout *layout = new QVBoxLayout( this ); 119 QVBoxLayout *layout = new QVBoxLayout( this );
126 120
127 // Add the view widget 121 // Add the view widget
128 mViewWidget = new QWidget( this ); 122 mViewWidget = new QWidget( this );
129 layout->addWidget( mViewWidget ); 123 layout->addWidget( mViewWidget );
130} 124}
@@ -147,9 +141,9 @@ KAddressBookView::DefaultFilterType KAddressBookView::defaultFilterType() const
147const QString &KAddressBookView::defaultFilterName() const 141const QString &KAddressBookView::defaultFilterName() const
148{ 142{
149 return mDefaultFilterName; 143 return mDefaultFilterName;
150} 144}
151 145
152KABC::AddressBook *KAddressBookView::addressBook() const 146KABC::AddressBook *KAddressBookView::addressBook() const
153{ 147{
154 return mAddressBook; 148 return mAddressBook;
155} 149}