author | ulf69 <ulf69> | 2004-08-10 22:45:28 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-08-10 22:45:28 (UTC) |
commit | dc81e96e29f619c6eb32c3ed18ff45b789c8504e (patch) (unidiff) | |
tree | d38533c6630ec6246abbb6c726ae3da0605021a7 | |
parent | 9542b37886f0f70049696c2b65382b1d68caeff0 (diff) | |
download | kdepimpi-dc81e96e29f619c6eb32c3ed18ff45b789c8504e.zip kdepimpi-dc81e96e29f619c6eb32c3ed18ff45b789c8504e.tar.gz kdepimpi-dc81e96e29f619c6eb32c3ed18ff45b789c8504e.tar.bz2 |
enabled the collecting of emailadresses for the purpouse of sending emails
-rw-r--r-- | kaddressbook/kaddressbookview.cpp | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/kaddressbook/kaddressbookview.cpp b/kaddressbook/kaddressbookview.cpp index a44fd82..da28870 100644 --- a/kaddressbook/kaddressbookview.cpp +++ b/kaddressbook/kaddressbookview.cpp | |||
@@ -24,24 +24,25 @@ | |||
24 | #ifndef KAB_EMBEDDED | 24 | #ifndef KAB_EMBEDDED |
25 | #include <qapplication.h> | 25 | #include <qapplication.h> |
26 | 26 | ||
27 | #include <kabc/distributionlistdialog.h> | 27 | #include <kabc/distributionlistdialog.h> |
28 | #include <kconfig.h> | 28 | #include <kconfig.h> |
29 | #include <klocale.h> | 29 | #include <klocale.h> |
30 | 30 | ||
31 | #include "viewmanager.h" | 31 | #include "viewmanager.h" |
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" |
40 | 41 | ||
41 | KAddressBookView::KAddressBookView( KABC::AddressBook *ab, QWidget *parent, | 42 | KAddressBookView::KAddressBookView( KABC::AddressBook *ab, QWidget *parent, |
42 | const char *name ) | 43 | const char *name ) |
43 | : QWidget( parent, name ), mAddressBook( ab ), mFieldList() | 44 | : QWidget( parent, name ), mAddressBook( ab ), mFieldList() |
44 | { | 45 | { |
45 | initGUI(); | 46 | initGUI(); |
46 | } | 47 | } |
47 | 48 | ||
@@ -60,26 +61,24 @@ void KAddressBookView::readConfig( KConfig *config ) | |||
60 | 61 | ||
61 | mDefaultFilterType = (DefaultFilterType)config->readNumEntry( "DefaultFilterType", 1 ); | 62 | mDefaultFilterType = (DefaultFilterType)config->readNumEntry( "DefaultFilterType", 1 ); |
62 | mDefaultFilterName = config->readEntry( "DefaultFilterName", QString::null ); | 63 | mDefaultFilterName = config->readEntry( "DefaultFilterName", QString::null ); |
63 | } | 64 | } |
64 | 65 | ||
65 | void KAddressBookView::writeConfig( KConfig* ) | 66 | void KAddressBookView::writeConfig( KConfig* ) |
66 | { | 67 | { |
67 | // Most of writing the config is handled by the ConfigureViewDialog | 68 | // Most of writing the config is handled by the ConfigureViewDialog |
68 | } | 69 | } |
69 | 70 | ||
70 | QString KAddressBookView::selectedEmails() | 71 | QString 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; |
@@ -90,29 +89,24 @@ QString KAddressBookView::selectedEmails() | |||
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 | ||
103 | qDebug("KAddressBookView::selectedEmails() update method"); | ||
104 | return 0; | ||
105 | #endif //KAB_EMBEDDED | ||
106 | |||
107 | } | 101 | } |
108 | 102 | ||
109 | KABC::Addressee::List KAddressBookView::addressees() | 103 | KABC::Addressee::List KAddressBookView::addressees() |
110 | { | 104 | { |
111 | KABC::Addressee::List addresseeList; | 105 | KABC::Addressee::List addresseeList; |
112 | 106 | ||
113 | KABC::AddressBook::Iterator it; | 107 | KABC::AddressBook::Iterator it; |
114 | for (it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { | 108 | for (it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { |
115 | if ( mFilter.filterAddressee( *it ) ) | 109 | if ( mFilter.filterAddressee( *it ) ) |
116 | addresseeList.append( *it ); | 110 | addresseeList.append( *it ); |
117 | } | 111 | } |
118 | 112 | ||