Diffstat (limited to 'noncore/net/mail/libmailwrapper/abstractmail.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/libmailwrapper/abstractmail.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/noncore/net/mail/libmailwrapper/abstractmail.cpp b/noncore/net/mail/libmailwrapper/abstractmail.cpp index 3d76c96..626b9aa 100644 --- a/noncore/net/mail/libmailwrapper/abstractmail.cpp +++ b/noncore/net/mail/libmailwrapper/abstractmail.cpp @@ -1,18 +1,20 @@ #include "abstractmail.h" #include "imapwrapper.h" #include "pop3wrapper.h" #include "mailtypes.h" #include <qstring.h> +#include <qfile.h> +#include <qtextstream.h> #include <stdlib.h> #include <libetpan/mailmime_content.h> AbstractMail* AbstractMail::getWrapper(IMAPaccount *a) { return new IMAPwrapper(a); } AbstractMail* AbstractMail::getWrapper(POP3account *a) { return new POP3wrapper(a); } @@ -57,12 +59,25 @@ QString AbstractMail::convert_String(const char*text) text, strlen(text),&index, "iso-8859-1",&res); if (err != MAILIMF_NO_ERROR) { if (res) free(res); return QString(text); } if (res) { QString result(res); free(res); return result; } return QString(text); } + +/* cp & paste from launcher */ +QString AbstractMail::gen_attachment_id() +{ + QFile file( "/proc/sys/kernel/random/uuid" ); + if (!file.open(IO_ReadOnly ) ) + return QString::null; + + QTextStream stream(&file); + + return "{" + stream.read().stripWhiteSpace() + "}"; +} + |