Diffstat (limited to 'noncore/net/mail/mboxwrapper.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/mail/mboxwrapper.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/noncore/net/mail/mboxwrapper.cpp b/noncore/net/mail/mboxwrapper.cpp index 293ae1b..6d69263 100644 --- a/noncore/net/mail/mboxwrapper.cpp +++ b/noncore/net/mail/mboxwrapper.cpp | |||
@@ -4,6 +4,7 @@ | |||
4 | #include <libetpan/libetpan.h> | 4 | #include <libetpan/libetpan.h> |
5 | #include <libetpan/mailstorage.h> | 5 | #include <libetpan/mailstorage.h> |
6 | #include <qdir.h> | 6 | #include <qdir.h> |
7 | #include <stdlib.h> | ||
7 | 8 | ||
8 | MBOXwrapper::MBOXwrapper(const QString & mbox_dir) | 9 | MBOXwrapper::MBOXwrapper(const QString & mbox_dir) |
9 | : Genericwrapper(),MBOXPath(mbox_dir) | 10 | : Genericwrapper(),MBOXPath(mbox_dir) |
@@ -23,15 +24,19 @@ void MBOXwrapper::listMessages(const QString & mailbox, QList<RecMail> &target ) | |||
23 | mailstorage*storage = mailstorage_new(NULL); | 24 | mailstorage*storage = mailstorage_new(NULL); |
24 | QString p = MBOXPath+"/"; | 25 | QString p = MBOXPath+"/"; |
25 | p+=mailbox; | 26 | p+=mailbox; |
27 | char*fname = 0; | ||
26 | 28 | ||
27 | int r = mbox_mailstorage_init(storage,strdup(p.latin1()),0,0,0); | 29 | fname = strdup(p.latin1()); |
30 | |||
31 | int r = mbox_mailstorage_init(storage,fname,0,0,0); | ||
28 | mailfolder*folder; | 32 | mailfolder*folder; |
29 | folder = mailfolder_new( storage,strdup(p.latin1()),NULL); | 33 | folder = mailfolder_new( storage,fname,NULL); |
30 | r = mailfolder_connect(folder); | 34 | r = mailfolder_connect(folder); |
31 | if (r != MAIL_NO_ERROR) { | 35 | if (r != MAIL_NO_ERROR) { |
32 | qDebug("Error initializing mbox"); | 36 | qDebug("Error initializing mbox"); |
33 | mailfolder_free(folder); | 37 | mailfolder_free(folder); |
34 | mailstorage_free(storage); | 38 | mailstorage_free(storage); |
39 | free(fname); | ||
35 | return; | 40 | return; |
36 | } | 41 | } |
37 | mailmessage_list * env_list = 0; | 42 | mailmessage_list * env_list = 0; |
@@ -40,6 +45,7 @@ void MBOXwrapper::listMessages(const QString & mailbox, QList<RecMail> &target ) | |||
40 | qDebug("Error message list"); | 45 | qDebug("Error message list"); |
41 | mailfolder_free(folder); | 46 | mailfolder_free(folder); |
42 | mailstorage_free(storage); | 47 | mailstorage_free(storage); |
48 | free(fname); | ||
43 | return; | 49 | return; |
44 | } | 50 | } |
45 | r = mailsession_get_envelopes_list(folder->fld_session, env_list); | 51 | r = mailsession_get_envelopes_list(folder->fld_session, env_list); |
@@ -50,6 +56,7 @@ void MBOXwrapper::listMessages(const QString & mailbox, QList<RecMail> &target ) | |||
50 | } | 56 | } |
51 | mailfolder_free(folder); | 57 | mailfolder_free(folder); |
52 | mailstorage_free(storage); | 58 | mailstorage_free(storage); |
59 | free(fname); | ||
53 | return; | 60 | return; |
54 | } | 61 | } |
55 | mailimf_references * refs; | 62 | mailimf_references * refs; |
@@ -103,6 +110,7 @@ void MBOXwrapper::listMessages(const QString & mailbox, QList<RecMail> &target ) | |||
103 | mailfolder_disconnect(folder); | 110 | mailfolder_disconnect(folder); |
104 | mailfolder_free(folder); | 111 | mailfolder_free(folder); |
105 | mailstorage_free(storage); | 112 | mailstorage_free(storage); |
113 | free(fname); | ||
106 | } | 114 | } |
107 | 115 | ||
108 | QList<Folder>* MBOXwrapper::listFolders() | 116 | QList<Folder>* MBOXwrapper::listFolders() |