summaryrefslogtreecommitdiff
path: root/noncore/net
Side-by-side diff
Diffstat (limited to 'noncore/net') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/imapwrapper.cpp25
-rw-r--r--noncore/net/mail/libmailwrapper/imapwrapper.cpp25
2 files changed, 22 insertions, 28 deletions
diff --git a/noncore/net/mail/imapwrapper.cpp b/noncore/net/mail/imapwrapper.cpp
index 0178e33..89ec7ab 100644
--- a/noncore/net/mail/imapwrapper.cpp
+++ b/noncore/net/mail/imapwrapper.cpp
@@ -160,6 +160,6 @@ QList<Folder>* IMAPwrapper::listFolders()
const char *path, *mask;
int err = MAILIMAP_NO_ERROR;
- clist *result;
- clistcell *current;
+ clist *result = 0;
+ clistcell *current = 0;
QList<Folder> * folders = new QList<Folder>();
@@ -177,5 +177,4 @@ QList<Folder>* IMAPwrapper::listFolders()
QString temp;
mask = "INBOX" ;
- result = clist_new();
mailimap_mailbox_list *list;
err = mailimap_list( m_imap, (char*)"", (char*)mask, &result );
@@ -203,5 +202,4 @@ QList<Folder>* IMAPwrapper::listFolders()
path = account->getPrefix().latin1();
if (!path) path = "";
- result = clist_new();
qDebug(path);
bool selectable = true;
@@ -229,5 +227,5 @@ QList<Folder>* IMAPwrapper::listFolders()
qDebug("error fetching folders %s",m_imap->imap_response);
}
- mailimap_list_result_free( result );
+ if (result) mailimap_list_result_free( result );
return folders;
}
@@ -348,10 +346,10 @@ RecBody IMAPwrapper::fetchBody(const RecMail&mail)
const char *mb;
int err = MAILIMAP_NO_ERROR;
- clist *result;
+ clist *result = 0;
clistcell *current;
- mailimap_fetch_att *fetchAtt;
- mailimap_fetch_type *fetchType;
- mailimap_set *set;
- mailimap_body*body_desc;
+ mailimap_fetch_att *fetchAtt = 0;
+ mailimap_fetch_type *fetchType = 0;
+ mailimap_set *set = 0;
+ mailimap_body*body_desc = 0;
mb = mail.getMbox().latin1();
@@ -368,5 +366,4 @@ RecBody IMAPwrapper::fetchBody(const RecMail&mail)
}
- result = clist_new();
/* the range has to start at 1!!! not with 0!!!! */
set = mailimap_set_new_interval( mail.getNumber(),mail.getNumber() );
@@ -391,5 +388,5 @@ RecBody IMAPwrapper::fetchBody(const RecMail&mail)
qDebug("error fetching body: %s",m_imap->imap_response);
}
- mailimap_fetch_list_free(result);
+ if (result) mailimap_fetch_list_free(result);
return body;
}
@@ -510,5 +507,5 @@ encodedString*IMAPwrapper::fetchRawPart(const RecMail&mail,const QValueList<int>
fetchType = mailimap_fetch_type_new_fetch_att(fetch_att);
- clist*result = clist_new();
+ clist*result = 0;
err = mailimap_fetch( m_imap, set, fetchType, &result );
@@ -534,5 +531,5 @@ encodedString*IMAPwrapper::fetchRawPart(const RecMail&mail,const QValueList<int>
qDebug("error fetching text: %s",m_imap->imap_response);
}
- mailimap_fetch_list_free(result);
+ if (result) mailimap_fetch_list_free(result);
return res;
}
diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.cpp b/noncore/net/mail/libmailwrapper/imapwrapper.cpp
index 0178e33..89ec7ab 100644
--- a/noncore/net/mail/libmailwrapper/imapwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/imapwrapper.cpp
@@ -160,6 +160,6 @@ QList<Folder>* IMAPwrapper::listFolders()
const char *path, *mask;
int err = MAILIMAP_NO_ERROR;
- clist *result;
- clistcell *current;
+ clist *result = 0;
+ clistcell *current = 0;
QList<Folder> * folders = new QList<Folder>();
@@ -177,5 +177,4 @@ QList<Folder>* IMAPwrapper::listFolders()
QString temp;
mask = "INBOX" ;
- result = clist_new();
mailimap_mailbox_list *list;
err = mailimap_list( m_imap, (char*)"", (char*)mask, &result );
@@ -203,5 +202,4 @@ QList<Folder>* IMAPwrapper::listFolders()
path = account->getPrefix().latin1();
if (!path) path = "";
- result = clist_new();
qDebug(path);
bool selectable = true;
@@ -229,5 +227,5 @@ QList<Folder>* IMAPwrapper::listFolders()
qDebug("error fetching folders %s",m_imap->imap_response);
}
- mailimap_list_result_free( result );
+ if (result) mailimap_list_result_free( result );
return folders;
}
@@ -348,10 +346,10 @@ RecBody IMAPwrapper::fetchBody(const RecMail&mail)
const char *mb;
int err = MAILIMAP_NO_ERROR;
- clist *result;
+ clist *result = 0;
clistcell *current;
- mailimap_fetch_att *fetchAtt;
- mailimap_fetch_type *fetchType;
- mailimap_set *set;
- mailimap_body*body_desc;
+ mailimap_fetch_att *fetchAtt = 0;
+ mailimap_fetch_type *fetchType = 0;
+ mailimap_set *set = 0;
+ mailimap_body*body_desc = 0;
mb = mail.getMbox().latin1();
@@ -368,5 +366,4 @@ RecBody IMAPwrapper::fetchBody(const RecMail&mail)
}
- result = clist_new();
/* the range has to start at 1!!! not with 0!!!! */
set = mailimap_set_new_interval( mail.getNumber(),mail.getNumber() );
@@ -391,5 +388,5 @@ RecBody IMAPwrapper::fetchBody(const RecMail&mail)
qDebug("error fetching body: %s",m_imap->imap_response);
}
- mailimap_fetch_list_free(result);
+ if (result) mailimap_fetch_list_free(result);
return body;
}
@@ -510,5 +507,5 @@ encodedString*IMAPwrapper::fetchRawPart(const RecMail&mail,const QValueList<int>
fetchType = mailimap_fetch_type_new_fetch_att(fetch_att);
- clist*result = clist_new();
+ clist*result = 0;
err = mailimap_fetch( m_imap, set, fetchType, &result );
@@ -534,5 +531,5 @@ encodedString*IMAPwrapper::fetchRawPart(const RecMail&mail,const QValueList<int>
qDebug("error fetching text: %s",m_imap->imap_response);
}
- mailimap_fetch_list_free(result);
+ if (result) mailimap_fetch_list_free(result);
return res;
}