Diffstat (limited to 'noncore/net/mail/addresspicker.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/mail/addresspicker.cpp | 54 |
1 files changed, 34 insertions, 20 deletions
diff --git a/noncore/net/mail/addresspicker.cpp b/noncore/net/mail/addresspicker.cpp index f4f4cea..8cdabde 100644 --- a/noncore/net/mail/addresspicker.cpp +++ b/noncore/net/mail/addresspicker.cpp | |||
@@ -1 +1,11 @@ | |||
1 | |||
2 | #include "composemail.h" | ||
3 | |||
4 | /* OPIE */ | ||
5 | #include <opie2/ocontactaccess.h> | ||
6 | #include <opie2/ocontact.h> | ||
7 | #include <qpe/resource.h> | ||
8 | #include <qpe/qpeapplication.h> | ||
9 | |||
10 | /* QT */ | ||
1 | #include <qpushbutton.h> | 11 | #include <qpushbutton.h> |
@@ -6,11 +16,5 @@ | |||
6 | 16 | ||
7 | #include <qpe/resource.h> | 17 | /* STD */ |
8 | #include <opie2/ocontactaccess.h> | ||
9 | #include <opie2/ocontact.h> | ||
10 | |||
11 | |||
12 | #include <stdlib.h> | 18 | #include <stdlib.h> |
13 | 19 | ||
14 | #include "composemail.h" | ||
15 | |||
16 | AddressPicker::AddressPicker( QWidget *parent, const char *name, bool modal, WFlags flags ) | 20 | AddressPicker::AddressPicker( QWidget *parent, const char *name, bool modal, WFlags flags ) |
@@ -32,9 +36,14 @@ AddressPicker::AddressPicker( QWidget *parent, const char *name, bool modal, WFl | |||
32 | Opie::OContactAccess::List m_list = m_contactdb.sorted( true, 0, 0, 0 ); | 36 | Opie::OContactAccess::List m_list = m_contactdb.sorted( true, 0, 0, 0 ); |
33 | for ( it = m_list.begin(); it != m_list.end(); ++it ) { | 37 | for ( it = m_list.begin(); it != m_list.end(); ++it ) |
34 | if ((*it).defaultEmail().length()!=0) { | 38 | { |
39 | if ((*it).defaultEmail().length()!=0) | ||
40 | { | ||
35 | mails = (*it).emailList(); | 41 | mails = (*it).emailList(); |
36 | if ((*it).fileAs().length()>0) { | 42 | if ((*it).fileAs().length()>0) |
43 | { | ||
37 | pre = "\""+(*it).firstName()+" "+(*it).lastName()+"\" <"; | 44 | pre = "\""+(*it).firstName()+" "+(*it).lastName()+"\" <"; |
38 | suf = ">"; | 45 | suf = ">"; |
39 | } else { | 46 | } |
47 | else | ||
48 | { | ||
40 | pre = ""; | 49 | pre = ""; |
@@ -43,3 +52,4 @@ AddressPicker::AddressPicker( QWidget *parent, const char *name, bool modal, WFl | |||
43 | QStringList::ConstIterator sit = mails.begin(); | 52 | QStringList::ConstIterator sit = mails.begin(); |
44 | for (;sit!=mails.end();++sit) { | 53 | for (;sit!=mails.end();++sit) |
54 | { | ||
45 | contactLine=pre+(*sit)+suf; | 55 | contactLine=pre+(*sit)+suf; |
@@ -49,3 +59,4 @@ AddressPicker::AddressPicker( QWidget *parent, const char *name, bool modal, WFl | |||
49 | } | 59 | } |
50 | if ( addressList->count() <= 0 ) { | 60 | if ( addressList->count() <= 0 ) |
61 | { | ||
51 | #if 0 | 62 | #if 0 |
@@ -57,3 +68,5 @@ AddressPicker::AddressPicker( QWidget *parent, const char *name, bool modal, WFl | |||
57 | okButton->setEnabled( false ); | 68 | okButton->setEnabled( false ); |
58 | } else { | 69 | } |
70 | else | ||
71 | { | ||
59 | // addressList->sort(); | 72 | // addressList->sort(); |
@@ -67,3 +80,4 @@ void AddressPicker::accept() | |||
67 | 80 | ||
68 | while ( item ) { | 81 | while ( item ) |
82 | { | ||
69 | if ( item->selected() ) | 83 | if ( item->selected() ) |
@@ -74,3 +88,4 @@ void AddressPicker::accept() | |||
74 | 88 | ||
75 | if ( names.isEmpty() ) { | 89 | if ( names.isEmpty() ) |
90 | { | ||
76 | QMessageBox::information(this, tr("Error"), tr("<p>You have to select" | 91 | QMessageBox::information(this, tr("Error"), tr("<p>You have to select" |
@@ -89,7 +104,6 @@ QString AddressPicker::getNames() | |||
89 | AddressPicker picker(0, 0, true); | 104 | AddressPicker picker(0, 0, true); |
90 | picker.showMaximized(); | ||
91 | picker.show(); | ||
92 | 105 | ||
93 | int ret = picker.exec(); | 106 | int ret = QPEApplication::execDialog( &picker ); |
94 | if ( QDialog::Accepted == ret ) { | 107 | if ( QDialog::Accepted == ret ) |
108 | { | ||
95 | return picker.selectedNames; | 109 | return picker.selectedNames; |