Diffstat (limited to 'kmicromail/libmailwrapper/storemail.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kmicromail/libmailwrapper/storemail.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/kmicromail/libmailwrapper/storemail.cpp b/kmicromail/libmailwrapper/storemail.cpp index ed1d44a..9d1735f 100644 --- a/kmicromail/libmailwrapper/storemail.cpp +++ b/kmicromail/libmailwrapper/storemail.cpp @@ -2,16 +2,17 @@ #include "mailwrapper.h" #include "settings.h" #include "abstractmail.h" #include <libetpan/libetpan.h> #include <qstring.h> #include <stdlib.h> +#include <kglobal.h> using namespace Opie::Core; Storemail::Storemail(Account*aAccount,const QString&aFolder) : Generatemail() { wrapper = 0; m_Account = aAccount; m_tfolder = aFolder; @@ -60,18 +61,25 @@ int Storemail::storeMail(const Opie::Core::OSmartPointer<Mail>&mail) qDebug("storeMail: error creating mime mail "); return 0; } char *data; size_t size; data = 0; mailmessage * msg = 0; - msg = mime_message_init(mimeMail); - mime_message_set_tmpdir(msg,getenv( "HOME" )); + msg = mime_message_init(mimeMail); + QString fileName; +#ifdef DESKTOP_VERSION + fileName = locateLocal("tmp", ""); +#else + fileName = "/tmp/"; +#endif + //mime_message_set_tmpdir(msg,getenv( "HOME" )); + mime_message_set_tmpdir(msg,(char*)fileName.latin1()); int r = mailmessage_fetch(msg,&data,&size); mime_message_detach_mime(msg); mailmessage_free(msg); msg = 0; if (r != MAIL_NO_ERROR || !data) { qDebug("Error fetching mime... "); ret = 0; } |