summaryrefslogtreecommitdiff
authoralwin <alwin>2004-07-19 13:25:12 (UTC)
committer alwin <alwin>2004-07-19 13:25:12 (UTC)
commit1397c4f0801d4bf1581c26e466453ba65f1b4261 (patch) (side-by-side diff)
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) (show whitespace changes)
-rw-r--r--noncore/net/mail/opiemail.cpp14
-rw-r--r--noncore/net/mail/opiemail.h3
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
@@ -13,31 +13,45 @@
#include <libmailwrapper/abstractmail.h>
/* OPIE */
#include <opie2/odebug.h>
#include <qpe/resource.h>
#include <qpe/qpeapplication.h>
/* QT */
+/* UNIX */
+#include <signal.h>
+
using namespace Opie::Core;
OpieMail::OpieMail( QWidget *parent, const char *name, WFlags flags )
: MainWindow( parent, name, WStyle_ContextHelp )
{
+ setup_signalblocking();
settings = new Settings();
folderView->populate( settings->getAccounts() );
}
OpieMail::~OpieMail()
{
if (settings) delete settings;
}
+void OpieMail::setup_signalblocking()
+{
+ /* for networking we must block SIGPIPE and Co. */
+ struct sigaction blocking_action,temp_action;
+ blocking_action.sa_handler = SIG_IGN;
+ sigemptyset(&(blocking_action.sa_mask));
+ blocking_action.sa_flags = 0;
+ sigaction(SIGPIPE,&blocking_action,&temp_action);
+}
+
void OpieMail::appMessage(const QCString &msg, const QByteArray &data)
{
// copied from old mail2
if (msg == "writeMail(QString,QString)")
{
QDataStream stream(data,IO_ReadOnly);
QString name, email;
stream >> name >> email;
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
@@ -29,14 +29,17 @@ protected slots:
virtual void slotDeleteMail();
virtual void mailHold(int, QListViewItem *,const QPoint&,int);
virtual void slotShowFolders( bool show );
virtual void refreshMailView(const QValueList<RecMailP>&);
virtual void mailLeftClicked( int, QListViewItem *,const QPoint&,int );
virtual void slotMoveCopyMail();
virtual void reEditMail();
+protected:
+ void setup_signalblocking();
+
private:
Settings *settings;
};
#endif