Diffstat (limited to 'kmicromail/libmailwrapper/mhwrapper.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kmicromail/libmailwrapper/mhwrapper.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/kmicromail/libmailwrapper/mhwrapper.cpp b/kmicromail/libmailwrapper/mhwrapper.cpp index 7ef9b32..cbc52d9 100644 --- a/kmicromail/libmailwrapper/mhwrapper.cpp +++ b/kmicromail/libmailwrapper/mhwrapper.cpp | |||
@@ -1,12 +1,13 @@ | |||
1 | // CHANGED 2004-09-31 Lutz Rogowski | ||
1 | #include "mhwrapper.h" | 2 | #include "mhwrapper.h" |
2 | #include "mailtypes.h" | 3 | #include "mailtypes.h" |
3 | #include "mailwrapper.h" | 4 | #include "mailwrapper.h" |
4 | #include <libetpan/libetpan.h> | 5 | #include <libetpan/libetpan.h> |
5 | #include <qdir.h> | 6 | #include <qdir.h> |
6 | #include <qmessagebox.h> | 7 | #include <qmessagebox.h> |
7 | #include <stdlib.h> | 8 | #include <stdlib.h> |
8 | #include <qpe/global.h> | 9 | #include <qpe/global.h> |
9 | #include <oprocess.h> | 10 | #include <oprocess.h> |
10 | //#include <opie2/odebug.h> | 11 | //#include <opie2/odebug.h> |
11 | 12 | ||
12 | using namespace Opie::Core; | 13 | using namespace Opie::Core; |
@@ -53,37 +54,37 @@ void MHwrapper::clean_storage() | |||
53 | if (m_storage) { | 54 | if (m_storage) { |
54 | mailstorage_disconnect(m_storage); | 55 | mailstorage_disconnect(m_storage); |
55 | mailstorage_free(m_storage); | 56 | mailstorage_free(m_storage); |
56 | m_storage = 0; | 57 | m_storage = 0; |
57 | } | 58 | } |
58 | } | 59 | } |
59 | 60 | ||
60 | MHwrapper::~MHwrapper() | 61 | MHwrapper::~MHwrapper() |
61 | { | 62 | { |
62 | clean_storage(); | 63 | clean_storage(); |
63 | } | 64 | } |
64 | 65 | ||
65 | void MHwrapper::listMessages(const QString & mailbox, QValueList<Opie::Core::OSmartPointer<RecMail> > &target ) | 66 | void MHwrapper::listMessages(const QString & mailbox, QValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb ) |
66 | { | 67 | { |
67 | init_storage(); | 68 | init_storage(); |
68 | if (!m_storage) { | 69 | if (!m_storage) { |
69 | return; | 70 | return; |
70 | } | 71 | } |
71 | QString f = buildPath(mailbox); | 72 | QString f = buildPath(mailbox); |
72 | int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1()); | 73 | int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1()); |
73 | if (r!=MAIL_NO_ERROR) { | 74 | if (r!=MAIL_NO_ERROR) { |
74 | qDebug("listMessages: error selecting folder! "); | 75 | qDebug("listMessages: error selecting folder! "); |
75 | return; | 76 | return; |
76 | } | 77 | } |
77 | parseList(target,m_storage->sto_session,f); | 78 | parseList(target,m_storage->sto_session,f, false, maxSizeInKb ); |
78 | Global::statusMessage(tr("Mailbox has %1 mail(s)").arg(target.count())); | 79 | Global::statusMessage(tr("Mailbox has %1 mail(s)").arg(target.count())); |
79 | } | 80 | } |
80 | 81 | ||
81 | QValueList<Opie::Core::OSmartPointer<Folder> >* MHwrapper::listFolders() | 82 | QValueList<Opie::Core::OSmartPointer<Folder> >* MHwrapper::listFolders() |
82 | { | 83 | { |
83 | QValueList<Opie::Core::OSmartPointer<Folder> >* folders = new QValueList<Opie::Core::OSmartPointer<Folder> >(); | 84 | QValueList<Opie::Core::OSmartPointer<Folder> >* folders = new QValueList<Opie::Core::OSmartPointer<Folder> >(); |
84 | /* this is needed! */ | 85 | /* this is needed! */ |
85 | if (m_storage) mailstorage_disconnect(m_storage); | 86 | if (m_storage) mailstorage_disconnect(m_storage); |
86 | init_storage(); | 87 | init_storage(); |
87 | if (!m_storage) { | 88 | if (!m_storage) { |
88 | return folders; | 89 | return folders; |
89 | } | 90 | } |