-rw-r--r-- | noncore/net/mail/libmailwrapper/mailwrapper.cpp | 2 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/mailwrapper.h | 12 | ||||
-rw-r--r-- | noncore/net/mail/mail.pro | 1 | ||||
-rw-r--r-- | noncore/net/mail/mailwrapper.cpp | 2 | ||||
-rw-r--r-- | noncore/net/mail/mailwrapper.h | 12 |
5 files changed, 14 insertions, 15 deletions
diff --git a/noncore/net/mail/libmailwrapper/mailwrapper.cpp b/noncore/net/mail/libmailwrapper/mailwrapper.cpp index 17bed65..13a3fd9 100644 --- a/noncore/net/mail/libmailwrapper/mailwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/mailwrapper.cpp | |||
@@ -1,61 +1,61 @@ | |||
1 | #include <qfileinfo.h> | 1 | #include <qfileinfo.h> |
2 | #include <stdlib.h> | 2 | #include <stdlib.h> |
3 | #include <sys/stat.h> | 3 | #include <sys/stat.h> |
4 | #include <sys/types.h> | 4 | #include <sys/types.h> |
5 | #include <unistd.h> | 5 | #include <unistd.h> |
6 | #include <fcntl.h> | 6 | #include <fcntl.h> |
7 | #include <string.h> | 7 | #include <string.h> |
8 | #include <qdir.h> | 8 | #include <qdir.h> |
9 | #include <qtextstream.h> | 9 | #include <qtextstream.h> |
10 | 10 | ||
11 | #include "mailwrapper.h" | 11 | #include "mailwrapper.h" |
12 | #include "logindialog.h" | 12 | #include "logindialog.h" |
13 | #include "mail.h" | 13 | //#include "mail.h" |
14 | #include "defines.h" | 14 | #include "defines.h" |
15 | 15 | ||
16 | Attachment::Attachment( DocLnk lnk ) | 16 | Attachment::Attachment( DocLnk lnk ) |
17 | { | 17 | { |
18 | doc = lnk; | 18 | doc = lnk; |
19 | size = QFileInfo( doc.file() ).size(); | 19 | size = QFileInfo( doc.file() ).size(); |
20 | } | 20 | } |
21 | 21 | ||
22 | Folder::Folder(const QString&tmp_name ) | 22 | Folder::Folder(const QString&tmp_name ) |
23 | { | 23 | { |
24 | name = tmp_name; | 24 | name = tmp_name; |
25 | nameDisplay = name; | 25 | nameDisplay = name; |
26 | 26 | ||
27 | for ( int pos = nameDisplay.find( '&' ); pos != -1; | 27 | for ( int pos = nameDisplay.find( '&' ); pos != -1; |
28 | pos = nameDisplay.find( '&' ) ) { | 28 | pos = nameDisplay.find( '&' ) ) { |
29 | int end = nameDisplay.find( '-' ); | 29 | int end = nameDisplay.find( '-' ); |
30 | if ( end == -1 || end <= pos ) break; | 30 | if ( end == -1 || end <= pos ) break; |
31 | QString str64 = nameDisplay.mid( pos + 1, end - pos - 1 ); | 31 | QString str64 = nameDisplay.mid( pos + 1, end - pos - 1 ); |
32 | // TODO: do real base64 decoding here ! | 32 | // TODO: do real base64 decoding here ! |
33 | if ( str64.compare( "APw" ) == 0 ) { | 33 | if ( str64.compare( "APw" ) == 0 ) { |
34 | nameDisplay = nameDisplay.replace( pos, end - pos + 1, "ue" ); | 34 | nameDisplay = nameDisplay.replace( pos, end - pos + 1, "ue" ); |
35 | } else if ( str64.compare( "APY" ) == 0 ) { | 35 | } else if ( str64.compare( "APY" ) == 0 ) { |
36 | nameDisplay = nameDisplay.replace( pos, end - pos + 1, "oe" ); | 36 | nameDisplay = nameDisplay.replace( pos, end - pos + 1, "oe" ); |
37 | } | 37 | } |
38 | } | 38 | } |
39 | 39 | ||
40 | qDebug( "folder " + name + " - displayed as " + nameDisplay ); | 40 | qDebug( "folder " + name + " - displayed as " + nameDisplay ); |
41 | } | 41 | } |
42 | 42 | ||
43 | MailWrapper::MailWrapper( Settings *s ) | 43 | MailWrapper::MailWrapper( Settings *s ) |
44 | : QObject() | 44 | : QObject() |
45 | { | 45 | { |
46 | settings = s; | 46 | settings = s; |
47 | } | 47 | } |
48 | 48 | ||
49 | QString MailWrapper::mailsmtpError( int errnum ) | 49 | QString MailWrapper::mailsmtpError( int errnum ) |
50 | { | 50 | { |
51 | switch ( errnum ) { | 51 | switch ( errnum ) { |
52 | case MAILSMTP_NO_ERROR: | 52 | case MAILSMTP_NO_ERROR: |
53 | return tr( "No error" ); | 53 | return tr( "No error" ); |
54 | case MAILSMTP_ERROR_UNEXPECTED_CODE: | 54 | case MAILSMTP_ERROR_UNEXPECTED_CODE: |
55 | return tr( "Unexpected error code" ); | 55 | return tr( "Unexpected error code" ); |
56 | case MAILSMTP_ERROR_SERVICE_NOT_AVAILABLE: | 56 | case MAILSMTP_ERROR_SERVICE_NOT_AVAILABLE: |
57 | return tr( "Service not available" ); | 57 | return tr( "Service not available" ); |
58 | case MAILSMTP_ERROR_STREAM: | 58 | case MAILSMTP_ERROR_STREAM: |
59 | return tr( "Stream error" ); | 59 | return tr( "Stream error" ); |
60 | case MAILSMTP_ERROR_HOSTNAME: | 60 | case MAILSMTP_ERROR_HOSTNAME: |
61 | return tr( "gethostname() failed" ); | 61 | return tr( "gethostname() failed" ); |
diff --git a/noncore/net/mail/libmailwrapper/mailwrapper.h b/noncore/net/mail/libmailwrapper/mailwrapper.h index 3de28a0..f45eab7 100644 --- a/noncore/net/mail/libmailwrapper/mailwrapper.h +++ b/noncore/net/mail/libmailwrapper/mailwrapper.h | |||
@@ -1,59 +1,59 @@ | |||
1 | #ifndef MAILWRAPPER_H | 1 | #ifndef MAILWRAPPER_H |
2 | #define MAILWRAPPER_H | 2 | #define MAILWRAPPER_H |
3 | 3 | ||
4 | #include <qpe/applnk.h> | 4 | #include <qpe/applnk.h> |
5 | 5 | ||
6 | #include <mailmime.h> | 6 | #include <libetpan/mailmime.h> |
7 | #include <mailimf.h> | 7 | #include <libetpan/mailimf.h> |
8 | #include <mailsmtp.h> | 8 | #include <libetpan/mailsmtp.h> |
9 | #include <mailimap.h> | 9 | #include <libetpan/mailimap.h> |
10 | #include <mailstorage.h> | 10 | #include <libetpan/mailstorage.h> |
11 | #include <maildriver.h> | 11 | #include <libetpan/maildriver.h> |
12 | #include <qbitarray.h> | 12 | #include <qbitarray.h> |
13 | #include <qdatetime.h> | 13 | #include <qdatetime.h> |
14 | 14 | ||
15 | #include "settings.h" | 15 | #include "settings.h" |
16 | 16 | ||
17 | class Attachment | 17 | class Attachment |
18 | { | 18 | { |
19 | public: | 19 | public: |
20 | Attachment( DocLnk lnk ); | 20 | Attachment( DocLnk lnk ); |
21 | virtual ~Attachment(){} | 21 | virtual ~Attachment(){} |
22 | const QString getFileName()const{ return doc.file(); } | 22 | const QString getFileName()const{ return doc.file(); } |
23 | const QString getName()const{ return doc.name(); } | 23 | const QString getName()const{ return doc.name(); } |
24 | const QString getMimeType()const{ return doc.type(); } | 24 | const QString getMimeType()const{ return doc.type(); } |
25 | const QPixmap getPixmap()const{ return doc.pixmap(); } | 25 | const QPixmap getPixmap()const{ return doc.pixmap(); } |
26 | const int getSize()const { return size; } | 26 | const int getSize()const { return size; } |
27 | DocLnk getDocLnk() { return doc; } | 27 | DocLnk getDocLnk() { return doc; } |
28 | 28 | ||
29 | protected: | 29 | protected: |
30 | DocLnk doc; | 30 | DocLnk doc; |
31 | int size; | 31 | int size; |
32 | 32 | ||
33 | }; | 33 | }; |
34 | 34 | ||
35 | #define FLAG_ANSWERED 0 | 35 | #define FLAG_ANSWERED 0 |
36 | #define FLAG_FLAGGED 1 | 36 | #define FLAG_FLAGGED 1 |
37 | #define FLAG_DELETED 2 | 37 | #define FLAG_DELETED 2 |
38 | #define FLAG_SEEN 3 | 38 | #define FLAG_SEEN 3 |
39 | #define FLAG_DRAFT 4 | 39 | #define FLAG_DRAFT 4 |
40 | #define FLAG_RECENT 5 | 40 | #define FLAG_RECENT 5 |
41 | 41 | ||
42 | /* a class to describe mails in a mailbox */ | 42 | /* a class to describe mails in a mailbox */ |
43 | class RecMail | 43 | class RecMail |
44 | { | 44 | { |
45 | public: | 45 | public: |
46 | RecMail(); | 46 | RecMail(); |
47 | virtual ~RecMail(){} | 47 | virtual ~RecMail(){} |
48 | 48 | ||
49 | const int getNumber()const{return msg_number;} | 49 | const int getNumber()const{return msg_number;} |
50 | void setNumber(int number){msg_number=number;} | 50 | void setNumber(int number){msg_number=number;} |
51 | const QString&getDate()const{ return date; } | 51 | const QString&getDate()const{ return date; } |
52 | void setDate( const QString&a ) { date = a; } | 52 | void setDate( const QString&a ) { date = a; } |
53 | const QString&getFrom()const{ return from; } | 53 | const QString&getFrom()const{ return from; } |
54 | void setFrom( const QString&a ) { from = a; } | 54 | void setFrom( const QString&a ) { from = a; } |
55 | const QString&getSubject()const { return subject; } | 55 | const QString&getSubject()const { return subject; } |
56 | void setSubject( const QString&s ) { subject = s; } | 56 | void setSubject( const QString&s ) { subject = s; } |
57 | void setFlags(const QBitArray&flags){msg_flags = flags;} | 57 | void setFlags(const QBitArray&flags){msg_flags = flags;} |
58 | const QBitArray&getFlags()const{return msg_flags;} | 58 | const QBitArray&getFlags()const{return msg_flags;} |
59 | 59 | ||
diff --git a/noncore/net/mail/mail.pro b/noncore/net/mail/mail.pro index c913826..46a476d 100644 --- a/noncore/net/mail/mail.pro +++ b/noncore/net/mail/mail.pro | |||
@@ -1,40 +1,39 @@ | |||
1 | CONFIG += qt warn_on debug quick-app | 1 | CONFIG += qt warn_on debug quick-app |
2 | 2 | ||
3 | HEADERS = defines.h \ | 3 | HEADERS = defines.h \ |
4 | logindialog.h \ | 4 | logindialog.h \ |
5 | settings.h \ | 5 | settings.h \ |
6 | editaccounts.h \ | 6 | editaccounts.h \ |
7 | mailwrapper.h \ | 7 | mailwrapper.h \ |
8 | composemail.h \ | 8 | composemail.h \ |
9 | accountview.h \ | 9 | accountview.h \ |
10 | mainwindow.h \ | 10 | mainwindow.h \ |
11 | opiemail.h | 11 | opiemail.h |
12 | 12 | ||
13 | SOURCES = main.cpp \ | 13 | SOURCES = main.cpp \ |
14 | opiemail.cpp \ | 14 | opiemail.cpp \ |
15 | mainwindow.cpp \ | 15 | mainwindow.cpp \ |
16 | accountview.cpp \ | 16 | accountview.cpp \ |
17 | composemail.cpp \ | 17 | composemail.cpp \ |
18 | mailwrapper.cpp \ | 18 | mailwrapper.cpp \ |
19 | imapwrapper.cpp \ | 19 | imapwrapper.cpp \ |
20 | addresspicker.cpp \ | 20 | addresspicker.cpp \ |
21 | editaccounts.cpp \ | 21 | editaccounts.cpp \ |
22 | logindialog.cpp \ | 22 | logindialog.cpp \ |
23 | settings.cpp | 23 | settings.cpp |
24 | 24 | ||
25 | INTERFACES = editaccountsui.ui \ | 25 | INTERFACES = editaccountsui.ui \ |
26 | selectmailtypeui.ui \ | 26 | selectmailtypeui.ui \ |
27 | imapconfigui.ui \ | 27 | imapconfigui.ui \ |
28 | pop3configui.ui \ | 28 | pop3configui.ui \ |
29 | nntpconfigui.ui \ | 29 | nntpconfigui.ui \ |
30 | smtpconfigui.ui \ | 30 | smtpconfigui.ui \ |
31 | addresspickerui.ui \ | 31 | addresspickerui.ui \ |
32 | logindialogui.ui \ | 32 | logindialogui.ui \ |
33 | composemailui.ui | 33 | composemailui.ui |
34 | 34 | ||
35 | INCLUDEPATH += $(OPIEDIR)/include | 35 | INCLUDEPATH += $(OPIEDIR)/include |
36 | INCLUDEPATH += $(OPIEDIR)/include/libetpan | ||
37 | LIBS += -lqpe -lopie -letpan -lssl -lcrypto -ldb | 36 | LIBS += -lqpe -lopie -letpan -lssl -lcrypto -ldb |
38 | TARGET = opiemail | 37 | TARGET = opiemail |
39 | 38 | ||
40 | include ( $(OPIEDIR)/include.pro ) | 39 | include ( $(OPIEDIR)/include.pro ) |
diff --git a/noncore/net/mail/mailwrapper.cpp b/noncore/net/mail/mailwrapper.cpp index 17bed65..13a3fd9 100644 --- a/noncore/net/mail/mailwrapper.cpp +++ b/noncore/net/mail/mailwrapper.cpp | |||
@@ -1,61 +1,61 @@ | |||
1 | #include <qfileinfo.h> | 1 | #include <qfileinfo.h> |
2 | #include <stdlib.h> | 2 | #include <stdlib.h> |
3 | #include <sys/stat.h> | 3 | #include <sys/stat.h> |
4 | #include <sys/types.h> | 4 | #include <sys/types.h> |
5 | #include <unistd.h> | 5 | #include <unistd.h> |
6 | #include <fcntl.h> | 6 | #include <fcntl.h> |
7 | #include <string.h> | 7 | #include <string.h> |
8 | #include <qdir.h> | 8 | #include <qdir.h> |
9 | #include <qtextstream.h> | 9 | #include <qtextstream.h> |
10 | 10 | ||
11 | #include "mailwrapper.h" | 11 | #include "mailwrapper.h" |
12 | #include "logindialog.h" | 12 | #include "logindialog.h" |
13 | #include "mail.h" | 13 | //#include "mail.h" |
14 | #include "defines.h" | 14 | #include "defines.h" |
15 | 15 | ||
16 | Attachment::Attachment( DocLnk lnk ) | 16 | Attachment::Attachment( DocLnk lnk ) |
17 | { | 17 | { |
18 | doc = lnk; | 18 | doc = lnk; |
19 | size = QFileInfo( doc.file() ).size(); | 19 | size = QFileInfo( doc.file() ).size(); |
20 | } | 20 | } |
21 | 21 | ||
22 | Folder::Folder(const QString&tmp_name ) | 22 | Folder::Folder(const QString&tmp_name ) |
23 | { | 23 | { |
24 | name = tmp_name; | 24 | name = tmp_name; |
25 | nameDisplay = name; | 25 | nameDisplay = name; |
26 | 26 | ||
27 | for ( int pos = nameDisplay.find( '&' ); pos != -1; | 27 | for ( int pos = nameDisplay.find( '&' ); pos != -1; |
28 | pos = nameDisplay.find( '&' ) ) { | 28 | pos = nameDisplay.find( '&' ) ) { |
29 | int end = nameDisplay.find( '-' ); | 29 | int end = nameDisplay.find( '-' ); |
30 | if ( end == -1 || end <= pos ) break; | 30 | if ( end == -1 || end <= pos ) break; |
31 | QString str64 = nameDisplay.mid( pos + 1, end - pos - 1 ); | 31 | QString str64 = nameDisplay.mid( pos + 1, end - pos - 1 ); |
32 | // TODO: do real base64 decoding here ! | 32 | // TODO: do real base64 decoding here ! |
33 | if ( str64.compare( "APw" ) == 0 ) { | 33 | if ( str64.compare( "APw" ) == 0 ) { |
34 | nameDisplay = nameDisplay.replace( pos, end - pos + 1, "ue" ); | 34 | nameDisplay = nameDisplay.replace( pos, end - pos + 1, "ue" ); |
35 | } else if ( str64.compare( "APY" ) == 0 ) { | 35 | } else if ( str64.compare( "APY" ) == 0 ) { |
36 | nameDisplay = nameDisplay.replace( pos, end - pos + 1, "oe" ); | 36 | nameDisplay = nameDisplay.replace( pos, end - pos + 1, "oe" ); |
37 | } | 37 | } |
38 | } | 38 | } |
39 | 39 | ||
40 | qDebug( "folder " + name + " - displayed as " + nameDisplay ); | 40 | qDebug( "folder " + name + " - displayed as " + nameDisplay ); |
41 | } | 41 | } |
42 | 42 | ||
43 | MailWrapper::MailWrapper( Settings *s ) | 43 | MailWrapper::MailWrapper( Settings *s ) |
44 | : QObject() | 44 | : QObject() |
45 | { | 45 | { |
46 | settings = s; | 46 | settings = s; |
47 | } | 47 | } |
48 | 48 | ||
49 | QString MailWrapper::mailsmtpError( int errnum ) | 49 | QString MailWrapper::mailsmtpError( int errnum ) |
50 | { | 50 | { |
51 | switch ( errnum ) { | 51 | switch ( errnum ) { |
52 | case MAILSMTP_NO_ERROR: | 52 | case MAILSMTP_NO_ERROR: |
53 | return tr( "No error" ); | 53 | return tr( "No error" ); |
54 | case MAILSMTP_ERROR_UNEXPECTED_CODE: | 54 | case MAILSMTP_ERROR_UNEXPECTED_CODE: |
55 | return tr( "Unexpected error code" ); | 55 | return tr( "Unexpected error code" ); |
56 | case MAILSMTP_ERROR_SERVICE_NOT_AVAILABLE: | 56 | case MAILSMTP_ERROR_SERVICE_NOT_AVAILABLE: |
57 | return tr( "Service not available" ); | 57 | return tr( "Service not available" ); |
58 | case MAILSMTP_ERROR_STREAM: | 58 | case MAILSMTP_ERROR_STREAM: |
59 | return tr( "Stream error" ); | 59 | return tr( "Stream error" ); |
60 | case MAILSMTP_ERROR_HOSTNAME: | 60 | case MAILSMTP_ERROR_HOSTNAME: |
61 | return tr( "gethostname() failed" ); | 61 | return tr( "gethostname() failed" ); |
diff --git a/noncore/net/mail/mailwrapper.h b/noncore/net/mail/mailwrapper.h index 3de28a0..f45eab7 100644 --- a/noncore/net/mail/mailwrapper.h +++ b/noncore/net/mail/mailwrapper.h | |||
@@ -1,59 +1,59 @@ | |||
1 | #ifndef MAILWRAPPER_H | 1 | #ifndef MAILWRAPPER_H |
2 | #define MAILWRAPPER_H | 2 | #define MAILWRAPPER_H |
3 | 3 | ||
4 | #include <qpe/applnk.h> | 4 | #include <qpe/applnk.h> |
5 | 5 | ||
6 | #include <mailmime.h> | 6 | #include <libetpan/mailmime.h> |
7 | #include <mailimf.h> | 7 | #include <libetpan/mailimf.h> |
8 | #include <mailsmtp.h> | 8 | #include <libetpan/mailsmtp.h> |
9 | #include <mailimap.h> | 9 | #include <libetpan/mailimap.h> |
10 | #include <mailstorage.h> | 10 | #include <libetpan/mailstorage.h> |
11 | #include <maildriver.h> | 11 | #include <libetpan/maildriver.h> |
12 | #include <qbitarray.h> | 12 | #include <qbitarray.h> |
13 | #include <qdatetime.h> | 13 | #include <qdatetime.h> |
14 | 14 | ||
15 | #include "settings.h" | 15 | #include "settings.h" |
16 | 16 | ||
17 | class Attachment | 17 | class Attachment |
18 | { | 18 | { |
19 | public: | 19 | public: |
20 | Attachment( DocLnk lnk ); | 20 | Attachment( DocLnk lnk ); |
21 | virtual ~Attachment(){} | 21 | virtual ~Attachment(){} |
22 | const QString getFileName()const{ return doc.file(); } | 22 | const QString getFileName()const{ return doc.file(); } |
23 | const QString getName()const{ return doc.name(); } | 23 | const QString getName()const{ return doc.name(); } |
24 | const QString getMimeType()const{ return doc.type(); } | 24 | const QString getMimeType()const{ return doc.type(); } |
25 | const QPixmap getPixmap()const{ return doc.pixmap(); } | 25 | const QPixmap getPixmap()const{ return doc.pixmap(); } |
26 | const int getSize()const { return size; } | 26 | const int getSize()const { return size; } |
27 | DocLnk getDocLnk() { return doc; } | 27 | DocLnk getDocLnk() { return doc; } |
28 | 28 | ||
29 | protected: | 29 | protected: |
30 | DocLnk doc; | 30 | DocLnk doc; |
31 | int size; | 31 | int size; |
32 | 32 | ||
33 | }; | 33 | }; |
34 | 34 | ||
35 | #define FLAG_ANSWERED 0 | 35 | #define FLAG_ANSWERED 0 |
36 | #define FLAG_FLAGGED 1 | 36 | #define FLAG_FLAGGED 1 |
37 | #define FLAG_DELETED 2 | 37 | #define FLAG_DELETED 2 |
38 | #define FLAG_SEEN 3 | 38 | #define FLAG_SEEN 3 |
39 | #define FLAG_DRAFT 4 | 39 | #define FLAG_DRAFT 4 |
40 | #define FLAG_RECENT 5 | 40 | #define FLAG_RECENT 5 |
41 | 41 | ||
42 | /* a class to describe mails in a mailbox */ | 42 | /* a class to describe mails in a mailbox */ |
43 | class RecMail | 43 | class RecMail |
44 | { | 44 | { |
45 | public: | 45 | public: |
46 | RecMail(); | 46 | RecMail(); |
47 | virtual ~RecMail(){} | 47 | virtual ~RecMail(){} |
48 | 48 | ||
49 | const int getNumber()const{return msg_number;} | 49 | const int getNumber()const{return msg_number;} |
50 | void setNumber(int number){msg_number=number;} | 50 | void setNumber(int number){msg_number=number;} |
51 | const QString&getDate()const{ return date; } | 51 | const QString&getDate()const{ return date; } |
52 | void setDate( const QString&a ) { date = a; } | 52 | void setDate( const QString&a ) { date = a; } |
53 | const QString&getFrom()const{ return from; } | 53 | const QString&getFrom()const{ return from; } |
54 | void setFrom( const QString&a ) { from = a; } | 54 | void setFrom( const QString&a ) { from = a; } |
55 | const QString&getSubject()const { return subject; } | 55 | const QString&getSubject()const { return subject; } |
56 | void setSubject( const QString&s ) { subject = s; } | 56 | void setSubject( const QString&s ) { subject = s; } |
57 | void setFlags(const QBitArray&flags){msg_flags = flags;} | 57 | void setFlags(const QBitArray&flags){msg_flags = flags;} |
58 | const QBitArray&getFlags()const{return msg_flags;} | 58 | const QBitArray&getFlags()const{return msg_flags;} |
59 | 59 | ||