summaryrefslogtreecommitdiffabout
path: root/kmicromail
authorzautrix <zautrix>2005-03-18 21:38:19 (UTC)
committer zautrix <zautrix>2005-03-18 21:38:19 (UTC)
commitf0232b7801f098b5842e3cd5a1fd804af98ab862 (patch) (unidiff)
tree7537ad5f4b86a4c7e0965051ce0082bcb8d023fa /kmicromail
parent246da4d3796f5e03a3ce5f2b2febe9e1c8dd7a7e (diff)
downloadkdepimpi-f0232b7801f098b5842e3cd5a1fd804af98ab862.zip
kdepimpi-f0232b7801f098b5842e3cd5a1fd804af98ab862.tar.gz
kdepimpi-f0232b7801f098b5842e3cd5a1fd804af98ab862.tar.bz2
etpan fixes
Diffstat (limited to 'kmicromail') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/libmailwrapper/mhwrapper.cpp23
1 files changed, 15 insertions, 8 deletions
diff --git a/kmicromail/libmailwrapper/mhwrapper.cpp b/kmicromail/libmailwrapper/mhwrapper.cpp
index 982d7a6..787e85d 100644
--- a/kmicromail/libmailwrapper/mhwrapper.cpp
+++ b/kmicromail/libmailwrapper/mhwrapper.cpp
@@ -175,12 +175,9 @@ QString MHwrapper::buildPath(const QString&p)
175} 175}
176 176
177int MHwrapper::createMbox(const QString&folder,const FolderP&pfolder,const QString&,bool ) 177int MHwrapper::createMbox(const QString&folder,const FolderP&pfolder,const QString&,bool )
178{ 178{
179 init_storage(); 179
180 if (!m_storage) {
181 return 0;
182 }
183 QString f; 180 QString f;
184 if (!pfolder) { 181 if (!pfolder) {
185 // toplevel folder 182 // toplevel folder
186 f = buildPath(folder); 183 f = buildPath(folder);
@@ -188,12 +185,21 @@ int MHwrapper::createMbox(const QString&folder,const FolderP&pfolder,const QStri
188 f = pfolder->getName(); 185 f = pfolder->getName();
189 f+="/"; 186 f+="/";
190 f+=folder; 187 f+=folder;
191 } 188 }
192 189 QFileInfo fi ( f );
190 if ( fi. exists () ) {
191 qDebug("folder exists ");
192 return 1;
193 }
194 qDebug("creating folder ---%s--- ",f.latin1() );
195 init_storage();
196 if (!m_storage) {
197 return 0;
198 }
193 int r = mailsession_create_folder(m_storage->sto_session,(char*)f.latin1()); 199 int r = mailsession_create_folder(m_storage->sto_session,(char*)f.latin1());
194 if (r != MAIL_NO_ERROR) { 200 if (r != MAIL_NO_ERROR) {
195 qDebug("error creating folder "); 201 qDebug("error %d creating folder %s", r, f.latin1());
196 return 0; 202 return 0;
197 } 203 }
198 return 1; 204 return 1;
199} 205}
@@ -206,14 +212,15 @@ void MHwrapper::storeMessage(const char*msg,size_t length, const QString&Folder)
206 } 212 }
207 QString f = buildPath(Folder); 213 QString f = buildPath(Folder);
208 int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1()); 214 int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1());
209 if (r!=MAIL_NO_ERROR) { 215 if (r!=MAIL_NO_ERROR) {
210 qDebug("error selecting folder! "); 216 qDebug("error selecting folder %d", r);
211 return; 217 return;
212 } 218 }
213 r = mailsession_append_message(m_storage->sto_session,(char*)msg,length); 219 r = mailsession_append_message(m_storage->sto_session,(char*)msg,length);
214 if (r!=MAIL_NO_ERROR) { 220 if (r!=MAIL_NO_ERROR) {
215 qDebug("error storing mail "); 221 if ( r != MAIL_ERROR_APPEND )
222 qDebug("error storing mail %d", r);
216 } 223 }
217 return; 224 return;
218} 225}
219 226