summaryrefslogtreecommitdiff
authoralwin <alwin>2004-07-19 13:25:12 (UTC)
committer alwin <alwin>2004-07-19 13:25:12 (UTC)
commit1397c4f0801d4bf1581c26e466453ba65f1b4261 (patch) (unidiff)
treedd57fbf32ca9371d77ae0a90aa564f8b07779a3f
parentf35e69d020bdce078e2fc11f3a5298118a33f346 (diff)
downloadopie-1397c4f0801d4bf1581c26e466453ba65f1b4261.zip
opie-1397c4f0801d4bf1581c26e466453ba65f1b4261.tar.gz
opie-1397c4f0801d4bf1581c26e466453ba65f1b4261.tar.bz2
block SIGPIPE global 'cause we can not satisfy it inside libetpan
itself.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/opiemail.cpp30
-rw-r--r--noncore/net/mail/opiemail.h3
2 files changed, 25 insertions, 8 deletions
diff --git a/noncore/net/mail/opiemail.cpp b/noncore/net/mail/opiemail.cpp
index 5399c3c..2f87e44 100644
--- a/noncore/net/mail/opiemail.cpp
+++ b/noncore/net/mail/opiemail.cpp
@@ -17,13 +17,17 @@
17#include <qpe/qpeapplication.h> 17#include <qpe/qpeapplication.h>
18 18
19/* QT */ 19/* QT */
20 20
21/* UNIX */
22#include <signal.h>
23
21using namespace Opie::Core; 24using namespace Opie::Core;
22 25
23OpieMail::OpieMail( QWidget *parent, const char *name, WFlags flags ) 26OpieMail::OpieMail( QWidget *parent, const char *name, WFlags flags )
24 : MainWindow( parent, name, WStyle_ContextHelp ) 27 : MainWindow( parent, name, WStyle_ContextHelp )
25{ 28{
29 setup_signalblocking();
26 settings = new Settings(); 30 settings = new Settings();
27 31
28 folderView->populate( settings->getAccounts() ); 32 folderView->populate( settings->getAccounts() );
29} 33}
@@ -32,8 +36,18 @@ OpieMail::~OpieMail()
32{ 36{
33 if (settings) delete settings; 37 if (settings) delete settings;
34} 38}
35 39
40void OpieMail::setup_signalblocking()
41{
42 /* for networking we must block SIGPIPE and Co. */
43 struct sigaction blocking_action,temp_action;
44 blocking_action.sa_handler = SIG_IGN;
45 sigemptyset(&(blocking_action.sa_mask));
46 blocking_action.sa_flags = 0;
47 sigaction(SIGPIPE,&blocking_action,&temp_action);
48}
49
36void OpieMail::appMessage(const QCString &msg, const QByteArray &data) 50void OpieMail::appMessage(const QCString &msg, const QByteArray &data)
37{ 51{
38 // copied from old mail2 52 // copied from old mail2
39 if (msg == "writeMail(QString,QString)") 53 if (msg == "writeMail(QString,QString)")
@@ -69,15 +83,15 @@ void OpieMail::slotwriteMail(const QString&name,const QString&email)
69} 83}
70 84
71void OpieMail::slotComposeMail() 85void OpieMail::slotComposeMail()
72{ 86{
73 odebug << "Compose Mail" << oendl; 87 odebug << "Compose Mail" << oendl;
74 slotwriteMail(0l,0l); 88 slotwriteMail(0l,0l);
75} 89}
76 90
77void OpieMail::slotSendQueued() 91void OpieMail::slotSendQueued()
78{ 92{
79 odebug << "Send Queued" << oendl; 93 odebug << "Send Queued" << oendl;
80 SMTPaccount *smtp = 0; 94 SMTPaccount *smtp = 0;
81 95
82 QList<Account> list = settings->getAccounts(); 96 QList<Account> list = settings->getAccounts();
83 QList<SMTPaccount> smtpList; 97 QList<SMTPaccount> smtpList;
@@ -122,9 +136,9 @@ void OpieMail::slotSendQueued()
122} 136}
123 137
124void OpieMail::slotSearchMails() 138void OpieMail::slotSearchMails()
125{ 139{
126 odebug << "Search Mails" << oendl; 140 odebug << "Search Mails" << oendl;
127} 141}
128 142
129void OpieMail::slotEditSettings() 143void OpieMail::slotEditSettings()
130{ 144{
@@ -133,9 +147,9 @@ void OpieMail::slotEditSettings()
133} 147}
134 148
135void OpieMail::slotEditAccounts() 149void OpieMail::slotEditAccounts()
136{ 150{
137 odebug << "Edit Accounts" << oendl; 151 odebug << "Edit Accounts" << oendl;
138 EditAccounts eaDialog( settings, this, 0, true, WStyle_ContextHelp ); 152 EditAccounts eaDialog( settings, this, 0, true, WStyle_ContextHelp );
139 eaDialog.slotAdjustColumns(); 153 eaDialog.slotAdjustColumns();
140 QPEApplication::execDialog( &eaDialog ); 154 QPEApplication::execDialog( &eaDialog );
141 if ( settings ) delete settings; 155 if ( settings ) delete settings;
@@ -182,9 +196,9 @@ void OpieMail::mailHold(int button, QListViewItem *item,const QPoint&,int )
182 if (!mailView->currentItem()) return; 196 if (!mailView->currentItem()) return;
183 MAILLIB::ATYPE mailtype = ((MailListViewItem*)mailView->currentItem() )->wrapperType(); 197 MAILLIB::ATYPE mailtype = ((MailListViewItem*)mailView->currentItem() )->wrapperType();
184 /* just the RIGHT button - or hold on pda */ 198 /* just the RIGHT button - or hold on pda */
185 if (button!=2) {return;} 199 if (button!=2) {return;}
186 odebug << "Event right/hold" << oendl; 200 odebug << "Event right/hold" << oendl;
187 if (!item) return; 201 if (!item) return;
188 QPopupMenu *m = new QPopupMenu(0); 202 QPopupMenu *m = new QPopupMenu(0);
189 if (m) 203 if (m)
190 { 204 {
@@ -206,17 +220,17 @@ void OpieMail::mailHold(int button, QListViewItem *item,const QPoint&,int )
206} 220}
207 221
208void OpieMail::slotShowFolders( bool show ) 222void OpieMail::slotShowFolders( bool show )
209{ 223{
210 odebug << "Show Folders" << oendl; 224 odebug << "Show Folders" << oendl;
211 if ( show && folderView->isHidden() ) 225 if ( show && folderView->isHidden() )
212 { 226 {
213 odebug << "-> showing" << oendl; 227 odebug << "-> showing" << oendl;
214 folderView->show(); 228 folderView->show();
215 } 229 }
216 else if ( !show && !folderView->isHidden() ) 230 else if ( !show && !folderView->isHidden() )
217 { 231 {
218 odebug << "-> hiding" << oendl; 232 odebug << "-> hiding" << oendl;
219 folderView->hide(); 233 folderView->hide();
220 } 234 }
221} 235}
222 236
diff --git a/noncore/net/mail/opiemail.h b/noncore/net/mail/opiemail.h
index b93bd60..3d25b3d 100644
--- a/noncore/net/mail/opiemail.h
+++ b/noncore/net/mail/opiemail.h
@@ -33,8 +33,11 @@ protected slots:
33 virtual void mailLeftClicked( int, QListViewItem *,const QPoint&,int ); 33 virtual void mailLeftClicked( int, QListViewItem *,const QPoint&,int );
34 virtual void slotMoveCopyMail(); 34 virtual void slotMoveCopyMail();
35 virtual void reEditMail(); 35 virtual void reEditMail();
36 36
37protected:
38 void setup_signalblocking();
39
37private: 40private:
38 Settings *settings; 41 Settings *settings;
39 42
40}; 43};