author | alwin <alwin> | 2004-07-19 13:25:12 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-07-19 13:25:12 (UTC) |
commit | 1397c4f0801d4bf1581c26e466453ba65f1b4261 (patch) (unidiff) | |
tree | dd57fbf32ca9371d77ae0a90aa564f8b07779a3f /noncore | |
parent | f35e69d020bdce078e2fc11f3a5298118a33f346 (diff) | |
download | opie-1397c4f0801d4bf1581c26e466453ba65f1b4261.zip opie-1397c4f0801d4bf1581c26e466453ba65f1b4261.tar.gz opie-1397c4f0801d4bf1581c26e466453ba65f1b4261.tar.bz2 |
block SIGPIPE global 'cause we can not satisfy it inside libetpan
itself.
-rw-r--r-- | noncore/net/mail/opiemail.cpp | 14 | ||||
-rw-r--r-- | noncore/net/mail/opiemail.h | 3 |
2 files changed, 17 insertions, 0 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 | |||
@@ -15,27 +15,41 @@ | |||
15 | #include <opie2/odebug.h> | 15 | #include <opie2/odebug.h> |
16 | #include <qpe/resource.h> | 16 | #include <qpe/resource.h> |
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 | |||
21 | using namespace Opie::Core; | 24 | using namespace Opie::Core; |
22 | 25 | ||
23 | OpieMail::OpieMail( QWidget *parent, const char *name, WFlags flags ) | 26 | OpieMail::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 | } |
30 | 34 | ||
31 | OpieMail::~OpieMail() | 35 | OpieMail::~OpieMail() |
32 | { | 36 | { |
33 | if (settings) delete settings; | 37 | if (settings) delete settings; |
34 | } | 38 | } |
35 | 39 | ||
40 | void 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 | |||
36 | void OpieMail::appMessage(const QCString &msg, const QByteArray &data) | 50 | void 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)") |
40 | { | 54 | { |
41 | QDataStream stream(data,IO_ReadOnly); | 55 | QDataStream stream(data,IO_ReadOnly); |
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 | |||
@@ -31,12 +31,15 @@ protected slots: | |||
31 | virtual void slotShowFolders( bool show ); | 31 | virtual void slotShowFolders( bool show ); |
32 | virtual void refreshMailView(const QValueList<RecMailP>&); | 32 | virtual void refreshMailView(const QValueList<RecMailP>&); |
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 | ||
37 | protected: | ||
38 | void setup_signalblocking(); | ||
39 | |||
37 | private: | 40 | private: |
38 | Settings *settings; | 41 | Settings *settings; |
39 | 42 | ||
40 | }; | 43 | }; |
41 | 44 | ||
42 | #endif | 45 | #endif |